Hi @lunatuna,
welcome to Qubes OS
I suggest you explore this problem with two (old school) Xorg programs:
xev
displays the mouse/keyboard events.
xmodmap
manage the keyboard layout.
xev
Launch it with the xev
command in a terminal, later you’ll exit it with Ctrl-c in the terminal.
Move your mouse pointer to the new small white background window. In the terminal, you’ll see all mouse events and, more important for you, all the keyboard events. If you press the pipe key, you will see a lot of information, including the keycode of the key.
Example on a my non-us keyboard:
key press/release output
KeyPress event, serial 32, synthetic NO, window 0x1000001,
root 0x3aa, subw 0x0, time 3944439, (-509,363), root:(362,842),
state 0x90, keycode 15 (keysym 0x7c, bar), same_screen YES,
XLookupString gives 1 bytes: (7c) "|"
XmbLookupString gives 1 bytes: (7c) "|"
XFilterEvent returns: False
KeyRelease event, serial 32, synthetic NO, window 0x1000001,
root 0x3aa, subw 0x0, time 3944519, (-509,363), root:(362,842),
state 0x90, keycode 15 (keysym 0x7c, bar), same_screen YES,
XLookupString gives 1 bytes: (7c) "|"
XFilterEvent returns: False
On my keyboard, the keycode is 15 and the associated character is | (0x7c). But how the keyboard keycode link to this character? See the next section.
xmodmap
Launch it with the xmodmap -pk
, it will display the current mapping layout of your keyboard.
Example:
15 0x002d (minus) 0x0036 (6) 0x002d (minus) 0x0036 (6) 0x007c (bar) 0x1002011 (U2011) 0x007c (bar) 0x1002011 (U2011)
On my layout, the 15 keycode returns the 0x007c (bar)
character, but also other characters (minus, 6, bar, U2011) with the help of the modifiers (xmodmap
display the modifiers).
What’s next?
Read:
- the xmodmap man page
- the Xmodmap ArchLinux wiki page