有人能告訴我什麼是由input_event結構中使用的數據類型的屬性?input_event結構描述(從Linux/input.h)
它被定義爲在input.h文件如下:
struct input_event {
struct timeval time;
__u16 type;
__u16 code;
__s32 value;
};
,但有沒有其他的說明!即使使用谷歌搜索,也沒有什麼有趣的。
我知道的唯一的事情是time
從紀元給出了幾秒或者幾個毫秒,而value
給出了按下按鈕的代碼。但是,即使value
財產的價值是不是真的對我清楚。在我的程序中,每個擊鍵都會產生六個事件。以下事件是按ENTER鍵鍵響應:
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
,而這些都是爲a
信:
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
我想值進行解碼,以真正的信,但我不明白的意思屬性。
請幫忙!