I recently moved to Emacs (and became a fan), I would like to use Autohotkey to make Ctrl + X Ctrk + C the universal Close command.
Here is what I have in the .ahk
file:
; Universal Close :*:^x^c:: WinClose, A Return
which does not seem to work. What am I doing wrong?
To clarify my keystrokes, here is the sequence:
- Hold the Ctrl key;
- Press and release the X key;
- Press and release the C key;
- Release the Ctrl key.
When you press or release the C key (I do not mind), the active window closes.
Success Story: I followed Honest Abe 's answer by adding a little tweak to avoid annoyance when Emacs is actually used. Here's the end result (thanks, GA!):
; Universal Close $^x:: IfWinActive, ahk_class Emacs Sendinput, ^x Else { keywait, c, d, t0.6 If ErrorLevel Sendinput, ^x Else WinClose, A } Return
source share