Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
    
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? –  Gilles May 1 '13 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. –  Phineas Rex May 4 '13 at 17:17

1 Answer 1

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

Excerpt

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.

share|improve this answer
    
I did try xkb but with the same results. –  Phineas Rex May 1 '13 at 18:38
    
Can you share what you tried for xkb? –  slm May 1 '13 at 18:40
    
I used "setxkbmap -option ctrl:swapcaps". –  Phineas Rex May 2 '13 at 14:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.