laruffii
laruffii

Reputation: 450

Avoiding loop when Double pressing same shortcut key without changing original 1 press shortcut key function (Autohotkey)

I want to produce something like this : 1. When i press Esc 2 times (double) i want to produce my "made-up custom action" 2. When i press Esc 1 time i want to produce the original Escape

ok, here is the explanation of my question :

after i try the code above : suppose i press "Escape" button it will loop the Escape as if i press Escape 2 times. So my real question is how to make "original 1 times press Esc key function" won't loop to "our custom 2 times press Esc key function" ?

Upvotes: 0

Views: 147

Answers (1)

Michael
Michael

Reputation: 1353

Change the first line of your code to;

$Escape::

This will set it so that the hotkey is only triggered by real keystrokes not simulated ones.

Upvotes: 1

Related Questions