Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a couple of questions about remapping keys et al.

  • How to interpret the output of the command xmodmap -pk. I put in xmodmap -pk | less and try to browse for the key I am looking for. Here's a sample line from the output:

    94 0x003c (less) 0x003e (greater) 0x003c (less) 0x003e (greater) 0x007c (bar) 0x00a6 (brokenbar) 0x007c (bar)

As I understand, this corresponds to the entry for keycode 94. What I don't understand is why are there 7 entries against this key? What do they mean?

  • How does one find a key on the keyboard whose keycode is a given number? I'd appreciate an elegant way of doing this. For instance, there is always this dirty trick of punching in the keys with xev running... I am looking for an answer that would explain how the keycodes are assigned to the keys in this case.

  • I want to remap the key with keycode 94 to backslash and shift + the key to bar.

Can you guys please help me?

share|improve this question
add comment

1 Answer

Print the current keymap table formatted into expressions:

$ xmodmap -pke
keycode  57 = n N

Each keymap is followed by the keysyms it is mapped to. The above example indicates that the keycode 57 is mapped to the lowercase n, while the uppercase N is mapped to keycode 57 and Shift. Each keysym column in the table corresponds to a particular key combination: Key Shift+Key mode_switch+Key mode_switch+Shift+Key AltGr+Key AltGr+Shift+Key

  • Have you tried

    xmodmap -e "keycode 94 = backslash bar"

share|improve this answer
add comment

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.