I am using
- arch kernel 5.7.3-arch1-1, and
- openbox, and
- neo vim 0.4.3, and
- Lenovo thinkpad T430 laptop / keyboard.
All system packages are up to date.
I am trying to swap caps lock and escape keys for use in neoVim and have used this line
setxkbmap -option caps:swapescape
This sets the escape key as caps toggle as expected, but does nothing to the caps lock key. I'm expecting that the caps lock key will work as an escape key but it does not.
Can anyone indicate how I can do this, and why the caps lock does not work using the above command?
My understanding is that this cannot be done in nvim's .vimrc
file.
Below is xev
output when pressing and then releasing escape
, keycode 9
KeyPress event, serial 48, synthetic NO, window 0x3200001,
root 0x139, subw 0x0, time 75547017, (621,536), root:(792,564),
state 0x0, keycode 9 (keysym 0xff1b, Escape), same_screen YES,
XLookupString gives 1 bytes: (1b) "
mbLookupString gives 1 bytes: (1b) "
FilterEvent returns: False
KeyRelease event, serial 48, synthetic NO, window 0x3200001,
root 0x139, subw 0x0, time 75547079, (621,536), root:(792,564),
state 0x0, keycode 9 (keysym 0xff1b, Escape), same_screen YES,
XLookupString gives 1 bytes: (1b) "
FilterEvent returns: False
Below is xev
output when pressing and releasing caps lock
, keycode 66
FocusOut event, serial 48, synthetic NO, window 0x4800001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 48, synthetic NO, window 0x4800001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 48, synthetic NO, window 0x0,
keys: 57 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
KeyRelease event, serial 48, synthetic NO, window 0x4800001,
root 0x139, subw 0x0, time 75680956, (272,352), root:(443,380),
state 0x2, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
dmesg
warnings and errors, do you find some related to the keyboard? – Quasímodo Jun 25 '20 at 14:00dmesg
and injournalctl
and could see no entry created by eithersetxkbmap -option caps:swapescape
orxmodmap -e "keycode 9 = Caps_Lock"; xmodmap -e "keycode 66 = Escape"
, suggested below, which has the exact same effect, i.e., the escape key is remapped as caps lock, but the caps lock key is mapped to nothing. I useddiff file1 file2
wherefile1
andfile2
are outputs of all ofjournalctl
andfile1
is before the re-mapping andfile2
is after the re-mapping. I am using a Lenovo T430 thinkpad. – Kes Jun 27 '20 at 12:54