AltGr fast press to ESC remap
Posted: 22 Dec 2022, 13:11
I thought this would be easier, it was complicated by the fact that AltGr is really two keys pressed together, Left Ctrl and Right Alt,
I thought it was just Right Alt, I made sure that 1. AltGr key still works as expected, when pressed with other keys, it outputs accent characters,
and 2. when AltGr is pressed for a long time (more than 150 milliseconds) it doesn't send an ESC press
Thanks to RHCP and everybody for this thread for publishing what was my starting code on the old forum
I thought it was just Right Alt, I made sure that 1. AltGr key still works as expected, when pressed with other keys, it outputs accent characters,
and 2. when AltGr is pressed for a long time (more than 150 milliseconds) it doesn't send an ESC press
Code: Select all
time := -1
~LControl & ~RAlt::
if (time = -1)
time := A_TickCount
return
~LControl & ~RAlt Up::
var := A_TickCount - time
if (instr(A_PriorKey, "RAlt") || instr(A_PriorKey, "LCtrl")) && var <= 150
send {esc}
time := -1
return