Search code examples
scriptingkeyboardkeyboard-shortcutsautohotkeykey-bindings

How to trigger an action if there's only one key being pressed?


Here's my current script:

Shift::Send ^{Space}

It doesn't only trigger ^{Space} on pressing Shift alone, it also triggers on Alt+Shift (just these two keys) and Ctrl+Shift (just these two keys) if Shift is the last released, is there a way to trigger ^{Space} if Shift is the only key being pressed?

AutoHotkey Version: 1.1.33.09.


Solution

  • Here's my working script:

    ~*Alt::
    ~*Ctrl::
    ~*Shift::return
    
    Shift::SendEvent ^{Space}