You are not logged in.
Hi,
Since Caps_Lock is rather useless, I decided to map it to Esc, so that I can use vim and related apps more productively.
After searching around a bit I came across this solution:
1. create ~/.xmodmap:
remove Lock = Caps_Lock
keysym Caps_Lock = Escape
2. run at login:
xmodmap .xmodmap
The point is that now my Caps_Lock key works both as Escape *AND* Caps_Lock (also the led on the keyboard goes on and off).
xev recognizes it just as Escape but I can clearly see that it works as Esc and Caps_Lock in many apps.
Am I doing something wrong? How can I solve this issue?
Thanks!
Last edited by rent0n (2010-06-27 20:23:00)
rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686
Offline
I could be totally off here, but since evdev detects the keyboard automatically, I am assuming that you might also have to disable the CAPS_LOCK key in your 10-evdev.conf file. So that it will only use your custom setting.
Or you could just not use the keyboard catchall in evdev and have your keyboard manually set up thru a custom file or in xorg.conf
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
These two lines in my ~/.xinitrc work for me to make caps lock into the ESC key. No other files or commands needed.
xmodmap -e 'clear Lock' #ensures you're not stuck in CAPS on mode
xmodmap -e 'keycode 0x42=Escape' #remaps the keyboard so CAPS LOCK=ESC
Scott
Offline
I discovered this is a known xmodmap bug. Just search google for 'xmodmap .xinitrc'.
I solved adding:
setxkbmap -option caps:escape &
either to .xinitrc or to .config/openbox/autostart.sh.
Cheers,
rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686
Offline
The point is that now my Caps_Lock key works both as Escape *AND* Caps_Lock (also the led on the keyboard goes on and off)
This might be caused by the fact that you need to redirect both keys. I do use this one for quite some time to toggle between the mappings:
! Toggle caps lock and escape key arrangements
remove Lock = Caps_Lock
keysym Escape = Caps_Lock
keysym Caps_Lock = Escape
add Lock = Caps_Lock
Additionally I defined two setups to switch to a given mode:
! Swap caps lock and escape
remove lock = 0x42
keycode 0x9 = Caps_Lock
keycode 0x42 = Escape
add lock = Caps_Lock
! Original caps lock and escape
remove lock = 0x42
keycode 0x9 = Escape
keycode 0x42 = Caps_Lock
add lock = Caps_Lock
To know or not to know ...
... the questions remain forever.
Offline
@bernarcher: I didn't want to swap Caps_Lock with Esc but just to map Caps_Lock to Esc (and still have Esc working as Esc)
setxkbmap -option caps:escape does exactly what I want.
rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686
Offline
Just for public info, this will swap them:
setxkbmap -option caps:swapescape
I've read here that some users end up with major problems with setxkbmap.
Offline
Sligthly OT:
Trying to brush up my knowledge, I had a hard time to find the setxkbmap -options settings again. So for anyone interested, they are listed here:
/usr/share/X11/xkb/rules/xorg.lst
There is a setxkbmap article missing in the wiki. (If I only had the time...)
To know or not to know ...
... the questions remain forever.
Offline
Any idea how to do this outside of X, as well (short of a new keymap)?
Offline
Just for public info, this will swap them:
setxkbmap -option caps:swapescape
I've read here that some users end up with major problems with setxkbmap.
Could you be more specific please? No problems here (for now).
Thanks
rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686
Offline