2009-01-20 22:02:50

by mike zheng

[permalink] [raw]
Subject: How to check input device

Hello,

It is the first time for me to use the input device. I have a keypad
driver registers a keypad the device as an input device in the kernel
2.6. The registration of the driver is OK, I can see the interrupt
whenever there is key pressed. How can I verify if it works fine?
Where can I check keycode value of the key pressed?

Thanks in advance,

Mike


Here is what I have in system:

# cat /proc/bus/input/handlers
N: Number=0 Name=kbd
N: Number=1 Name=evdev Minor=64
# cat /proc/bus/input/devices
I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="keypad"
P: Phys=keypad/input0
S: Sysfs=/devices/virtual/input/input0
U: Uniq=
H: Handlers=event0
B: EV=20003
B: KEY=102374 82c193c 53ff8708 1
B: LED=285

# ls -l /sys/devices/virtual/input/input0/
drwxr-xr-x 2 root root 0 Dec 31 16:01 capabilities
drwxr-xr-x 2 root root 0 Dec 31 16:01 event0
drwxr-xr-x 2 root root 0 Dec 31 16:01 id
-r--r--r-- 1 root root 4096 Dec 31 16:01 modalias
-r--r--r-- 1 root root 4096 Dec 31 16:01 name
-r--r--r-- 1 root root 4096 Dec 31 16:01 phys
lrwxrwxrwx 1 root root 0 Dec 31 16:01 subsystem ->
../../../../class/input
-rw-r--r-- 1 root root 4096 Dec 31 16:01 uevent
-r--r--r-- 1 root root 4096 Dec 31 16:01 uniq


2009-01-20 23:08:43

by Jiri Kosina

[permalink] [raw]
Subject: Re: How to check input device

On Tue, 20 Jan 2009, mike zheng wrote:

> It is the first time for me to use the input device. I have a keypad
> driver registers a keypad the device as an input device in the kernel
> 2.6. The registration of the driver is OK, I can see the interrupt
> whenever there is key pressed. How can I verify if it works fine? Where
> can I check keycode value of the key pressed?

If the input device is registered properly, there should be corresponding
/dev/input/eventX created. Running evtest (from input-utils) on this
node will decode and dump all the scancodes/keycodes that come out of the
corresponding input device.

--
Jiri Kosina
SUSE Labs