You are not logged in.
Does any of you have experience developing libinput plugins? I'm making a plugin to (try to) prevent accidental key presses. The problem I'm facing is that none of the debug messages get output. I know that the plugin is being loaded because if I try to add bad code to it libinput complains.
This is the code:
libinput:register({1})
libinput:log_debug("Starting plugin")
prevTime = -1
prevFrame = nil
INTERVAL = 50000 -- 50 miliseconds
function frame(_, frame, timestamp)
libinput:log_debug("New frame detected")
-- if the same keys are being affected return them
if equalKeys(frame, prevFrame) then
libinput:log_debug("Same key pressed")
prevTime = timestamp
return frame
else
libinput:log_debug("Different key pressed")
if timestamp - prevTime > INTERVAL then
prevTime = timestamp
prevFrame = frame
libinput:log_debug("New key bubbled up")
return frame
else
libinput:log_debug("Key suppressed")
return {} --
end
end
end
function device_new(device)
local usages = device:usages()
if usages[evdev.KEY_SCROLLLOCK] then
libinput:log_debug("Connecting to new device")
device:connect("evdev-frame", frame)
end
end
function equalKeys(t1, t2)
if t1 == t2 then return true end
if type(t1) ~= "table" or type(t2) ~= "table" then return false end
for k in pairs(t1) do
if t1[k] == nil then return false end
end
for k in pairs(t2) do
if t1[k] == nil then return false end
end
return true
end
libinput:connect("new-evdev-device", device_new)I'm testing it with
sudo libinput debug-events --enable-pluginsLast edited by msl09 (Yesterday 22:18:04)
Offline
Tried good old print() or "--quiet --verbose"?
Offline
Yep, it was --verbose. Thanks seth!
Offline