- 论坛徽章:
- 0
|
请教大家一个问题,最近在弄电容屏和Qt这块,一直都得不到解决,希望大神能帮下啊。
现状:系统是跑的linux,触摸屏是FT5206的电容屏,界面要用Qt。arm-linux-gcc :4.5.1 Qt:4.7.2
问题:Qt的程序可以跑起来,移动鼠标也可以流畅的移动,但是点击鼠标时Qt的按钮没反应(确定应该有反应的)。并一直打印:
unknown mouse event type=3, code=18, value=1
unknown mouse event type=0, code=2, value=0
unknown mouse event type=0, code=2, value=0
Qt的配置:
./configure -opensource -confirm-license -optimized-qmake -qt-freetype -embedded arm -xplatform qws/linux-arm-g++ -no-qt3support -no-libtiff -no-libmng -no-opengl -no-3dnow -no-openssl -no-phonon -no-qvfb -no-cups -no-glib -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-separate-debug-info -no-xmlpatterns -no-svg -no-webkit -qt-libtiff -qt-libmng -qt-mouse-linuxinput -qt-mouse-tslib -qt-mouse-pc -no-mouse-linuxtp -no-neon -nomake tools -nomake examples -nomake demos -nomake docs -L/share/tslib/lib -I/share/tslib/include -depths 4,8,16,32
/etc/profile配置:
export DISPLAY=:0.0
export HOME=/tmp
export QTDIR="/usr/local/Trolltech/QtEmbedded-4.7.2-arm"
export PATH=/bin:/sbin:/usr/bin QTDIR/bin PATH
/bin/ln -s /dev/fb/0 /dev/fb0
export V_ROOT=/tslib
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event0 #加载触摸屏驱动后的设备节点
#export TSLIB_CALIBFILE=$V_ROOT/etc/pointercal #去掉了校正,电容屏不需要校正
export TSLIB_CONFFILE=$V_ROOT/etc/ts.conf
export TSLIB_PLUGINDIR=$V_ROOT/lib/ts
export LD_LIBRARY_PATH=/lib:/usr/lib QTDIR/lib V_ROOT/lib LD_LIBRARY_PATH
export QWS_MOUSE_PROTO=LinuxInput:/dev/input/event0 #指定鼠标响应节点,input输入设备应该这样写
触摸屏的驱动安装后,节点为/dev/input/event0,cat /dev/input/event0,再点击屏幕,能出现乱码。用tslib中的ts_test测试时,光标能随意移动并可以出现以下:
1167632599.606708: 50 118 1
1167632599.616342: 51 118 1
1167632599.624805: 53 118 1
1167632599.634426: 54 118 1
1167632599.642944: 56 118 1
1167632599.652557: 57 118 1
1167632599.661321: 58 118 1
1167632599.679171: 59 118 1
1167632599.688780: 60 118 1
.....................
应该证明触摸屏驱动没问题的啊。我看了下上面打印的错误“unknown mouse event type”在Qt的源码:src/gui/embedded/qmouselinuxinput_qws.cpp +198
处,再看上面,貌似Qt根本就不知道我点击时的事件是什么,才打印这些话,我该怎么做? |
|