Comments (7)
Interesting... Will need take a look at this.
False alarm, the mistake was on my side...
As the User32 functions (RegisterHotKey
and UnregisterHotKey
) are called using the this
as the handle, I had to Invoke
on the UI thread everytime I call one of your method that relies on those windows API functions. I forgot to do that for the suspend()
and resume()
calls. (which resulted in a silent ignore).
You should consider catching bool
return value from HotkeyCore.UnregisterKey
and HotkeyCore.RegisterKey
for such cases. Maybe, if I'm actually doing it correctly, point the use of Invoke
if calls are performed on background threads (maybe as a note in the README?).
Sorry again for the false alarm...
I truely love this project and the work you've done here, you're gold !
from hotkeylistener.
I'll definitely consider adding suspension of specific hotkeys.
For now however, try removing then re-adding a hotkey when needed.
You can also temporarily update a hotkey to another key then re-update to the original key after an action has taken place.
from hotkeylistener.
I'll definitely consider adding suspension of specific hotkeys.
For now however, try removing then re-adding a hotkey when needed.You can also temporarily update a hotkey to another key then re-update to the original key after an action has taken place.
Lovely !
By the way it seems like when hotkeys are suspended and a WndProc(ref Message m)
is called just afterwards, if the key is an old one then an exception occurs because it tries to access an element in the dictionary that does not exist anymore : 'System.Collections.Generic.KeyNotFoundException' (see Hotkey = HotkeyListener.Convert(this.Hotkeys[m.WParam.ToInt32()])).
from hotkeylistener.
Checkout the latest release v1.4.0
.
from hotkeylistener.
In that case, you can use HotkeyListener's Suspend([hotkey])
method. This will allow you to suspend any specific hotkey and later on resume using it by calling the method Resume([hotkey])
.
from hotkeylistener.
In that case, you can use HotkeyListener's
Suspend([hotkey])
method. This will allow you to suspend any specific hotkey and later on resume using it by calling the methodResume([hotkey])
.
I have thought of using this logic (much better than an aggressive SendKeys
) but Resume()
and Suspend()
only perform on all Hotkeys (and not specific). I could create a listener for each Hotkey
but this seems a bit overkill.
from hotkeylistener.
Interesting... Will need take a look at this.
from hotkeylistener.
Related Issues (20)
- Selections don't work in Firefox Browser HOT 3
- WPF support for HotkeySelector HOT 1
- Question: Sending an hotkey stored class Hotkey to windows application HOT 1
- Creation of HotKey Class instance using a string only works if correct upper/lowercase is used HOT 1
- save hotkey in settings HOT 6
- .net 5.0 support HOT 1
- Having trouble using hotkeys with a console app
- Strange behavior of Google Chrome HOT 2
- AccessViolationException on Windows 11 HOT 5
- KeyNotFoundException when hotkey is pressed twice and suspending HOT 1
- ScrollLock based combo's HOT 1
- Win32Exception thrown in even the most basic program
- How do I change hotkeys HOT 3
- key PageDown
- Win Key Exception
- Screen resizes
- Exception raised in UIAutomationClientsideProviders.dll (see GetTextFromAutomationElement) HOT 3
- Issues with single key hotkey HOT 3
- Compile Error in VS 2019 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hotkeylistener.