Reload tslib touch screen calibration

你离开我真会死。 提交于 2019-12-04 17:04:40

It turns out that the driver can be reloaded without restarting the application. To do so, you can close and re-open the pointer device(s), using methods in the QWSServer class like so:

#include <QWSServer>

...

QWSServer::instance()->closeMouse();
QWSServer::instance()->openMouse();

This will cause a reload of tslib's calibration file. E.g., if you started the program with a faulty calibration, correct the calibration file for the touch screen while the program is running, then invoke those methods, the pointer will adjust to the new calibration.

tslib has nothing to do with Qt. You can download the sources of tslib and look what tests/ts_calibrate.c does.

ts_reconfig() should do what you want.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!