Ubuntu: Questions about remapping keys


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?


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"

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »