D29365: Increase values for touchpad acceleration that can be set from kcm libinput UI

Giusy Margarita noreply at phabricator.kde.org
Tue May 5 00:07:54 BST 2020


kurmikon added a comment.


  Another solution. Spinbox 0% to 100%. -1 is 0% and 1 is 100%. Libinput default 0 will set 50%.
  
    // Acceleration
    RowLayout {
        Controls.SpinBox {
            Kirigami.FormData.label: i18nd("kcm_touchpad", "Pointer speed:")
            id: accelSpeed
    
            from: 0
            to: 100
            stepSize: 1
    
            function load() {
                enabled = touchpad.supportsPointerAcceleration
                if (!enabled) {
                    value = 50
                    return
                }
                // transform libinput's pointer acceleration range [-1, 1] to spinbox range [0, 100] %
                value = 50 + touchpad.pointerAcceleration / 0.02
            }
    
            onValueChanged: {
                if (touchpad != undefined && enabled && !root.loading) {
                    // transform spinbox range [0, 100] to libinput's pointer acceleration range [-1, 1]
                    touchpad.pointerAcceleration = Math.round(((value-50) * 0.02) * 100) / 100
                    root.changeSignal()
                }
            }
        }
    
        QtControls.Label {
            text: i18n("%")
        }
    }

REPOSITORY
  R119 Plasma Desktop

REVISION DETAIL
  https://phabricator.kde.org/D29365

To: kurmikon, #vdg, #plasma
Cc: ngraham, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, ragreen, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200504/a8d84012/attachment-0001.html>


More information about the Plasma-devel mailing list