作者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