Plasma 6 RFC: Mouse buttons (etc) in shortcuts KCM?
- Users have wanted to be able to bind shortcuts to input devices other than the keyboard (Bug 171295).
- With !920 (merged) it is now possible remap extra mouse buttons to keyboard keys. With kwin!3055 (merged) it is possible to remap mouse buttons to other mouse buttons and tablet tool buttons.
- Tablet pad and tool buttons can also be mapped to mouse buttons or keyboard keys.
- This flexibility enables many different workflows for users, which is good.
- However, in the case of shortcuts, only key sequences are supported. Any other input method we've added support for rests on synthesizing key presses which then activate keyboard shortcuts.
This means that a user who wants a mouse button to activate a shortcut needs to add a "sacrificial" keybind to act as a middleman.
And then if we get into other input devices; tablets, game controllers, whatever else one might find on a mobile device. If one wants to use any of them for a shortcut, it has to be a keybind first. Could we, do we want to cut out this middleman?
- Could change the
settingsshortcuts KCM (called "keys" in the code) and add/modify the necessary APIs so it isn't so QKeySequence-centric - Could enable binding these non-keyboard inputs directly to shortcuts/actions in their respective KCMs.
- Could just keep it the way it is.
Also on the horizon, applications are going to start adding their own shortcuts via the new GlobalShortcuts xdg-desktop-portal. This is the Wayland session's answer to global hotkeys; instead of an application being able to see input while unfocused, it asks the compositor to bind shortcuts, and the compositor will send the application a DBus signal when it detects the shortcut is pressed or released. Instead of using the application's settings menu to bind hotkeys, the compositor's settings menu (the keys KCM, in this case) is opened.
Some (most?) applications that support global hotkeys support binding mouse buttons (and possibly other input devices) in their settings menus. If an application uses the global shortcuts portal, the KCM that pops up should be able to do the same, or make it obvious where it can be done.
@ngraham @apol @davidre @davidedmundson, I'd appreciate your input.