Can someone please tell me what are the properties of the datatypes used by the input_event structure?
It is defined as follows in the input.h file:
struct input_event {
struct timeval time;
__u16 type;
__u16 code;
__s32 value;
};
but there are no other descriptions! Even googling gave me nothing interesting.
The only thing I know is that time
gives seconds or miliseconds from epoch and value
gives code of pressed button. But even value of value
property isn't really clear for me. In my program every keystroke generates six events. Following events are response for pressing ENTER key:
type=4,code=4,value=458792
type=1,code=28,value=1
type=0,code=0,value=0
type=4,code=4,value=458792
type=1,code=28,value=0
type=0,code=0,value=0
and those are for a
letter:
type=4,code=4,value=458756
type=1,code=30,value=1
type=0,code=0,value=0
atype=4,code=4,value=458756
type=1,code=30,value=0
type=0,code=0,value=0
I would like to decode value to the real letter, but I don't understand the meaning of the properties.
Please help!