How to use Super and Hyper as separate modifiers for keyboard shortcuts? (Plasma 6 on Wayland)

Good day, I’m trying to figure out how to configure my keyboard so that I can not only use my caps lock key as a control key, but also use my left control key as a hyper key, with that hyper key being a separate modifier (not the same as win/super/meta) in Keyboard Shortcuts. I could use some help. Sorry this is so long but I’m not sure what’s relevant and what isn’t. Thanks in advance.

Here’s where I started:

  • Current KDE Neon, meaning Plasma 6.0.3 running on Wayland.
  • Keyboard model is “Generic | Generic 104-key PC” in System Settings > Keyboard > Hardware.

Here’s how things are working in that setup:

physical key sym in wev modifier in wev key name in Shortcuts
caps lock Caps_Lock Lock CapsLock
left shift Shift_L Shift Shift
left control Control_L Control Ctrl
windows key Super_L Mod4 Meta
left alt Alt_L Mod1 Alt
right alt Alt_R Mod1 Alt
right control Control_R Control Ctrl
right shift Shift_R Shift Shift

This all seems pretty reasonable so far. In System Settings > Keyboard > Shortcuts, all these keys except CapsLock show up as modifiers, e.g. I can make an “Alt+W” with either of my alt keys. (I can make CapsLock — by itself — a keyboard shortcut, which is weird but okay.)

OK so, now I want to make my capslock key be a control key and make my control key be “hyper”, a totally different modifier, so I set “Configure keyboard options” under System Settings > Keyboard > Advanced and then select Ctrl position > Caps Lock as Ctrl.

Here’s how things are in that configuration:

physical key sym in wev modifier in wev key name in Shortcuts
caps lock Control_L Control Ctrl
left shift Shift_L Shift Shift
left control Hyper_L Mod3 Meta but broken
windows key Super_L Mod4 Meta
left alt Alt_L Mod1 Alt
right alt Alt_R Mod1 Alt
right control Control_R Control Ctrl
right shift Shift_R Shift Shift

Everything looks correct in wev, but in Keyboard Shortcuts my new hyper key kinda acts like a meta key, but I can’t actually type another key with it. Instead, when I hold down my left control (hyper) key, the shortcut widget changes from Input … to Meta+ … and then nothing changes when I type a letter key and the widget kinda gets stuck like that until I release the left control (hyper) key and either press it again (in which case the shortcut gets set to Meta by itself) or hit another key (in which case the shortcut gets set to, say, Meta, A). These both actually work, but they’re of no use to me.

So to sum things up, how can I make Plasma’s keyboard shortcut system interpret Hyper_L/Mod3 as a different modifier than Super_L/Mod4, instead of interpreting them both as Meta, but making Hyper_L kind of a broken Meta?

Here’s my wev output:

default configuration
[14:     wl_keyboard] key: serial: 2178; time: 10343382; key: 66; state: 1 (pressed)
                      sym: Caps_Lock    (65509), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 2
                      depressed: 00000002: Lock 
                      latched: 00000000
                      locked: 00000002: Lock 
[14:     wl_keyboard] key: serial: 2181; time: 10343534; key: 66; state: 0 (released)
                      sym: Caps_Lock    (65509), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 2
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000002: Lock 
[14:     wl_keyboard] key: serial: 2184; time: 10347003; key: 66; state: 1 (pressed)
                      sym: Caps_Lock    (65509), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 2
                      depressed: 00000002: Lock 
                      latched: 00000000
                      locked: 00000002: Lock 
[14:     wl_keyboard] key: serial: 2187; time: 10347165; key: 66; state: 0 (released)
                      sym: Caps_Lock    (65509), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 2190; time: 10349587; key: 50; state: 1 (pressed)
                      sym: Shift_L      (65505), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000001: Shift 
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 2193; time: 10349764; key: 50; state: 0 (released)
                      sym: Shift_L      (65505), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 2196; time: 10351526; key: 37; state: 1 (pressed)
                      sym: Control_L    (65507), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000004: Control 
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 2199; time: 10351732; key: 37; state: 0 (released)
                      sym: Control_L    (65507), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 2202; time: 10352814; key: 133; state: 1 (pressed)
                      sym: Super_L      (65515), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000040: Mod4 
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 2205; time: 10353048; key: 133; state: 0 (released)
                      sym: Super_L      (65515), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000000

[14:     wl_keyboard] key: serial: 2230; time: 10357067; key: 64; state: 1 (pressed)
                      sym: Alt_L        (65513), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000008: Mod1 
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 2233; time: 10357269; key: 64; state: 0 (released)
                      sym: Alt_L        (65513), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 2635; time: 10439598; key: 108; state: 1 (pressed)
                      sym: Alt_R        (65514), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 2
                      depressed: 00000008: Mod1 
                      latched: 00000000
                      locked: 00000002: Lock 
[14:     wl_keyboard] key: serial: 2638; time: 10439766; key: 108; state: 0 (released)
                      sym: Alt_R        (65514), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 2
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000002: Lock 
[14:     wl_keyboard] key: serial: 2641; time: 10440441; key: 105; state: 1 (pressed)
                      sym: Control_R    (65508), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 2
                      depressed: 00000004: Control 
                      latched: 00000000
                      locked: 00000002: Lock 
[14:     wl_keyboard] key: serial: 2644; time: 10440610; key: 105; state: 0 (released)
                      sym: Control_R    (65508), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 2
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000002: Lock 
[14:     wl_keyboard] key: serial: 2647; time: 10441319; key: 62; state: 1 (pressed)
                      sym: Shift_R      (65506), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 2
                      depressed: 00000001: Shift 
                      latched: 00000000
                      locked: 00000002: Lock 
[14:     wl_keyboard] key: serial: 2650; time: 10441463; key: 62; state: 0 (released)
                      sym: Shift_R      (65506), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 2
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000002: Lock 
Caps Lock as Ctrl, Ctrl as Hyper
[14:     wl_keyboard] key: serial: 3568; time: 11436054; key: 66; state: 1 (pressed)
                      sym: Control_L    (65507), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000004: Control 
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 3571; time: 11436203; key: 66; state: 0 (released)
                      sym: Control_L    (65507), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 3574; time: 11438754; key: 50; state: 1 (pressed)
                      sym: Shift_L      (65505), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000001: Shift 
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 3577; time: 11438933; key: 50; state: 0 (released)
                      sym: Shift_L      (65505), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 3580; time: 11440718; key: 37; state: 1 (pressed)
                      sym: Hyper_L      (65517), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000020: Mod3 
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 3583; time: 11440912; key: 37; state: 0 (released)
                      sym: Hyper_L      (65517), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 3586; time: 11443442; key: 133; state: 1 (pressed)
                      sym: Super_L      (65515), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000040: Mod4 
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 3589; time: 11445104; key: 133; state: 0 (released)
                      sym: Super_L      (65515), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 3626; time: 11452279; key: 64; state: 1 (pressed)
                      sym: Alt_L        (65513), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000008: Mod1 
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 3628; time: 11452412; key: 64; state: 0 (released)
                      sym: Alt_L        (65513), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 3630; time: 11454109; key: 108; state: 1 (pressed)
                      sym: Alt_R        (65514), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000008: Mod1 
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 3632; time: 11454239; key: 108; state: 0 (released)
                      sym: Alt_R        (65514), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 3634; time: 11454702; key: 105; state: 1 (pressed)
                      sym: Control_R    (65508), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000004: Control 
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 3636; time: 11454830; key: 105; state: 0 (released)
                      sym: Control_R    (65508), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 3638; time: 11455649; key: 62; state: 1 (pressed)
                      sym: Shift_R      (65506), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000001: Shift 
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 3640; time: 11455767; key: 62; state: 0 (released)
                      sym: Shift_R      (65506), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000000

Going to answer my own question. This isn’t possible, because Qt only has four modifier keys. See Qt::Modifier, KDE Bug 379949, and QTBUG-61301 for more info.

What a lot of folks end up doing is mapping their Hyper key to Ctrl+Shift+Alt+Meta, since few default shortcuts use all four buckys.

1 Like