Page 1 of 1

Dont use second keyboard in Kodi

Posted: Sun May 17, 2015 12:45 pm
by bismosa
Hello,

i have successfully set up my RPi (2 B+) with Kodi on Raspian.
Now i have a USB-RFID-Reader connected and want read with a C-Script the Input from the RFID-Reader.

Code: Select all

cat /proc/bus/input/devices
I: Bus=0003 Vendor=08ff Product=0009 Version=0110
N: Name="USB Reader With Keyboard USB Reader With Keyboard"
P: Phys=usb-bcm2708_usb-1.3/input0
S: Sysfs=/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/0003:08FF:0009.0003/input/input2
U: Uniq=FM8PU83-Ver0E-0000
H: Handlers=sysrq kbd event2
B: PROP=0
B: EV=120013
B: KEY=e080ffdf 1cfffff ffffffff fffffffe
B: MSC=10
B: LED=1f
If a RFID-Card is detected this Keyboard is "typing" the Card Number on this Keyboard.

This is working fine...but if Kodi is started before my C-Script is running (and has exclusive rights on the Keyboard) Kodi gets exclusive Access to the keyboard...and i can not access it.

What can I do that Kodi ignores the keyboard?

Regards
Bismosa

Re: Dont use second keyboard in Kodi

Posted: Tue Mar 15, 2016 11:40 pm
by 459below
Greetings,

I'm asuming the RFID device is presented as a event input device (under /dev/input). Kodi seems to take what it can and gives nothing back. I've had this problem with a GPIO keyboard, but I'm fairly certain that this is the same issue. So in order to fix this, I made sure that Kodi could not grab the device and changed the device's mode using udev. I ran

Code: Select all

udevadm info -a -n /dev/input/by-path/platform-soc:gpio_keys-event
to determine the possible identifiers. Using that I crafted a simple rule:

Code: Select all

KERNELS=="soc:gpio_keys", SUBSYSTEMS=="platform", GROUP="root"
and appended that to the bottom of /etc/udev/rules.d/99-permissions.rules. This should just reverse what:

Code: Select all

KERNEL=="mouse*|mice|event*",   MODE="0660", GROUP="input"
for the keyboard in question does and the device can only be accessed by root - no longer the members of input. But all other mice and keyboards are unaffected and can still be used to control Kodi. To apply the rules without reboot I just ran

Code: Select all

udevadm control --reload-rules
udevadm trigger
Regards,
Below