Linux/Android 多点触摸支持

2014-11-24 08:14:57 · 作者: · 浏览: 2

整个处理过程就是:touch screen-->drivers-->input subsystem-->evdev-->user space。由于touchscreen的不同,要使Linux支持多点触摸,还是要搭配或开发驱动。在驱动层中主要是把数据接收下来,然后根据多点触摸协议,上传到input 子系统。


下面是多点触摸协议:


for (i=0; i

input_event(input, EV_ABS, ABS_MT_TOUCH_MAJOR, point[i].valid); //如果当前点有效,则point[i].valid大于0的数即可


input_event(input, EV_ABS, ABS_MT_POSITION_X, point[i].x);


input_event(input, EV_ABS, ABS_MT_POSITION_Y, point[i].y);


input_mt_sync(input);


}


//一帧数据发送完成,发送一个同步信号


input_sync(input);


具体的协议说明,可参照source code中的文档(Documentation\input\multi-touch-protocol.txt)。