Jump to content
Sign in to follow this  
OiMunk

HotKeySet() not swallowing keystroke..

Recommended Posts

OiMunk

Despite using HotkeySet(), the window is still receiving the set key. Strangely, the key is not passed for every other application except the one I'm using it for (EarMaster Pro). Are some applications written in a way that nullifies the key swallow?

HotKeySet("{SPACE}","test")

HotKeySet("{ESC}","exitt")

while 1 ; main LOOP

sleep(11)

WEnd

Func test()

;do something

sleep(11)

EndFunc

Func exitt()

HotKeySet("{ESC}")

HotKeySet("{SPACE}")

Exit

EndFunc

Share this post


Link to post
Share on other sites
OiMunk

The problem is that the key is passed regardless of whether I've set the hotkey or not. I actually need to use the hotkey in the stubborn application, so I don't see how that switch would help.

In case my example wasn't clear:

the "{SPACE}" key is sent to the window, even though i've used hotkeyset("{SPACE}","test"). A bug?

cheers

Share this post


Link to post
Share on other sites
Authenticity

It seems like you can't do that using HotKeySet because if you use SetWindowsHookEx you can still be notified about WM_KEY* events. Try to test using the example of _WinAPI_SetWindowsHookEx and see if you can block the key from being sent to the rest of the chain. Try once when your script load first and once when after.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.