1

I have function keys on my laptop, for instance XF86AudioLowerVolume. I can associate this key with some command in my openbox configuration file, and use it to lower/increase audio volume.

I found the name of this function key with xev command:

KeyRelease event, serial 47, synthetic NO, window 0x1c00001,
    root 0x196, subw 0x0, time 85289390, (524,165), root:(525,203),
    state 0x10, keycode 174 (keysym 0x1008ff11, XF86AudioLowerVolume), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

However, for my other function keys, xev does not show proper key names. For instance, the key which is supposed to be used to "decrease screen brightness". When pressed, xev shows NoSymbol:

KeyPress event, serial 43, synthetic NO, window 0x1c00001,
    root 0x196, subw 0x0, time 2651872, (850,161), root:(851,199),
    state 0x10, keycode 101 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 43, synthetic NO, window 0x1c00001,
    root 0x196, subw 0x0, time 2651872, (850,161), root:(851,199),
    state 0x10, keycode 101 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

The other, paired key "increase screen brightness" also shows NoSymbol:

KeyPress event, serial 43, synthetic NO, window 0x1c00001,
    root 0x196, subw 0x0, time 2653165, (850,161), root:(851,199),
    state 0x10, keycode 212 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 43, synthetic NO, window 0x1c00001,
    root 0x196, subw 0x0, time 2653165, (850,161), root:(851,199),
    state 0x10, keycode 212 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

Only the keycode is different for these two keys.

Does it mean I cannot use these keys to associate these with some command? They clearly work as keyboard keys, why does xev show NoSymbol ?

1 Answer 1

1

The NoSymbol simply means that there is no predefined name for that key. Those are listed in the file keysymdefs.h, which hasn't changed appreciably in the past twenty-odd years (see this for example, or this).

That file is used to generate a list of names which xev and related programs consult. For xev, that's done using either

  • XLookupString, or
  • XmbLookupString.

Either way, it relies upon a table generated from keysymdef.h, as noted in the source code:

    /* Constructs hash tables for XStringToKeysym and XKeysymToString. */
    # Building ks_tables.h requires the makekeys utility

No one really wants to add to that file, because it is a mixture of codes corresponding to (but not matching) Unicode and special function keys such as the one you asked about. Most of the special keys were defined before the X keyboard extension was introduced in the early 1990s, and that (Xkb) essentially settles for just identifying keys according to the row and column where they are found on a keyboard, rather than trying to name everything.

This page has links to tables illustrating how xterm uses key-modifiers. The Name column of Keymap tables is the name used by Xkb, which you can see is usually just row/column, except for very common keys such as ESC (for Escape).

2
  • so how can I reference the key in my openbox config file? Commented Apr 17, 2021 at 4:18
  • According to this, you can use the keycode. Alternatively, you can always use xmodmap to assign a keysym (e.g., a name) to a keycode. Commented Apr 17, 2021 at 9:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .