4

I want to disable a keyboard input device with libinput. Something analogous to:

xinput set-int-prop 1 "Device Enabled" 8 0

which follows the syntax:

--set-int-prop device property format value

Sets an integer property for the device. Appropriate values for format are 8, 16, or 32, depending on the property. Deprecated, use --set-prop instead.

(or like xinput set-prop).

I want to use this to disable a keyboard-emulating authentication dongle (Yubikey) from "typing out" out a token from a spurious touch.

Perhaps there is a preferred method not involving libinput to do this. I do not want to disable the dongle completely, as it has features other than generating a token through its keyboard emulation (it is a GPG smart card too).

I am using Fedora 26 with Wayland.

1

I don't know any method involving libinput, but you can do an exclusive grab on the /dev/input/event* device that corresponds to the Yubikey. This works on the kernel input layer, with an ioctl, and prevents any other application (e.g. Wayland using libinput) from processing events from this device.

Normally whatever program that intends to use features on the Yubikey should do the grab, but you can test it out with evtest --grab and choosing the Yubikey, or evtest --grab /dev/input/eventX if you know the device or a symlink to it.

The ioctl is EVIOCGRAB, defined in /usr/include/linux/input.h, in case you want to use it from a program. Also works with Python and other scripting languages that can do iotctls.

0

fwiw, the LIBINPUT_IGNORE_DEVICE udev property can be assigned to devices that should be ignored. Detailed docs are here:

https://wayland.freedesktop.org/libinput/doc/latest/device-configuration-via-udev.html#ignoring-devices

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.