Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 86e674c6 authored by Furkan Tokac's avatar Furkan Tokac 💬

Touchpad KCM Pointer Speed Slider Improvement

Summary:
Slider value to libinput value mapping algorithm is changed. Tested and everything is working fine.
You can test it by changing value on slider and checking the libinput value from ~/.config/kcminputrc
UI is same so I don't share screenshot.

Reviewers: ngraham, romangg, #plasma

Reviewed By: ngraham, romangg, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D13767
parent 13b35bd8
......@@ -230,7 +230,7 @@ Kirigami.ScrollablePage {
id: accelSpeed
from: 1
to: 10
to: 11
stepSize: 1
function load() {
......@@ -239,14 +239,16 @@ Kirigami.ScrollablePage {
value = 0.1
return
}
// transform libinput's pointer acceleration range [-1, 1] to slider range [1, 10]
value = 4.5 * touchpad.pointerAcceleration + 5.5
// transform libinput's pointer acceleration range [-1, 1] to slider range [1, 11]
value = 6 + touchpad.pointerAcceleration / 0.2
}
onValueChanged: {
if (touchpad != undefined && enabled && !root.loading) {
// transform slider range [1, 10] to libinput's pointer acceleration range [-1, 1]
touchpad.pointerAcceleration = Math.round( (value - 5.5) / 4.5 * 100 ) / 100
// transform slider range [1, 11] to libinput's pointer acceleration range [-1, 1]
// by *10 and /10, we ignore the floating points after 1 digit. This prevents from
// having a libinput value like 0.60000001
touchpad.pointerAcceleration = Math.round(((value-6) * 0.2) * 10) / 10
root.changeSignal()
}
}
......@@ -476,7 +478,7 @@ Kirigami.ScrollablePage {
Kirigami.Separator {
}
// Scrolling
Layouts.ColumnLayout {
Kirigami.FormData.label: i18n("Scrolling:")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment