I used xmodmap to switch the Caps Lock and Ctrl keys on my Thinkpad X120e. The keys are swapped but this has caused keyboard shortcuts in several applications to stop working correctly. In Libre Office Ctrl+Shift+s no longer works (but Ctrl+s and Ctrl+Shift+v do). Ctrl+Shift+S is also broken in emacs (where I have it mapped to save as) and Ctrl+N and Ctrl+Shift+N have swapped purposes (new buffer and new frame). My .xmodmap file looks as follows:

remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L

I used the same file on my desktop (also running Debian Wheezy) and did not experience these problems.

  • Run xev from a terminal and press various keys in the xev window. When you enter Ctrl+Shift+N, as you press N, what appears in the terminal? Commented May 1, 2013 at 22:28
  • @Gilles Switching to xkb has actually solved the Ctrl+Shift+N problem but not the Ctrl+Shift+S problem. Pressing Ctrl+Shift+N yields: KeyPress event, serial 39, synthetic NO, window 0x4000001, root 0xaf, subw 0x0, time 5080983, (333,145), root:(942,446), state 0x5, keycode 57 (keysym 0x4e, N), same_screen YES, XLookupString gives 1 bytes: (0e) "" XmbLookupString gives 1 bytes: (0e) "" XFilterEvent returns: False While Ctrl+Shift+S yields no event when the S is pressed. Commented May 4, 2013 at 17:17

1 Answer 1


I found this comment in an Askubuntu Q&A titled: keybinding issues with xmodmap across synergy.


Do you run into the same problem if you use Xkb to swap control/capslock? You should be able to do this through the keyboard control panel application, or with setxkbmap. xmodmap has been known to screw things up for xkb aware applications. – James Henstridge Nov 17 '11 at 1:16

Perhaps you should try using setxbmap instead of xmodmap?

I found this nice tutorial to get you started with setxbmap titled: Extending the X keyboard map with xkb, if you're interested.

I tried to find a list of what applications are XKB Aware but was unsuccessful. I did come across this document titled: The X Keyboard Extension. In this document there is mention of 3 classifications of applications, in case you're interested.

  • I did try xkb but with the same results. Commented May 1, 2013 at 18:38
  • Can you share what you tried for xkb?
    – slm
    Commented May 1, 2013 at 18:40
  • I used "setxkbmap -option ctrl:swapcaps". Commented May 2, 2013 at 14:56

You must log in to answer this question.

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