smoked kipper |
07-21-2008 12:19 PM |
Quote:
Originally Posted by krisbee
(Post 3220990)
So, here is my udev rule (10-keyboardrules under /etc/udev/rules.d)
BUS=="serio", SYSFS{description}=="i8042 Kbd Port", NAME="%k", SYMLINK+="keywiz"
However, this does not make a /dev/keywiz ...it doesn't do anything :(
What am I doing wrong? I have rebooted several times (I know you don't have to, but I did just to make sure)..
The 1st keyboard is always showing up under /dev/input/event0 but the usb keyboard may not always show in the right place, so I would like two normal named /dev entries...
|
I don't think you can reference the serial port in this way, udev can only create symlinks to devices with nodes in /dev, but the keyboard port itself doesn't have its own node, only the device that provides the port does (i.e. the usb keyboard device). Try changing the BUS to usb and matching some line in the SYSFS attributes for the keyboard itself.
Alternatively, you can see your device list in /proc/bus/input/devices. It should be easy enough to parse this to find the event node.
Something like this should do (as you have multiple keyboards, replace "keyboard" with the actual name):
Code:
grep -A6 keyboard /proc/bus/input/devices | sed -n 's/^.*\(event[^ ]\+\)/\1/p'
You'll notice that all keyboards are bound to the kbd handler. If you are writing your own code, you can grab the device using input_device_grab (doesn't seem to be a man page for this, just look in the kernel source, (<src>/drivers/input)), the handlers will be bypassed and the process doing the grabbing will have exclusive access to the device, so you can handle the key events any way you like, though this will bypass X of course.
As for X, having multiple seperate keyboards in X should be possible now, but I haven't looked into it much. You need to use the "kbd" driver instead of the "keyboard" driver (see kbd(4), xorg.conf(5)).
|