Keyboard key handling blocking some multimedia keys?

Moving from lubuntu I have noticed ubuntu Budgie desktop 24.04 appears to filter key presses and block some multimedia keyboard presses. I use the Xenta SE340D PC Remote Control (OSMC/USB_PC_remote/README.md at master · rern/OSMC · GitHub) and find the Budgie desktop will display an :no_entry_sign: symbol for a notable number of the media keys. I have not found how to make the affected keys usable with either alternate keyboard layouts or manual key mapping.

Is there an easy way to stop this behavior as to allow all keyboard keys? What feature(s) are responsible?
Thank you, -p

not sure what you mean by blocking multimedia keyboard presses. Have you a few examples?

Budgie/GNOME handle keypresses via the gnome-settings-daemon - various keyboard combinations are configurable via budgie-control-center keyboard view & customise shortcuts

The four main keys I am aware of are:
Previous Track
Pause/Play
Next Track
Stop

showkey reports these as keycodes 163-166.

I’ll find time to poke gnome-settings-daemon in the next couple days but any more hints are welcome. :slight_smile:
Thank you, -p

if you use dconf-editor and navigate to org.gnome.settings-daemon.plugins.media-keys you will see that these are managed (bound) by gnome-settings-daemon. So GSD will not release these unless I’m guessing you set these values to empty strings

I have tried varios menthods to over-ride and blank settings with both Budgie Control Center and dconf-editor. Both of these programs correctly mirror the settings set within the other but neither will allow use of the desired media keys. If I set other key bindings into these functions they are also being blocked.

The root cause for this appears to be related to MPRIS handling. I have tested that MPRIS behavior does allow XF86AudioNext,XF86AudioPause,XF86AudioPrev,XF86AudioStop keys to be refocused on the most recent program that identifies itself as supporting MPRIS. However, When no MPRIS compatible program is running the system will then just overlay the blocked symbol to indicate the MPRIS key presses have no where to go.

Temporary workaround (appears to disable all desktop hotkeys):
cp /etc/xdg/autostart/org.gnome.SettingsDaemon.MediaKeys.desktop ~/.config/autostart/org.gnome.SettingsDaemon.MediaKeys.desktop

gedit ~/.config/autostart/org.gnome.SettingsDaemon.MediaKeys.desktop
and update X-GNOME-AutoRestart=true line to X-GNOME-AutoRestart=false

When running a program where media keys are desired:
pkill gsd-media-keys
$DesiredProgram
/usr/libexec/gsd-media-keys &

For a more permanent solution:
I will try to dig some more to see if MPRIS can be disabled or if qtchooser and playerctl will allow the user to pass these key presses back into the users current focus.

Does removing the raven widget “Media Controls” from Budgie-Desktop-Settings - raven help?

I’m just wondering if the widget is holding onto the MPRIS keys since thats what the widget is expecting in terms of displaying MPRIS related data.

Thank you for pointing me to the widgets. But it looks like the offending MPRIS implementation is built into GitHub - GNOME/gnome-settings-daemon: Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-settings-daemon.

Googleing seems to suggest a small number of people like myself may have been stuck behind MPRIS and indirectly asking for a way to manage MPRIS handling. However, I have not found any reasonable method for user to manage it during the desktop session.

The good:
I have found the base MPRIS features interesting and think the current behavior is likely the desirable default for most users.

Moving forward:
I think I will sign up for gnome and see if they already have a hidden method to manage MPRIS handling.

I would like to see user methods to:
-disable all MRPIS key press features and pass the key presses through to the current focus
-mirror key presses to MPRIS and the current focus
-set the above desired setting individually for each of the key presses managed by MPRIS.
-check a user set listing of applications if focused MPRIS should be disabled

I’ll try to dig at this some more.
Thank you, -p

1 Like

Did you try the suggestions here i.e. remove the static gsetting keys to empty strings and then the last comment set to default the keyboard binding on budgie control center keyboard

Ha, This does work. I had already found this exact issue and I swear I tested with the static variants but I must have failed to restart gsd-media-keys correctly.

My current solution:
Note: I still needed to manually restart gsd-media-keys. gsd-media-keys would crash the desktop if I let it AutoRestart after changing the values and pkilling it.

cp /etc/xdg/autostart/org.gnome.SettingsDaemon.MediaKeys.desktop ~/.config/autostart/org.gnome.SettingsDaemon.MediaKeys.desktop

gedit ~/.config/autostart/org.gnome.SettingsDaemon.MediaKeys.desktop
and update X-GNOME-AutoRestart=true line to X-GNOME-AutoRestart=false

launch-with-media-keys.sh:
#!/bin/bash
#use “read” to check dconf values
dconf write /org/gnome/settings-daemon/plugins/media-keys/next-static “[‘’]”
dconf write /org/gnome/settings-daemon/plugins/media-keys/stop-static “[‘’]”
dconf write /org/gnome/settings-daemon/plugins/media-keys/previous-static “[‘’]”
dconf write /org/gnome/settings-daemon/plugins/media-keys/play-static “[‘’]”
dconf write /org/gnome/settings-daemon/plugins/media-keys/pause-static “[‘’]”
pkill gsd-media-keys
/usr/libexec/gsd-media-keys &
$1 $2 $3 $4 $5
dconf reset /org/gnome/settings-daemon/plugins/media-keys/next-static
dconf reset /org/gnome/settings-daemon/plugins/media-keys/stop-static
dconf reset /org/gnome/settings-daemon/plugins/media-keys/previous-static
dconf reset /org/gnome/settings-daemon/plugins/media-keys/play-static
dconf reset /org/gnome/settings-daemon/plugins/media-keys/pause-static
pkill gsd-media-keys
/usr/libexec/gsd-media-keys &

Thank you very much. -p