If there is a way to remap Caps Lock to Ctrl using AutoHotKey for Cygwin only in Windows 7? I can do it with the following script for all programs:
Capslock::Control
But how can make the key remap only effects Cygwin?
Below are what I have been looked so far:
Script for Emacs only (from http://www.emacswiki.org/emacs/MovingTheCtrlKey#toc16):
#IfWinActive emacs ; if in emacs
+Capslock::Capslock ; make shift+Caps-Lock the Caps Lock toggle
Capslock::Control ; make Caps Lock the control button
#IfWinActive ; end if in emacs
Doesn't work for me, since the title of the Cygwin64 only shows ~
I also tried this:
#If WinActive("ahk_class ConsoleWindowClass"); or WinActive("ahk_class cygwin/x") or WinActive("ahk_class mintty"); if in Cygwin
+Capslock::Capslock ; make shift+Caps-Lock the Caps Lock toggle
Capslock::Control ; make Caps Lock the control button
#IfWinActive ; end if in Cygwin
Still didn't work.
I did manage it to work only for Cygwin if I use the following script:
#IfWinActive ~ ; if in Cygwin
+Capslock::Capslock ; make shift+Caps-Lock the Caps Lock toggle
Capslock::Control ; make Caps Lock the control button
#IfWinActive ; end if in Cygwin
But this will cause some zooming issues in Chrome sometimes.
Any help will be appreciated.
(Note: I can't use the register key solution to remap the key, I don't have admin permission).