mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 05:40:04 +01:00
The existence of the log global was in part due to early (pre-merge) versions of the Lua plugins supporting multiple libinput plugin objects per file. This is no longer the case and integrating the log functions into the (single) libinput object makes the code more obvious (we're calling libinput:log_debug() now, so it's obviously a libinput log function) and we no longer mix dot with colon notations. Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1350>
16 lines
597 B
Lua
16 lines
597 B
Lua
-- SPDX-License-Identifier: MIT
|
|
--
|
|
-- An example plugin to show how to disable an internal feature.
|
|
--
|
|
-- Typically one would expect the plugin to re-implement the feature
|
|
-- in a more device-specific manner but that's not done here.
|
|
|
|
-- UNCOMMENT THIS LINE TO ACTIVATE THE PLUGIN
|
|
-- libinput:register({1})
|
|
libinput:connect("new-evdev-device", function(device)
|
|
local udev_info = device:udev_properties()
|
|
if udev_info["ID_INPUT_TOUCHPAD"] then
|
|
libinput:log_info("Disabling palm detection on " .. device:name())
|
|
device:disable_feature("touchpad-palm-detection")
|
|
end
|
|
end)
|