Does anybody know the trick to use Caps Lock as another Escape key? It’s quite handy for vi.
Last edited by MekkaGodzilla (2011-07-05 14:57:27)
this would be a task for xmodmap. You can use 'xev' in terminal to find out the code of Caps Lock. (keycode 66). Then make a copy of .Xmodmap for your user only:
xmodmap -pke > .Xmodmap
Edit this file with an editor of your choice (vi)
You can now change the line
66 = Caps_Lock NoSymbol Caps_Lock
66 = Escape NoSymbol Caps_Lock
In this case you could have the real Caps Lock function if you press Alt + Caps Lock.
Save the file, and run
at startup. Control if you did everything right with xev.
Thanks for the tutorial.
For some reason Caps Lock now works as an Escape key but kept ITS ORIGINAL FUNCTION AS WELL.
What to do?
Same thing unfortunately…
But I found a way to kill the caps lock function when setting my keyboard layout in my autostart.sh file :
setxkbmap fr bepo -option ctrl:nocaps &
Replace fr bepo with your layout of choice of course.
So problem solved
in case somebody cares:
as very first line in .Xmodmap, at least here it works anyway, solved is solved
If I use "clear Lock", will bringing caps lock back be as easy as removing that line and restarting? Or do I have to somehow add Lock back in?
in case someone comes looking for an answer: in /etc/default/keyboard change XKBOPTIONS="" to XKBOPTIONS="caps:swapescape" ...save and reboot
credit where credit is due: http://forums.debian.net/viewtopic.php?f=5&t=82079