Sun Type 7 Keyboard + KDE shortcuts: Why does the control center ignore most of the function keys on the left edge

kde5keyboard shortcutsxkb

I've recently equipped my OpenSuSE 15.2 with KDE 5 with a Sun Type 7 keyboard and now would like to use the function keys on its left edge for a variety of system-wide shortcuts. The only issue is that in the shortcut list of KDE's control center, some of these keys are simply ignored:

Shortcut key selector

The Help, Cut, Copy, Paste, and Open keys are recognised as such, whereas Cancel, Redo, Undo, Properties, Foreground, and Find are not, and I don't know why. All of them emit their own scancodes, and xkb maps them to the corresponding key symbols. Here is, for instance, what the Properties key emits (output from xev):

KeyPress event, serial 40, synthetic NO, window 0x7800001,
    root 0x561, subw 0x0, time 3103717, (-256,541), root:(1374,570),
    state 0x10, keycode 138 (keysym 0x1005ff70, SunProps), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

What's wrong with these keys? Here is my xkb config for your reference:

╭─jacek@epica ~  
╰─➤  setxkbmap -verbose 10
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      pc102
layout:     de
variant:    pl
options:    terminate:ctrl_alt_bksp,altwin:meta_win,lv3:ralt_switch,compose:menu
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwertz)
types:      complete
compat:     complete
symbols:    pc+de(pl)+inet(evdev)+terminate(ctrl_alt_bksp)+altwin(meta_win)+level3(ralt_switch)+compose(menu)+terminate(ctrl_alt_bksp)
geometry:   pc(pc102)

UPDATE: I've looked into the current xkb config to find out that in the symbols/inet file, there is a complete block devoted to the proprietary Sun Type 6/7 function keys:

partial alphanumeric_keys
xkb_symbols "evdev" {
    key <MUTE>   {      [ XF86AudioMute         ]       };
    key <VOL->   {      [ XF86AudioLowerVolume  ]       };
    key <VOL+>   {      [ XF86AudioRaiseVolume  ]       };
    key <POWR>   {      [ XF86PowerOff          ]       };
    key <STOP>   {      [ Cancel                ]       }; // KDE ignores me!
    key <AGAI>   {      [ Redo                  ]       }; // KDE ignores me!
    key <PROP>   {      [ SunProps              ]       }; // KDE ignores me!
    key <UNDO>   {      [ Undo                  ]       }; // KDE ignores me!
    key <FRNT>   {      [ SunFront              ]       }; // KDE ignores me!
    key <COPY>   {      [ XF86Copy              ]       };
    key <OPEN>   {      [ XF86Open              ]       };
    key <PAST>   {      [ XF86Paste             ]       };
    key <FIND>   {      [ Find                  ]       };
    key <CUT>    {      [ XF86Cut               ]       };
    key <HELP>   {      [ Help                  ]       };
    key <LNFD>   {      [ Linefeed              ]       };
};

This means that the keycodes and symbols are registered in xkb the right way, but unfortunately, it's KDE's control center, which ignores the Sun-specific keysyms (see the comments above). Does that mean that I'll have to file a ticket with the KDE guys?

Best Answer

There's two options for the Sun 7 keyboard provided by default

  • The default Sun 7 mapping uses the key bindings you found that neither KDE nor Gnome recognize for Cancel Redo SunProps Undo SunFront
  • The suncompat option binds all the left keys to function keys, but overlaps those with the top row function keys and binds XF86AudioMute XF86AudioLowerVolume XF86AudioRaiseVolume XF86PowerOff to symbols prefixed with Sun that neither KDE nor Gnome recognizes.

So both of the default configurations are buggy in different ways. There are 3 possible fixes for this:

  • use xmodmap to remap the keys correctly, but this is obsolete and is stepped on by multiple things in KDE / Gnome
  • Create a new xkb binding that is correct and submit it as a bug patch (I've been meaning to do this but haven't gotten around to it -- maybe soon, and I'll update things here if I do)
  • Submit a bug report for KDE and Gnome to recognize the missing symbols
Related Question