Bug 469232 - Ability to bind mouse click types (left-click, right-click, etc) to drawing tablet pen buttons
Summary: Ability to bind mouse click types (left-click, right-click, etc) to drawing t...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_tablet (show other bugs)
Version: 5.27.4
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: Joshua Goins
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-01 11:33 UTC by v
Modified: 2024-07-29 16:41 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.2.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description v 2023-05-01 11:33:10 UTC
SUMMARY
***
The menu for drawing tablets shows the buttons of my drawing pen as tool buttons. But the option for assigning button presses to it only allows for keyboard shortcuts. There is no way visible to me to assign a mouse right click or middle click to one of them, which is something I need. 
***


STEPS TO REPRODUCE
1. Open settings -> Input Devices -> Drawing Tablet
2. Click the assign button to assign an input to the button

OBSERVED RESULT
no input from mouse clicks are registering, only keyboard presses

EXPECTED RESULT
both mouse and keyboard input shoud be recognized to assign to a pen or tablet button.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: EndevourOS
(available in About System)
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.9

ADDITIONAL INFORMATION
Comment 1 Felix 2024-02-21 19:02:29 UTC
Hey there!
Do I understand correctly that https://invent.kde.org/plasma/kwin/-/merge_requests/3055 implements the "behind the scenes" work for this and that now "only" a way to use this, like https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/920 implements for remapping mouse buttons is needed?

(For clarity, I don't really have the skills/knowledge to actually help here. Just curious, and would be very happy to be able to use my stylus buttons the way they are most useful outside of dedicated painting apps :D )
Comment 2 Joshua Goins 2024-02-21 23:02:57 UTC
(In reply to Felix from comment #1)
> Hey there!
> Do I understand correctly that
> https://invent.kde.org/plasma/kwin/-/merge_requests/3055 implements the
> "behind the scenes" work for this and that now "only" a way to use this,
> like https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/920
> implements for remapping mouse buttons is needed?

Partially correct, yes. You're right that the stuff for KWin is implemented but we need someone to make the necessary changes in kguiaddons to be able to actually record the mouse buttons. It's theoretically easy - and I even implemented a prototype - but probably requires quite a bit of refactoring.
Comment 3 HPetrus 2024-03-12 16:48:40 UTC
As a professional artist who uses Linux exclusively, I'm following this very closely.  Is there any update on this patch?
Comment 4 Joshua Goins 2024-06-16 15:22:41 UTC
(In reply to HPetrus from comment #3)
> As a professional artist who uses Linux exclusively, I'm following this very
> closely.  Is there any update on this patch?

This is part my NLNet grant work, so expect this feature to show up sometime this year :-)
Comment 5 Bug Janitor Service 2024-07-09 17:04:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kguiaddons/-/merge_requests/124
Comment 6 Bug Janitor Service 2024-07-09 17:45:27 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2384
Comment 7 Bug Janitor Service 2024-07-09 17:46:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kdeclarative/-/merge_requests/238
Comment 8 Bug Janitor Service 2024-07-12 17:18:48 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6095
Comment 9 Joshua Goins 2024-07-29 15:58:44 UTC
Git commit 34c2a36000efe4ac61e91dd7a4cc84fd4227d97d by Joshua Goins, on behalf of Joshua Goins.
Committed on 29/07/2024 at 15:46.
Pushed by redstrate into branch 'master'.

ButtonRebindsFilter: Support keyboard modifiers with mouse buttons

This is needed to better support emitting mouse button events when
pressing tablet buttons. It's common in many art programs that an action
is tied to a mouse button + a modifier, such as panning the canvas. So
being able to send keyboard modifiers in tandem with mouse buttons is
very useful when rebinding.

Tests are added for this new feature.

M  +64   -0    autotests/integration/buttonrebind_test.cpp
M  +37   -2    src/plugins/buttonrebinds/buttonrebindsfilter.cpp
M  +2    -0    src/plugins/buttonrebinds/buttonrebindsfilter.h

https://invent.kde.org/plasma/kwin/-/commit/34c2a36000efe4ac61e91dd7a4cc84fd4227d97d
Comment 10 Joshua Goins 2024-07-29 16:41:47 UTC
Git commit 8d541a7b601d4f4807f8ad82eb839025766a402d by Joshua Goins, on behalf of Joshua Goins.
Committed on 29/07/2024 at 16:26.
Pushed by redstrate into branch 'master'.

kcms/tablet: Overhaul button binding, move into dialog

Instead of solely allowing keystroke bindings, this changes the binding
process in the KCM drastically. It now pops up in a dialog, allowing a
user to choose between using keyboard bindings, mouse click bindings
or an application defined action.
FIXED-IN: 6.2.0

M  +2    -0    kcms/tablet/CMakeLists.txt
A  +213  -0    kcms/tablet/inputsequence.cpp     [License: LGPL(v2.0+)]
A  +112  -0    kcms/tablet/inputsequence.h     [License: LGPL(v2.0+)]
M  +12   -14   kcms/tablet/kcmtablet.cpp
M  +6    -6    kcms/tablet/kcmtablet.h
A  +56   -0    kcms/tablet/ui/ActionBinding.qml     [License: GPL(v2.0+)]
A  +243  -0    kcms/tablet/ui/ActionDialog.qml     [License: GPL(v2.0+)]
M  +59   -31   kcms/tablet/ui/main.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/8d541a7b601d4f4807f8ad82eb839025766a402d