mumble
mumble copied to clipboard
Keyboard shortcuts don't work on Wayland
Describe the bug When using Wayland instead of X11, the global shortcut engine does not work and as a consequence none of the user-registered shortcuts function.
Steps to Reproduce Steps to reproduce the behavior:
- Use Wayland
- Try to use or register a shortcut
Expected behavior Shortcuts to work normally
Desktop (please complete the following information):
- OS: Linux (Wayland)
- Version: all
Additional context To my knowledge to this date Wayland (in contrast to X11) does not provide a way to either grab all user input nor does it allow to register global shortcuts. Instead one is supposed to register shortcuts with the currently used Window Manager (but there does not seem to exist a standard to do this).
Related issues: #3816 #3243 #4073 #5303
#3269
Well, when I used 1.3.4 I can define hotkey for Push-to-talk and use it when Mumble window is focused. You can't use it in games whatever, but it's worked when you just want to talk. In 1.4 I can't do that. What should I do to use Push-to-talk when Mumble window is active at least?
ATM there is no way around it. But there is already a ticket about weakening the disabling of shortcuts on Wayland.
I was using PTT successfully in 1.3.4 as long as my mouse had focus on an X app (i.e. most games right now). Would be nice to restore that behavior until global shortcuts are fixed in Wayland.
Same here. It was working before, but with one of the last upgrades it seems that the functionality was disabled on purpose. I was able to use it successfully while focusing on a X Window.
Has there been any progress on this?
No
What should I do to use Push-to-talk when Mumble window is active at least?
@icher You can enable "Display push to talk window" to get a extra window with a button. It's not great but better then nothing.
@icher You can enable "Display push to talk window" to get a extra window with a button. It's not great but better then nothing.
Nah, it's not usable. I just downgrade to 1.3.4 and run as QT_QPA_PLATFORM=xcb mumble
.
Please restore old functionality, having it disabled entirely isnt helping anyone and it still worked fine in proton/x games. edit: https://github.com/mumble-voip/mumble/pull/5688 i see there is already a plan to restore functionality. do we know when this will be merged?
A workaround is to use the RPC client to map keys to commands in your WM/DE, although you do need to dedicate two keybinds for it:
mumble rpc starttalking
and mumble rpc stoptalking
do what you'd expect for PTT.
I've been running a hacky workaround using the mumble D-Bus API and libinput
. As long as your user is part of the input
group you can listen for mouse/keyboard down/up events and forward them to the startTalking
and stopTalking
D-Bus methods. Here's the script I run in the background. It will enable PTT when BTN_EXTRA is pushed.
Before this I was using Sway's bindsym
to emit the D-Bus calls similar to what @tidux suggested, but events would get dropped based on where the mouse was. Going directly to libinput
helped me avoid the dropped button-up events which caused state issues and an always-on mic sometimes. It also doesn't depend on focus being on an X window for PTT to work.
i love your script, @travismorton. Thanks a lot!
I think it removes the security of Wayland from possible keyloggers, but it's a price i'm ready to pay. Even more as I expect it to be a temporary solution. At least until a shortcuts xdg-portal is not finalized.
P.S. do you have a way to pin a particular /dev/input/event*
to the same path?
Good point, I should have mentioned the possible security hole in adding your user to the input
group. There's more nuanced ways to do that which involve udev rules and logind as mentioned in this reddit thread, although they don't completely solve the issue, just limit the blast radius.
After you mentioned pinning the event path I changed the script to fetch the context based on libinput
seat rather than path. Assuming your DE/WM doesn't create multiple seats this should always be seat0
(as far as my limited understanding goes) and shouldn't change. The gist is updated as well, hopefully that accomplishes what you're looking for?
here's more nuanced ways to do that which involve udev rules and logind as mentioned in this reddit thread
I was indeed wondering if we couldn't do some udev rule magic!
although they don't completely solve the issue, just limit the blast radius
it limits the "keylogging capabilities" to the device you want to bind PTT to, right? Or is the blast radius wider?
The gist is updated as well, hopefully that accomplishes what you're looking for?
It does! It's awesome, thanks!
P.S.: for anyone on Arch (or derivates), here is the PKGBUILD for python-libinput
There is the XDG global shortcut portal API (PR, Docs) which should also allow for binding global shortcuts on Wayland in a DE-agnostic way - though with a bit of DBus work, unfortunately it's not actually available in any released version of KDE/GNOME yet, so it'll probably be a while until it can be used.
Will it be possible to use only one key to bind the Push To Talk functionality?
I'm not sure if I understand your question correctly, but binding a single key requires the same infrastructure as binding multiples - Aka: it currently doesn't work properly on Wayland as the current shortcut implementation relies on being notified of all input events (essentially a key logger), which is not possible on Wayland.
I meant; will the xdg-desktop-portal GlobalShortcuts lets mumble users to use only a single key for the Push to Talk functionality when everything will be implemented?
Ah :bulb: Yes I would expect so. The hope would be for this change to be completely transparent such that the user doesn't notice whether they are using Mumble with X11 or with Wayland.
Maybe @aleixpol would know 🙂
Yes, it's possible to use a single key for push to talk as does this PR, it's not something theoretical.
KDE has added "Legacy X11 App Support" to the system settings when running under Wayland, and one of the options is to allow applications to read keystrokes again. This completely fixes push-to-talk support on Fedora. There is a merge request (https://invent.kde.org/plasma/kwin/-/merge_requests/4595) to extend this system to also send mouse button presses.
Note that for now at least the "Legacy X11 App Support" only seems to work for keyboard shortcuts. For mouse button support, it appears KDE 6.1 will be needed: https://www.mail-archive.com/[email protected]/msg889735.html
I use hyprland and in a very wayland like way I let the compositor handle global shortcuts for me by sending it to the mumble application. I believe that also in the future, global shortcuts should be handled by the compositor. Maybe we can ask freedesktop to make a standard configuration format for this. That way, mumble can suggest configurations that work independent of the compositor. This way there are no security compromises as the user will be conscious of all changes.