Is there a way to SuppressKeyPress? #15
-
|
Hi! First just wanted to say thank you for this very handy library which has been working great for me :) But I am trying to handle hotkey sequences in my program and in the past have used Any idea how I could handle this platform independently? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Hi! Thanks for asking! Yes, suppressing input events is possible, but I guess it's not quite clear. The In the next version I'll probably introduce a new property like Bear in mind that suppressing events only works on Windows and macOS - it doesn't work on Linux. Also, it must be done in a synchronous event handler, so you need to use |
Beta Was this translation helpful? Give feedback.
-
|
FYI, in version 4.0.0 the way to suppress events became a little more clear - e.SuppressEvent = true; |
Beta Was this translation helpful? Give feedback.
Hi! Thanks for asking!
Yes, suppressing input events is possible, but I guess it's not quite clear. The
HookEventArgsclass contains theReservedproperty which you can use to suppress an event:In the next version I'll probably introduce a new property like
SuppressEventor something like that so it'll be more clear.Bear in mind that suppressing events only works on Windows and macOS - it doesn't work on Linux. Also, it must be done in a synchronous event handler, so you need to use
SimpleGlobalHookinstead ofTaskPoolGlobalHook. If you want to know why then you can read more here.