下面對測試方法進行介紹:
1.使用hexdump /dev/event1 ,其中的event1是本機的,這個根據不同的驅動而定,你所寫的可能不是1,而是2,3,4等
hexdump的意思是十六進製制顯示 裝置/dev/event1,他就相當於是實現了(open(/dev/event1),read(),write()),先開啟/dev/event1裝置,然後讀按鍵的值,並將讀到的值以十六進製制寫出來。
我們得到的是
秒 微秒 type code value
0000000 0bb2 0000 0e48 000c 0001 0026 0001 0000
//對於上面四位元組的,低位元組在前高位元組在後
0000010 0bb2 0000 0e54 000c 0000 0000 0000 0000
0000020 0bb2 0000 5815 000e 0001 0026 0000 0000
0000030 0bb2 0000 581f 000e 0000 0000 0000 0000
對應於/*
* the event structure itself
*/struct input_event ;
struct timeval ;
2.在沒有啟動qt的情況下使用 cat /etc/tty1
使用 exec 0
輸入子系統簡單(按鍵)測試
輸入子系統簡單 按鍵 測試 input key.c 1 include 2 include 3 include 4 include 5 include 6 include 7 include for ebusy 8 include for request region 9 include for l...
輸入子系統
驅動函式操作步驟 在初始化函式中 1.分配乙個input dev結構體 struct input dev buttons dev buttons dev input allocate device 2.設定 2.1 能產生哪類事件 set bit ev key,buttons dev evbit s...
Linux輸入子系統
1.1.input子系統概述 輸入裝置 如按鍵,鍵盤,觸控螢幕,滑鼠等 是典型的字元裝置,其一般的工作機制是低層在按鍵,觸控等動作發生時產生乙個中斷 或驅動通過timer定時查詢 然後cpu通過spi,i2c或者外部儲存器匯流排讀取鍵值,座標等資料,放乙個緩衝區,字元裝置驅動管理該緩衝區,而驅動的r...