2025-04-22 10:25:55 +10:00
|
|
|
-- SPDX-License-Identifier: MIT
|
|
|
|
|
--
|
|
|
|
|
-- An example plugin to make the pointer go three times as fast
|
|
|
|
|
--
|
|
|
|
|
-- Install this file in /etc/libinput/plugins and
|
|
|
|
|
--
|
|
|
|
|
-- UNCOMMENT THIS LINE TO ACTIVATE THE PLUGIN
|
|
|
|
|
-- libinput:register({1})
|
2025-10-23 09:59:56 +10:00
|
|
|
libinput:connect("new-evdev-device", function(device)
|
2025-04-22 10:25:55 +10:00
|
|
|
local usages = device:usages()
|
|
|
|
|
if usages[evdev.REL_X] then
|
2025-10-23 09:59:56 +10:00
|
|
|
device:connect("evdev-frame", function(device, frame, timestamp)
|
2025-04-22 10:25:55 +10:00
|
|
|
for _, v in ipairs(frame) do
|
|
|
|
|
if v.usage == evdev.REL_X or v.usage == evdev.REL_Y then
|
|
|
|
|
-- Multiply the relative motion by 3
|
|
|
|
|
v.value = v.value * 3
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
return frame
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
end)
|