Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

Your Answer


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.