Bug 475085

Summary: Meta should always be mod1
Product: [Frameworks and Libraries] frameworks-kconfig Reporter: Kyle Rose <krose>
Component: generalAssignee: Matthew Dawson <matthew>
Status: RESOLVED NOT A BUG    
Severity: normal CC: aspotashev, dev, kdelibs-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Debian stable   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Kyle Rose 2023-10-01 11:25:33 UTC
When using advanced keyboard options that move meta around (such as "Meta is mapped to Win"), compatibility with applications that don't use xkb virtual modifiers requires that meta always be mod1, as legacy applications (such as emacs) assume mod1 is meta.

STEPS TO REPRODUCE
1. Turn on "Meta is mapped to Win"
2. `xmodmap -pm`

OBSERVED RESULT
mod1 lists Alt keys and mod4 lists Meta keys.

EXPECTED RESULT
It should be the other way around (or, at the very least, mod1 should not include any keys mapped to virtual modifiers other than `Meta`).

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.27.5
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Comment 1 Kyle Rose 2023-10-03 00:34:01 UTC
I will add that there should be an advanced option in keyboard settings that allows the user to bring their own xkbcomp file that Plasma then just loads at the appropriate time. I don't really want to use Plasma's mechanism for configuring key mappings, but I'm forced to because the alternative is jumping through these hoops:

1. Disable the Keyboard Daemon in Settings/Startup and Shutdown/Background Services
2. Set up an Autostart script that runs xkbcomp with my preferred mapping
3. After loading the new mapping, `systemctl --user reload-or-restart plasma-kwin_x11.service` because kwin needs to be restarted to use the new mapping

It would be easier to just point Plasma at a fully-formed xkbcomp file and let it load it at the right time.
Comment 2 Wismill 2024-06-25 12:16:14 UTC
Please consider opening a ticket at https://gitlab.freedesktop.org/xkeyboard-config, where the keyboard configurations are defined.
Comment 3 Kyle Rose 2025-05-04 19:26:06 UTC
Coincidental that this got updated today, because I learned just a few hours ago that I am 100% wrong about alt and meta. Historically, alt was always mapped to Mod1, and meta was implementation-dependent. So this should be closed wontfix.