What dev do I use to read a USB keyboard in an embedded Linux system?
I've compiled the kernel to support USB HID and keyboard devices. When I plug in the USB keyboard, the kernel recognizes it, and goes so far as to latch/unlatch the NUMLOCK led when I press the same key.
Is there a dev
file entry I can create so I can read (cat /dev/input/...
) data from the USB keyboard?
I appreciate that I might be looking at scanning codes.
I tested the USB HID with a 开发者_开发问答mouse, although it produces garbage on the console, I know it's connected using information I found here.
EDIT-Ignacio
How can I map the following to a dev
entry, specifically where do I glean the minor revision number?
# cat /proc/bus/input/devices
I: Bus=0003 Vendor=046d Product=c316 Version=2800
N: Name="Logitech Logitech USB Keyboard"
P: Phys=usb-at91rm9200-1.1/input0
H: Handlers=kbd
B: EV=120003
B: KEY=10000 7 ff800000 7ff febeffdf ffefffff ffffffff fffffffe
B: LED=1f
I: Bus=0003 Vendor=046d Product=c316 Version=2800
N: Name="Logitech Logitech USB Keyboard"
P: Phys=usb-at91rm9200-1.1/input1
H: Handlers=kbd
B: EV=3
B: KEY=9f01 400 40000 401878 d800d508 1e0000 0 0 0
Once you've scanned /proc/bus/input/devices
for the appropriate event device you can use MAKEDEV
to create it (character, major number 13, minor number 64+) and access it as usual.
精彩评论