OiMunk Posted April 12, 2009 Share Posted April 12, 2009 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 Link to comment Share on other sites More sharing options...
Authenticity Posted April 12, 2009 Share Posted April 12, 2009 You need something like this if you have a window or whatever that can help you to determine whether to handle the hot-key or to pass it: If WinGetHandle("[ACTIVE]") = $hGUI Then Exit Else HotKeySet("{ESC}") Send("{ESC}") HotKeySet("{ESC}", "exitt") EndIf Link to comment Share on other sites More sharing options...
OiMunk Posted April 12, 2009 Author Share Posted April 12, 2009 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 Link to comment Share on other sites More sharing options...
Authenticity Posted April 12, 2009 Share Posted April 12, 2009 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now