2

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).

1 Answer 1

1

What if you add more information to the "WinTitle" parameter by adding ahk_exe cmd.exe like so:

#IfWinActive ~ ahk_exe cmd.exe

That should prevent capslock interfering with Chrome

Does require the AutoHotkey version from http://ahkscript.org/ as that introduced ahk_exe as a valid parameter - see http://ahkscript.org/docs/misc/WinTitle.htm#ahk_exe

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .