I figured this is simple. Either CTRL+Space is supposed to work in a hotkey control, or it doesn't. It doesn't seem to work, and it seems intention, I'm just asking if it is.
As soon as I press the {Space} the control changes to "None" while I'm holding CTRL. Oddly enough, I can pre-populate it with CTRL+Space.
I've made sure to close all my other scripts to ensure there's no other conflicts.
EDIT: On the bright side, I can use OnEvent("change",...) to wait for GetKeyState() on CTRL and Space, then I can set ctl.Value := "^Space". Unless I'm doing something else wrong, the workaround for this isn't too invasive.
Hotkey Control - CTRL+Space not supported? Topic is solved
Re: Hotkey Control - CTRL+Space not supported?
Oops, meant to post in AHK v2 help. Using AHK v2-a112 currently.
« AHK Portable Installer » | « CallTipsForAll » | « TheArkive AHK v1 Scripts » | « TheArkive AHK v2 Scrpts » | « TheArkive on GitHub »
Re: Hotkey Control - CTRL+Space not supported? Topic is solved
appears to be just a limitation of the win32 hotkey control, eg Ctrl + Backspace, Alt + Space dont get intercepted either and perform their original functions instead
it could befixedworked around in source(as it is done for some other controls). i dont know if it will be
it could be
Re: Hotkey Control - CTRL+Space not supported?
The standard (Microsoft) Hotkey control is very limited by comparison to hook hotkeys. I think extending it to support the full range of hotkeys would be quite difficult - it would be easier to implement a new Hotkey control based on an Edit or Text control. (Doing this in script is easier than in C++. One can use OnMessage and/or InputHook.)
Re: Hotkey Control - CTRL+Space not supported?
I managed to work around it like this:
So far so good!
I might try to come up with a class or function to extend this support, like you said, based on an edit box, and probably WM_KEYDOWN or something.
Code: Select all
gui_hotkey_events(ctl, info) {
result := ""
ctrl := GetKeyState("Ctrl") ; fix key combos with {Space}
alt := GetKeyState("Alt") ; fix key combos with {Space}
shift := GetKeyState("Shift") ; fix key combos with {Space}
If ((ctrl Or alt Or shift) And GetKeyState("Space"))
result := (ctrl ? "^" : "") (alt ? "!" : "") (shift ? "+" : "") "Space"
result ? ctl.Value := result : ""
}
I might try to come up with a class or function to extend this support, like you said, based on an edit box, and probably WM_KEYDOWN or something.
« AHK Portable Installer » | « CallTipsForAll » | « TheArkive AHK v1 Scripts » | « TheArkive AHK v2 Scrpts » | « TheArkive on GitHub »