Skip to content

Instantly share code, notes, and snippets.

@JoeGlines
Created October 8, 2021 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoeGlines/acac49b9d042c1c0bd4f9145c71134da to your computer and use it in GitHub Desktop.
Save JoeGlines/acac49b9d042c1c0bd4f9145c71134da to your computer and use it in GitHub Desktop.
longpess escape for 3 seconds to go to sleep
#SingleInstance,Force
;~ http://www.autohotkey.com/board/topic/80697-long-keypress-hotkeys-wo-modifiers/
~$Esc:: ; Long press (> 0.5 sec) on Esc closes window
KeyWait, Escape, T3 ; Wait no more than 0.5 sec for key release (also suppress auto-repeat)
If ErrorLevel ; timeout, so long press
PostMessage, 0x112, 0xF060,,, A ;Use PostMessage to close window
Return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment