Skip to main content
Topic: Finding the key symbol used for a keyboard key in X11 (Read 500 times) previous topic - next topic
0 Members and 4 Guests are viewing this topic.

Finding the key symbol used for a keyboard key in X11

In X11, each keyboard key has a macro defined for it in /usr/include/X11/keysymdef.h .

In order to find out the key symbol for a desired keyboard key to use in software like dwm, you can run the debugging tool xev.

The reason to use xev over just looking at /usr/include/X11/keysymdef.h , is that sometimes keys that are used in combination with other keys ( Like for example Alt+Shift ) produce different key symbols than when used alone, this is especially true for numpad keys.

However since xev outputs a lot of other debugging information that we do not need, it is recommended to run the following command instead:
Code: [Select]
xev 2>&1 | grep -F keysym