Super User Asked by Fabio Bracht on December 3, 2020
I got myself a new keyboard (Keychron K6), and long story short, I’d like to have my Esc key only be mapped to Esc when I hold it for a second. If I just tap it like a normal keystroke, I need to have it be the backtick/tilde key instead.
So:
I’ve looked at the Keyboard Manager tool on PowerToys and also fiddled a bit with AutoHotKey, and both of them seem very powerful but none of them seem to be able to consider whether a key is being held down or briefly pressed.
Is this even possible?
Cheers!
Just tried this out, this AutoHotKey script should work
$esc::
KeyWait,esc,T0.5 ;wait 0.5 seconds for release key
If (ErrorLevel) ;more than 0.5 sec have passed
{
Send {esc}
keyHeld = 1
KeyWait,esc
}
Return
$esc up::
If (keyHeld = 0) ;If not held down
Send ``
Else
keyHeld = 0
Return
shift & esc::
Send ~
keyHeld = 1
Return
Correct answer by rbits on December 3, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP