Duplicate Hotkey Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
haomingchen1998
Posts: 162
Joined: 20 Feb 2023, 16:37

Duplicate Hotkey

Post by haomingchen1998 » 04 Jun 2023, 11:30

I have two script using same hotkey, but one requires holding ESC key to trigger, and the other requires double press ESC key twice. But when I use both script, it will trigger duplicate hotkey error. Is there a way to make them work together? Thanks a lot!

Code: Select all

; Press ESC twice
~ESC::
    IF !(A_TickCount < ESC)
    {
        KeyWait, ESC
        ESC := A_TickCount + 250 ;1.5 seconds between releasing LAlt then pressing it again
        Return
    }
    ESC =
    Run, notepad.exe
    Return

; Long Press ESC and Hold
$ESC::
      KeyWait ESC, T1
      If ErrorLevel {
      run, calculator.exe
}
      KeyWait ESC
      Else Send {ESC}
      Return


haomingchen1998
Posts: 162
Joined: 20 Feb 2023, 16:37

Re: Duplicate Hotkey

Post by haomingchen1998 » 04 Jun 2023, 14:27

mikeyww wrote:
04 Jun 2023, 11:46
viewtopic.php?p=431767#p431767
Appreciate the information, I was able to make it work from this.

Post Reply

Return to “Ask for Help (v1)”