更正一下:问题也不在libts里,而在内核的驱动里。
花了大半天分析和测试触摸输入设备的驱动程序,测试向input-core报告触摸事件和释放事件的方法,尝试了N多次(N>30)才成功。
这个特征和QT无关,属于驱动程序,(向input通告触摸行为和位置的)关键代码片断如下:
......
if (pressed)
{
input_mt_slot(ts->input_dev, id);
input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, true);
input_report_abs(ts->input_dev, ABS_MT_POSITION_X, input_x);
input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, input_y);
input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, input_w);
input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, input_w);
input_report_abs(ts->input_dev, ABS_MT_TRACKING_ID, id);
input_mt_sync(ts->input_dev);
}
else
{
input_mt_slot(ts->input_dev, id);
input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, false);
}
......
供需要的人参考。