[問題] input event的接收

看板LinuxDev作者 (eleghost)時間14年前 (2011/08/09 01:23), 編輯推噓7(703)
留言10則, 5人參與, 最新討論串1/1
因為在弄touchscreen的driver,我是使用linux 2.6.32版的 我看input layer介紹是說以event的方式傳遞. 我想問以event的方式是怎樣的方式, 跟我們一般要先open device node 的方式不同嗎? 那當我parsing出touch device所傳出的XY值後, 使用input_report_abs() or input_event()傳上去後, APP端要 怎樣接收呢, 也是直接去讀取 /dev/input/event# 下的資料嗎? 謝謝各位, 因為我去Google查訊input方面大查到driver方面的 沒有查到ap上要如何應用, 謝謝. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 192.72.220.129 ※ 編輯: eleghost 來自: 192.72.220.129 (08/09 10:01)

08/09 20:51, , 1F
用struct input_event 去接=> read(ts_fd,&data,...etc);
08/09 20:51, 1F

08/09 21:31, , 2F
去看tslib裡面input-raw.c裡面怎麼讀的就知道了
08/09 21:31, 2F

08/09 21:35, , 3F
或是QT原始碼的qmouselinuxinput_qws.cpp 也有示範怎麼讀
08/09 21:35, 3F

08/10 09:09, , 4F
的確 open touchscreen 相對應的 event node後去read
08/10 09:09, 4F
了解, 謝謝上面幾位, 感謝a大讓我知道還有tslib ※ 編輯: eleghost 來自: 192.72.220.129 (08/10 09:18)

08/10 14:21, , 5F
不過tslib看起來只支援單點觸碰?有錯還請告知XD
08/10 14:21, 5F

08/11 16:43, , 6F
不知道是否可以在driver上也做類似tslib的動作..
08/11 16:43, 6F

08/11 16:43, , 7F
有哪間ts的driver有這樣做嗎?
08/11 16:43, 7F

08/13 14:53, , 8F
driver在userspace的話,可以開hidraw node讀資料後
08/13 14:53, 8F

08/13 14:55, , 9F
再用uinput傳上去kernel,然後userspace再去讀event node
08/13 14:55, 9F

08/14 14:20, , 10F
CAF 改好一份支援多點的 tslib: http://goo.gl/rjclf
08/14 14:20, 10F
文章代碼(AID): #1EG8m6LT (LinuxDev)