I have 3 USB-keyboards attached to the Linux. Normally, when writing on any one, the characters "going" to the currently active application, e.g. to terminal or any other app.
But, me reading the keyboard events from two keyboards directly by reading the particular
/dev/input/eventX devices using some perl module. While the script reads and decodes all events correctly, the entered keys are also going into active application.
The question is: It is possible to stop routing the keyboard events from particular keyboard to the active application? E.g. somewhat tell to kernel that inputs from particular keybord should not be taken as normal keyboard input.
X11 reads from every device which has device nodes in the
/dev/input/event* - kooks like, here are 2 possible solutions:
- Somewhat change the name of the USB "keyboard" to another name instead of
eventN, for example
/dev/input/myinput0. Unfortunately, the
udevrules doesn't allows renaming the device. (The
NAMEdirective in the
rules.dworks only for network devices, for other devices could create only symlink)
- Somewhat change the
X11configuration, in the
/usr/share/X11/xorg.conf.d/10-evdev.conf, to ignore some particular "keyboard-like" devices - e.g. don't read every
eventNdevice. Currently in my system it contains:
Section "InputClass" Identifier "evdev keyboard catchall" MatchIsKeyboard "on" MatchDevicePath "/dev/input/event*" Driver "evdev" EndSection
ANY IDEA how to do any of the above?
The real background: I have attached two USB-RFID readers. They acts as keyboards, e.g. when I touching the reader with the RFID-tag, it sends the RFID-number exactly as they was typed on the keyboard - e.g the readers acts as normal keyboard. My application could read the RFID events (in the background), and (of course) i don't want get the characters from RFID into the active window.