Bug 457705

Summary: Feature to change the pressure curve of the graphic tablet in the tablet KCM
Product: [Applications] systemsettings Reporter: Raghavendra kamath <raghu>
Component: kcm_tabletAssignee: Joshua Goins <josh>
Status: RESOLVED FIXED    
Severity: wishlist CC: aleixpol, info, josh, natalie_clarius, nate, nicolas.fella
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 6.3.0
Sentry Crash Report:
Attachments: screenshot showing the edit dialog
Screenshot showing an edited curve with bezier handles
^ img of a graph of a atypical pressure curve, but used for daily usage for "UGTABLET Artist Pro 16 (Gen2)".

Description Raghavendra kamath 2022-08-10 06:10:14 UTC
SUMMARY
In earlier KCM for the graphic tablets there was a way to edit the curve for pressure input data coming from the tablet. Artists have different style of painting, some press the tablet hard and some softly to make a mark. To adjust ones style artists use the pressure curve to regulate how much pressure is needed to make a mark on the canvas. 
This feature is missing in the newer implementation of the tablet KCM under wayland. 

Some pens have both eraser tip and normal tip so ideally pressure curve of both the sides needs to be adjusted.

I am attaching a screenshot of the old tablet KCM to show the edit dialog. The edit dialog also showed the amount of pressure the artist is applying in blue to help them gauge it better.
Comment 1 Raghavendra kamath 2022-08-10 06:10:32 UTC
Created attachment 151215 [details]
screenshot showing the edit dialog
Comment 2 Raghavendra kamath 2022-08-10 06:12:21 UTC
Created attachment 151216 [details]
Screenshot showing an edited curve with bezier handles

The red dots in the screenshot are bezier handles the artist can use them to tweak the curve. The position of the points can be moved too to set the maximum pressure or minimum starting pressure. To get an idea also check the pressure curve setting in krita
Comment 3 David REVOY 2023-11-14 10:47:12 UTC
Created attachment 163147 [details]
^ img of a graph of a atypical pressure curve, but used for daily usage for "UGTABLET Artist Pro 16 (Gen2)".

Hi, 
I just plug my voice here for **a big +1 to this**. 

I own right now a "UGTABLET Artist Pro 16 (Gen2)" and the pressure range is really long. I have to press a lot to reach 100% and it can hurts my hand to work this way. I have to fix that to set a pressure curve as you can see in attachement. In short: it reach 100% of the pressure at half, and the way to reach it is a bit "firm". A single slider "Firm" or "Soft" as on previous kcm_tablet panel couldn't fix this situation. Right now (on X11) and for the past 14 years, I had to set it with this interactive web GUI: https://linuxwacom.github.io/bezier.html to find the values, and then report them to xsetwacom this way `xsetwacom --set "UGTABLET Artist Pro 16 (Gen2) stylus" PressureCurve 90 85 15 100`). 

So, getting this one on the Wayland KDE kcm_tablet component is very important to me, as xsetwacom or any X11 configuration will disapear and the only possibility to fix my device will be now via the configuration panel of the D.E.
Comment 4 Nate Graham 2023-11-30 15:45:33 UTC Comment hidden (spam)
Comment 5 Raghavendra kamath 2023-11-30 17:41:07 UTC Comment hidden (spam)
Comment 6 Nate Graham 2023-11-30 17:43:19 UTC Comment hidden (spam)
Comment 7 Raghavendra kamath 2023-11-30 17:48:42 UTC Comment hidden (spam)
Comment 8 Nate Graham 2023-11-30 17:52:09 UTC Comment hidden (spam)
Comment 9 Bug Janitor Service 2024-01-12 02:01:53 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/1972
Comment 10 Joshua Goins 2024-10-14 22:04:40 UTC
Git commit f09cf6ae177ced4dcf6352ea417c46cd08868426 by Joshua Goins, on behalf of Joshua Goins.
Committed on 14/10/2024 at 21:53.
Pushed by redstrate into branch 'master'.

libinput: Use pen pressure transform before sending tablet events

M  +3    -1    src/backends/libinput/connection.cpp

https://invent.kde.org/plasma/kwin/-/commit/f09cf6ae177ced4dcf6352ea417c46cd08868426
Comment 11 Joshua Goins 2024-10-14 22:04:48 UTC
Git commit fe9b9ee4c65b00d61b1e840faeb1bdcc27274b69 by Joshua Goins, on behalf of Joshua Goins.
Committed on 14/10/2024 at 21:53.
Pushed by redstrate into branch 'master'.

libinput: Add pressure curve property for tweaking pen pressure

This adds a property backed by the aforementioned CubicCurve class,
which will allow us to assign a curve to transform the pen pressure.
This can be used for small changes like changing the thresholds (beyond
what libinput already does transparently), to radically changing how the
pen pressure is mapped.

M  +47   -0    autotests/libinput/device_test.cpp
M  +65   -1    src/backends/libinput/device.cpp
M  +13   -0    src/backends/libinput/device.h

https://invent.kde.org/plasma/kwin/-/commit/fe9b9ee4c65b00d61b1e840faeb1bdcc27274b69
Comment 12 Joshua Goins 2024-10-14 23:01:31 UTC
Git commit 5f73502d7faff7cd5d2393e34c318d1c31d9a4e3 by Joshua Goins, on behalf of Joshua Goins.
Committed on 14/10/2024 at 22:05.
Pushed by redstrate into branch 'master'.

kcms/tablet: Add configurable pen pressure curve

This adds a new feature to the Tablet KCM, allowing artists to tweak the
pen pressure curve of their pen (or eraser.) It's exposed in the KCM as
a curve, allowing two control points of articulation.
FIXED-IN: 6.2.0

M  +11   -2    kcms/libkwindevices/inputdevice.cpp
M  +11   -0    kcms/libkwindevices/inputdevice.h
M  +31   -0    kcms/tablet/kcmtablet.cpp
M  +4    -0    kcms/tablet/kcmtablet.h
A  +257  -0    kcms/tablet/ui/PressureCurve.qml     [License: GPL(v2.0+)]
M  +80   -0    kcms/tablet/ui/main.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/5f73502d7faff7cd5d2393e34c318d1c31d9a4e3