作者eleghost (eleghost)
看板LinuxDev
標題[問題] input event的接收
時間Tue Aug 9 09:23:15 2011
因為在弄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)
1F:推 heoris:用struct input_event 去接=> read(ts_fd,&data,...etc); 08/09 20:51
2F:推 askacis:去看tslib裡面input-raw.c裡面怎麼讀的就知道了 08/09 21:31
3F:推 askacis:或是QT原始碼的qmouselinuxinput_qws.cpp 也有示範怎麼讀 08/09 21:35
4F:推 mike0226:的確 open touchscreen 相對應的 event node後去read 08/10 09:09
了解, 謝謝上面幾位, 感謝a大讓我知道還有tslib
※ 編輯: eleghost 來自: 192.72.220.129 (08/10 09:18)
5F:推 askacis:不過tslib看起來只支援單點觸碰?有錯還請告知XD 08/10 14:21
6F:推 pilipalabon:不知道是否可以在driver上也做類似tslib的動作.. 08/11 16:43
7F:→ pilipalabon:有哪間ts的driver有這樣做嗎? 08/11 16:43
8F:推 askacis:driver在userspace的話,可以開hidraw node讀資料後 08/13 14:53
9F:→ askacis:再用uinput傳上去kernel,然後userspace再去讀event node 08/13 14:55