I did something similar for a USB barcode reader, which is a HID keyboard.
/dev/input/event* . EVIOCGRAB ioctl(), . - . evdev Documentation/input/input.txt linux.
, :
struct input_event {
struct timeval time;
unsigned short type;
unsigned short code;
unsigned int value;
};
(struct input_event linux/input.h).
, , input_event.type == EV_REL ( ), input_event.code - REL_X ( X - . linux/input.h ), input_event.value .
HID , .