Can't restore the native function of a prefix key when #InputLevel is set to nonzero value

Report problems with documented functionality
blza
Posts: 18
Joined: 01 Sep 2015, 09:23
GitHub: blza

Can't restore the native function of a prefix key when #InputLevel is set to nonzero value

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.

Code: Select all

#InputLevel 1
Space & LAlt::
    OutputDebug, %A_ThisHotkey%                
    return
Space:: 
    OutputDebug, %A_ThisHotkey%
    Send, {Space}
    return
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.

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
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).

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
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.
lexikos
Posts: 6176
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: Can't restore the native function of a prefix key when #InputLevel is set to nonzero value

26 Nov 2017, 23:14

You may have found a bug, but...
blza wrote: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.
You don't need #InputLevel for that; just call SendLevel before calling Send.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 4 guests