Can't restore the native function of a prefix key when #InputLevel is set to nonzero value
Posted: 12 Sep 2017, 10:54
I'm using the latest version of AHK (1.1.26.01) and the following script fails to send Space key to the active window when I release Space key. So Space key gets disabled.
Without #InputLevel it works fine. Exactly as described in AHK help file (see "Custom combinations").
If I run the script without #InputLevel 1 I get the following in the KeyHistory after hitting Space. And it gets sent to the active window.
But with #InputLevel 1 I get the the following and the Space is not sent though hotkey is triggered (as can be seen in Lines most recently executed and in DebugView).
What I want is to be able to trigger hotkeys that use Space in another AHK script running, that's why I need #InputLevel set to 1 as it consequently sets SendLevel to 1.
I think it's a bug and not the expected behaviour.
Code: Select all
#InputLevel 1
Space & LAlt::
OutputDebug, %A_ThisHotkey%
return
Space::
OutputDebug, %A_ThisHotkey%
Send, {Space}
return
If I run the script without #InputLevel 1 I get the following in the KeyHistory after hitting Space. And it gets sent to the active window.
Code: Select all
VK SC Type Up/Dn Elapsed Key
---------------------------------------------------
20 039 s d 0.76 Space
20 039 h u 0.08 Space
20 039 i d 0.05 Space
20 039 i u 0.00 Space
Code: Select all
VK SC Type Up/Dn Elapsed Key
---------------------------------------------------
20 039 s d 0.76 Space
20 039 h u 0.08 Space
20 039 a d 0.05 Space
20 039 i u 0.00 Space
I think it's a bug and not the expected behaviour.