Bug 461259

Summary: Allow assignment of modifier keys to tablet buttons on Wayland
Product: [Applications] systemsettings Reporter: Manuel C <manuel.manu.delfin>
Component: kcm_tabletAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: wishlist CC: adrian.groh, aleixpol, info, natalie_clarius, nate, nicolas.fella, pdgiddie+kde, raghu, roraharvest
Priority: NOR Keywords: usability, wayland
Version: 5.26.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 6.1
Sentry Crash Report:
Attachments: Screenshot of tablet button config screen and the associated config file section

Description Manuel C 2022-10-31 18:24:28 UTC
Created attachment 153361 [details]
Screenshot of tablet button config screen and the associated config file section

SUMMARY
Under X11, the kcm-wacomtablet used to allow assigning a modifier key (like Ctrl) to a tablet button. The new interface used for Wayland does not, but I was able to set this up by editing the config file manually.

This binding is not properly displayed in the settings [see attachment] but works fine otherwise.

EXPECTED RESULT
Allow for this assignment in the config interface, and show it properly.

SOFTWARE/OS VERSIONS
Linux: 6.0.5-arch1-1 (64-bit)
KDE Plasma Version: 5.26.2
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6

ADDITIONAL INFORMATION
Graphics Platform: Wayland
Comment 1 David REVOY 2023-11-14 10:28:29 UTC
Hi, 
I just plug my voice here for **a big +1 to this**.
(even if the bug is in "CONFIRMED" state, wich is great). 

Not having this possibility on Wayland is a big regression compare to kcm_tablet on X11.

For digital painting, modifiers like "Alt", "Ctrl" or "Shift" are **essential**.
I'm using on my side to have "Ctrl" modifier on the first button of my stylus (to replace the default "middle click/drag/scroll" action on GNU/Linux).
"Ctrl" allows me to color-pick canvas quickly. This is something I use since I started digital painting before 2000, so the muscle memory for that is strong on my side. 

( A short story: I remember the Gnome GUI not allowing this before 2013. On my side, I was praising already more than 10 years ago the configuration possibilities of KDE/Plasma GUI https://www.davidrevoy.com/article110/kubuntu-11-10-for-digital-painting , and during my digital painting workshop at the Libre Graphic Meeting in Madrid two Gnome designers asked me why I was using KDE/Plasma; then they realised when I showed the kcm_tablet GUI.  After this session, it was fixed the same year on GNOME side. The story is here to say it is ironic we are now ten years later, and it is Gnome who has the options for the tablet and no more KDE/Plasma and we have to re-explain how important it is ... )
Comment 2 Bug Janitor Service 2023-12-16 01:47:40 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/4797
Comment 3 Bug Janitor Service 2023-12-16 02:06:16 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/1933
Comment 4 Joshua Goins 2024-01-20 16:06:47 UTC
Git commit adbf69aab49a193650d895bbcee11899a968f17d by Joshua Goins, on behalf of Tino Lorenz.
Committed on 20/01/2024 at 16:49.
Pushed by redstrate into branch 'master'.

plugins/buttonrebinds: Support rebinding to modifier keys

Allow rebinding buttons to send modifier keys (Control, Alt, Meta,
Shift) without any other key.
This is part of restoring the functionality kcm-wacomtablet had under
X11 for wayland.

M  +23   -4    src/plugins/buttonrebinds/buttonrebindsfilter.cpp

https://invent.kde.org/plasma/kwin/-/commit/adbf69aab49a193650d895bbcee11899a968f17d
Comment 5 Bug Janitor Service 2024-01-20 16:21:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5008
Comment 6 Joshua Goins 2024-01-20 16:23:18 UTC
Git commit 3066dbdb8d8a0668f805482fb333882e952e08bf by Joshua Goins, on behalf of Tino Lorenz.
Committed on 20/01/2024 at 17:23.
Pushed by redstrate into branch 'master'.

kcm-tablet: Allow binding buttons to modifier keys

Allow rebinding buttons to send modifier keys (Control, Alt, Meta,
Shift) without any other key.

M  +2    -0    kcms/tablet/ui/main.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/3066dbdb8d8a0668f805482fb333882e952e08bf
Comment 7 Bug Janitor Service 2024-01-20 16:26:30 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5009
Comment 8 Vlad Zahorodnii 2024-01-22 08:37:30 UTC
Git commit 5a0f716236b812b9742a987bd260d98aa9c2e350 by Vlad Zahorodnii, on behalf of Tino Lorenz.
Committed on 22/01/2024 at 09:36.
Pushed by vladz into branch 'Plasma/6.0'.

plugins/buttonrebinds: Support rebinding to modifier keys

Allow rebinding buttons to send modifier keys (Control, Alt, Meta,
Shift) without any other key.
This is part of restoring the functionality kcm-wacomtablet had under
X11 for wayland.

(cherry picked from commit adbf69aab49a193650d895bbcee11899a968f17d)

M  +23   -4    src/plugins/buttonrebinds/buttonrebindsfilter.cpp

https://invent.kde.org/plasma/kwin/-/commit/5a0f716236b812b9742a987bd260d98aa9c2e350
Comment 9 Joshua Goins 2024-01-30 21:46:18 UTC
Git commit c76724b64e3a4962b22890aac54a123c5002c046 by Joshua Goins, on behalf of Tino Lorenz.
Committed on 30/01/2024 at 21:34.
Pushed by redstrate into branch 'Plasma/6.0'.

kcm-tablet: Allow binding buttons to modifier keys

Allow rebinding buttons to send modifier keys (Control, Alt, Meta,
Shift) without any other key.

(cherry picked from commit 3066dbdb8d8a0668f805482fb333882e952e08bf)

M  +2    -0    kcms/tablet/ui/main.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/c76724b64e3a4962b22890aac54a123c5002c046
Comment 10 adrian.groh 2024-05-27 12:47:23 UTC
I am currently testing Plasma 6.1 Beta and I can assign Meta as a shortcut as expected in the global shortcut settings, but if I try to set the shortcut in separate configuration windows (e.g. by going to Desktop Effects -> Overview -> Configure) it is not possible to set modifiers by themselves there.
Comment 11 David REVOY 2024-05-27 12:53:16 UTC
@adrian.groh : I'm not sure to understand how your observation is related to the 'Graphic Tablet panel' or to physical button of Graphic Tablets. It sounds more like a general feedback about Plasma and shortcut (global shortcut settings and Desktop Effect). 
Can you clarify?
Comment 12 adrian.groh 2024-05-27 13:00:37 UTC
(In reply to David REVOY from comment #11)
> @adrian.groh : I'm not sure to understand how your observation is related to
> the 'Graphic Tablet panel' or to physical button of Graphic Tablets. It
> sounds more like a general feedback about Plasma and shortcut (global
> shortcut settings and Desktop Effect). 
> Can you clarify?

Oh sorry, I mistakenly thought this bug was about being able to assign modifier keys alone to any action. Please ignore my previous comment.
Comment 13 David REVOY 2024-05-27 13:10:13 UTC
No problem. Thank you for the update, and I hope you'll find a better thread (or open a new one) to post your observations. Good luck!