You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would very useful to implement the return code for the hooks to stop certain keystrokes for monitored keyboards reaching also the standard input.
My use case is that a barcode scanner input get captured but the input also arrives on the System.in InputStream too.
An R/W marker method setHandled(), or stopProcessing() could indicate that the CallNextHookEx() should be bypassed for this iteration.
If nCode is less than zero, the hook procedure must return the value returned by CallNextHookEx.
If nCode is greater than or equal to zero, and the hook procedure did not process the message, it is highly recommended that you call CallNextHookEx and return the value it returns; otherwise, other applications that have installed WH_KEYBOARD_LL hooks will not receive hook notifications and may behave incorrectly as a result.
If the hook procedure processed the message, it may return a nonzero value to prevent the system from passing the message to the rest of the hook chain or the target window procedure.
The text was updated successfully, but these errors were encountered:
Hey @c-giannoulis, sounds like a good addition. Thanks for providing the reference to the API. Feel free to provide a PR adding this feature. At the moment I don't have the time to work on the project, but I would be happy to review & merge a PR any point in time. Thanks.
It would very useful to implement the return code for the hooks to stop certain keystrokes for monitored keyboards reaching also the standard input.
My use case is that a barcode scanner input get captured but the input also arrives on the System.in InputStream too.
An R/W marker method setHandled(), or stopProcessing() could indicate that the CallNextHookEx() should be bypassed for this iteration.
ref: https://learn.microsoft.com/en-us/windows/win32/winmsg/lowlevelkeyboardproc
If nCode is less than zero, the hook procedure must return the value returned by CallNextHookEx.
If nCode is greater than or equal to zero, and the hook procedure did not process the message, it is highly recommended that you call CallNextHookEx and return the value it returns; otherwise, other applications that have installed WH_KEYBOARD_LL hooks will not receive hook notifications and may behave incorrectly as a result.
If the hook procedure processed the message, it may return a nonzero value to prevent the system from passing the message to the rest of the hook chain or the target window procedure.
The text was updated successfully, but these errors were encountered: