r/linuxquestions•
tipfom

Can Touchpad scroll speed be adjusted in libinput 1.30?

Hello everyone,

I tried to write a Lua plugin using the new libinput plugin system (https://wayland.freedesktop.org/libinput/doc/latest/lua-plugins.html). However, there did not seem to be any event.usage by which one could modify the touchpad scroll delta but instead I could only identify the position of the fingers on the touchpad in the frame.

Has anyone been able to implement a touchpad scroll adjustment plugin? I've found some for mouse based scrolling in https://gitlab.freedesktop.org/libinput/libinput/-/tree/main/plugins and https://github.com/uginos/libinput-scroll-speed .

Thanks!

PS: Currently, I used the following code to print out and hook onto the touchpad events.

function handle_frame(device, frame, timestamp)

local modified = false

for _, event in ipairs(frame) do

libinput:log_info("Device: " .. tostring(device.name))

libinput:log_info("Usage: " .. tostring(event.usage))

libinput:log_info("Value: " .. tostring(event.value))

if event.usage == ???? then

libinput:log_info("Touchpad scroll detected")

libinput:log_info("Before: " .. event.value)

event.value = math.floor(0.1 * event.value + 0.5)

libinput:log_info("After: " .. event.value)

modified = true

end

end

if modified then return frame end

return nil

end

function new_device(device)

local props = device:udev_properties()

if props["ID_INPUT_TOUCHPAD"] then

libinput:log_info("Applying custom scroll curve to generic mouse: " .. device:name())

device:connect("evdev-frame", handle_frame)

end

end

local version = libinput:register({1})

if version == 1 then

libinput:connect("new-evdev-device", new_device)

end

Posted Feb 15, 2026, 4:00 PM UTC

34
Loading comments…