Last active
July 27, 2022 18:33
-
-
Save JoeGlines/2c47f5f2ab8fb66def11e3771ec9996f to your computer and use it in GitHub Desktop.
use the escape key to close the active program
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;******************************************************* | |
; Want a clear path for learning AutoHotkey; Take a look at our AutoHotkey Udemy courses. They're structured in a way to make learning AHK EASY | |
; Right now you can get a coupon code here: https://the-Automator.com/Learn | |
;******************************************************* | |
;~ http://www.autohotkey.com/board/topic/80697-long-keypress-hotkeys-wo-modifiers/ | |
~$Esc:: ; Long press (> 0.5 sec) on Esc closes window | |
KeyWait, Escape, T0.5 ; 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