Hotkeys: Trigger only first modifier key down event (e. g. ~Shift::)

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
hotkeyguy
Posts: 170
Joined: 11 Oct 2014, 12:22

Hotkeys: Trigger only first modifier key down event (e. g. ~Shift::)

Post by hotkeyguy » 27 Nov 2021, 12:22

Hello again,

with e. g.
~Shift::
; do something
return

the event is triggered multiple times until Shift is released (triggering Shift Up::). Is there any way to avoid that or must I manage that behaviour by my own code?


Many thanks and greetings
hotkeyguy

User avatar
mikeyww
Posts: 26851
Joined: 09 Sep 2014, 18:38

Re: Hotkeys: Trigger only first modifier key down event (e. g. ~Shift::)

Post by mikeyww » 27 Nov 2021, 12:24

Code: Select all

~Shift::
SoundBeep, 1500
Send {Blind}x
KeyWait, Shift
SoundBeep, 1000
Return

hotkeyguy
Posts: 170
Joined: 11 Oct 2014, 12:22

Re: Hotkeys: Trigger only first modifier key down event (e. g. ~Shift::)

Post by hotkeyguy » 27 Nov 2021, 12:46

Hello mikeyww,

thanks for your answer! My problem is that I must be able to process other modifiers when one is already pressed. KeyWait blocks that.
In more detail combinations of the Shift-, Ctrl- and Alt-keys in any order are possible.

Greetings
hotkeyguy

User avatar
mikeyww
Posts: 26851
Joined: 09 Sep 2014, 18:38

Re: Hotkeys: Trigger only first modifier key down event (e. g. ~Shift::)

Post by mikeyww » 27 Nov 2021, 12:55

You can give an example of what your script should do.

Post Reply

Return to “Ask for Help (v1)”