linux触摸屏应用程序开发,linux触摸屏(一)编写触摸屏应用

linux触摸屏

linux触摸屏(一)编写触摸屏应用

linux触摸屏(二)使用tslib

触摸屏驱动一般是采用input子系统驱动框架实现的,所以应用层接口要遵循input框架的接口,在介绍触摸屏应用编写前,先来学习input应用编程

一、使用hexdump读取input设备

在Linux下查看ls /dev/input,可以看到现在有的输入设备

比如我的结果是

# ls /dev/input/

event0 event1 event2 mice   mouse0 mouse1

这些都是通过input子系统实现的输入设备驱动,遵循input子系统规范

其中event2为我的触摸屏设备节点,通过下面命令读取(hexdump读取的数是以16进制打印)

# hexdump /dev/input/event2

当我点击触摸屏然后松开,发现控制台打印了许多消息

0247 0000 00d3 000e 0003 0000 02c4 0000

0247 0000 00db 000e 0003 0001 0181 0000

0247 0000 00de 000e 0001 014a 0001 0000

0247 0000 00e0 000e 0003 0018 0001 0000

0247 0000 00e2 000e 0000 0000 0000 0000

0248 0000 c838 0002 0001 014a 0000 0000

0248 0000 c876 0002 0003 0018 0000 0000

0248 0000 c89f 0002 0000 0000 0000 0000

其中每一行都表示一个input事件,

你可能感兴趣的:(linux触摸屏应用程序开发)