How to reproduce xf86-input-synaptics touchpad behaviour with Wayland/libinput?

With the update to Plasma 6.8, I was forced to switch to Wayland. This has completely messed up the behaviour of my touchpad.

Previously I had been using xf86-input-synaptics. I know that this has been deprecated for a while, but each time I tried to switch to libinput, the touchpad behaviour changed so much that I couldn’t get used to it even after a few days.

I believe I was using the default settings of the synaptics driver. This is the output of synclient -l:

Parameter settings:
    LeftEdge                = 141
    RightEdge               = 3387
    TopEdge                 = 96
    BottomEdge              = 1697
    FingerLow               = 25
    FingerHigh              = 30
    MaxTapTime              = 180
    MaxTapMove              = 174
    MaxDoubleTapTime        = 180
    SingleTapTimeout        = 180
    ClickTime               = 100
    EmulateMidButtonTime    = 0
    EmulateTwoFingerMinZ    = 282
    EmulateTwoFingerMinW    = 7
    VertScrollDelta         = 79
    HorizScrollDelta        = 79
    VertEdgeScroll          = 1
    HorizEdgeScroll         = 1
    CornerCoasting          = 0
    VertTwoFingerScroll     = 1
    HorizTwoFingerScroll    = 1
    MinSpeed                = 1
    MaxSpeed                = 1.75
    AccelFactor             = 0.0505433
    TouchpadOff             = 0
    LockedDrags             = 0
    LockedDragTimeout       = 5000
    RTCornerButton          = 0
    RBCornerButton          = 0
    LTCornerButton          = 0
    LBCornerButton          = 0
    TapButton1              = 1
    TapButton2              = 2
    TapButton3              = 3
    ClickFinger1            = 1
    ClickFinger2            = 3
    ClickFinger3            = 2
    CircularScrolling       = 0
    CircScrollDelta         = 0.1
    CircScrollTrigger       = 0
    CircularPad             = 0
    PalmDetect              = 0
    PalmMinWidth            = 10
    PalmMinZ                = 200
    CoastingSpeed           = 20
    CoastingFriction        = 50
    PressureMotionMinZ      = 30
    PressureMotionMaxZ      = 160
    PressureMotionMinFactor = 1
    PressureMotionMaxFactor = 1
    GrabEventDevice         = 0
    TapAndDragGesture       = 1
    AreaLeftEdge            = 0
    AreaRightEdge           = 0
    AreaTopEdge             = 0
    AreaBottomEdge          = 0
    HorizHysteresis         = 19
    VertHysteresis          = 19
    ClickPad                = 1
    RightButtonAreaLeft     = 1764
    RightButtonAreaRight    = 0
    RightButtonAreaTop      = 1470
    RightButtonAreaBottom   = 0
    MiddleButtonAreaLeft    = 0
    MiddleButtonAreaRight   = 0
    MiddleButtonAreaTop     = 0
    MiddleButtonAreaBottom  = 0

This is the relevant output of libinput list-devices:

Device:                  ELAN0676:00 04F3:3195 Touchpad
Kernel:                  /dev/input/event6
Id:                      i2c:04f3:3195
Group:                   2
Seat:                    seat0, default
Size:                    114x58mm
Capabilities:            pointer gesture
Tap-to-click:            disabled
Tap-and-drag:            enabled
Tap button map:          left/right/middle
Tap drag lock:           disabled
Left-handed:             disabled
Nat.scrolling:           disabled
Middle emulation:        disabled
Calibration:             n/a
Scroll methods:          *two-finger edge 
Scroll button:           n/a
Scroll button lock:      n/a
Click methods:           *button-areas clickfinger 
Clickfinger button map:  left/right/middle
Disable-w-typing:        enabled
Disable-w-trackpointing: enabled
Accel profiles:          flat *adaptive custom
Rotation:                n/a
Area rectangle:          n/a

This is on a ThinkPad T14 Gen5 AMD running Arch Linux.

The concrete misbehaviour that I have observed:

  • At slow touch movement, the mouse cursor moves too fast
  • At medium touch movement, the mouse cursor moves too slow
  • At fast touch movement, the mouse cursor moves too fast
  • I cannot scroll by sliding along the right/bottom edge of the touchpad (I can only do 2-finger scroll. I need to be able to do both.)
  • When I do 2-finger scroll, for the first few millimetres of touch movement, it does not scroll. Then it suddenly starts.
  • When I scroll, and then stop touching the touchpad, the application keeps on scrolling for a long time. I need it to stop as soon as I leave the touchpad.
  • If I try to use the touchpad after typing on the keyboard, it does not react for a short while.

What are the steps necessary to restore the old touchpad behaviour on Wayland using libinput?