Bug 513525 - Feature Request - Automatic enable/disable of meta key opening Application Launcher when running specified applications
Summary: Feature Request - Automatic enable/disable of meta key opening Application La...
Status: RESOLVED NOT A BUG
Alias: None
Product: plasmashell
Classification: Plasma
Component: Application Launcher (Kickoff) widget (other bugs)
Version First Reported In: master
Platform: Fedora RPMs Linux
: NOR wishlist
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-18 06:26 UTC by pants
Modified: 2025-12-18 08:30 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
TXT containing python code for enabling and disabling the meta keybind for application launcher (1.76 KB, text/plain)
2025-12-18 06:26 UTC, pants
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pants 2025-12-18 06:26:41 UTC
Created attachment 187770 [details]
TXT containing python code for enabling and disabling the meta keybind for application launcher

Summary
There should be a setting to disable the meta key when running certain apps (Games) in order to stop accidental presses or for when the meta key is used as a key bind.

Details
So I have recently switched from Windows 11 to Fedora 43 to use as my primary OS and for gaming. One of the games I play the most is ARMA 3 and one of the most popular mods for it is ACE. By default, ACE binds its interaction key to Windows/meta/super. On Windows this is no issue as the keystroke does not get passed to Windows Explorer, on Linux however, Plasma still captures the keystroke and opens the Application Launcher, this is undesirable and I don't want to change a 10 year habit when I can change my OS instead.

Process
So because of how Fedora/Plasma handles the keybinds you can't simply edit the configuration file and then restart the service, it simply ignores manual changes to kglobalshortcutsrc and kwin (when you edit and apply the keybind in the System Settings app it makes some .lock and .UekKRX files, and does some other stuff).

I asked a friend who knows more than me on how to track it down, but basically I use dbus to monitor what happens when I change the setting via the System Settings and then wrote some python code that mimics the same process as the GUI.

I have attached a txt file with the two bits of code for turning meta on and off. For my use case I edit gamemode.ini so when gamemode runs it runs the disable_meta.py and when it closes it runs enable_meta.py.

Disabling global hotkeys was also not an option because I need Alt+Tab.

Implementation
Use dbus to hook into kglobalaccel
Specify key codes
Grab the application launcher stuff to rebind the keys
Rebind the keys

Thanks!
Comment 1 David Redondo 2025-12-18 08:30:21 UTC
Games that prevent want to prevent this should install a shortcut inhibitor.  In addition shortcuts are also inactive when they grab the x keyboard (via xwayland keyboard grab protocol). Dynamically active shortcuts are currently out of scope, sorry.