David Wu
2010-05-25 10:40:44 UTC
I am trying to figure out what the keyboard driver receives in terms of raw
data.
When I do 'cat /dev/input/event0 | hexdump -C' and then press '1', I got
00000000 4b a7 fb 4b e9 93 05 00 04 00 04 00 1e 00 07 00
|K..K............|
00000010 4b a7 fb 4b 13 94 05 00 01 00 02 00 01 00 00 00
|K..K............|
00000020 4b a7 fb 4b 19 94 05 00 00 00 00 00 00 00 00 00
|K..K............|
00000030 4b a7 fb 4b cd 0a 07 00 04 00 04 00 1e 00 07 00
|K..K............|
00000040 4b a7 fb 4b f7 0a 07 00 01 00 02 00 00 00 00 00
|K..K............|
00000050 4b a7 fb 4b fc 0a 07 00 00 00 00 00 00 00 00 00
|K..K............|
event0 maps to my USB keyboard
I know 00000000 to 00000050 is the time stamp. I also know USB HID code for
'1' is 0x1e, However, I am having difficulty figure out the rest of it.
I think the data should relate to the input_event struct in input.h of the
kernel source.
struct input_event {
struct timeval time;
__u16 type;
__u16 code;
__s32 value;
};
Does anyone have more insight on this?
data.
When I do 'cat /dev/input/event0 | hexdump -C' and then press '1', I got
00000000 4b a7 fb 4b e9 93 05 00 04 00 04 00 1e 00 07 00
|K..K............|
00000010 4b a7 fb 4b 13 94 05 00 01 00 02 00 01 00 00 00
|K..K............|
00000020 4b a7 fb 4b 19 94 05 00 00 00 00 00 00 00 00 00
|K..K............|
00000030 4b a7 fb 4b cd 0a 07 00 04 00 04 00 1e 00 07 00
|K..K............|
00000040 4b a7 fb 4b f7 0a 07 00 01 00 02 00 00 00 00 00
|K..K............|
00000050 4b a7 fb 4b fc 0a 07 00 00 00 00 00 00 00 00 00
|K..K............|
event0 maps to my USB keyboard
I know 00000000 to 00000050 is the time stamp. I also know USB HID code for
'1' is 0x1e, However, I am having difficulty figure out the rest of it.
I think the data should relate to the input_event struct in input.h of the
kernel source.
struct input_event {
struct timeval time;
__u16 type;
__u16 code;
__s32 value;
};
Does anyone have more insight on this?