原因是qt的ps2鼠标驱动与触摸板通讯协议不同,导致ps2数据不能正确解析。
解决方法:
1:在程序外部指定鼠标类型,export QWS_MOUSE_PROTO=BusMouse
2:修改BusMouse对应的ps2接收处理函数,将源代码注释,增加下面代码
if (mb[0] & 0x01)
bstate |= Qt::LeftButton;
if (mb[0] & 0x02)
bstate |= Qt::RightButton;
if (mb[0] & 0x04)
bstate |= Qt::MidButton;
dx = (mb[0] & 0x10) ? mb[1]-256 : mb[1];//LHD
dy = (mb[0] & 0x20) ? mb[2]-256 : mb[2];
3:重新编译qt库