主题 : mini2440是如何同时支持鼠标和触摸的? 复制链接 | 浏览器收藏 | 打印
级别: 侠客
UID: 8515
精华: 0
发帖: 62
金钱: 535 两
威望: 233 点
综合积分: 124 分
注册时间: 2009-08-26
最后登录: 2014-06-25
楼主  发表于: 2009-10-14 14:35

 mini2440是如何同时支持鼠标和触摸的?

mini2440是如何同时支持鼠标和触摸的?
如果可以,这个环境变量QWS_MOUSE_PROTO该如何设置?
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2009-10-14 15:20
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
2楼  发表于: 2009-10-14 15:49
# #通过判断/sys/devices/virtual/input/input0/uevent中是否包含touchscreen信息使Qtopia自动识别touchscreen和USB鼠标
TS_INFO_FILE=/sys/devices/virtual/input/input0/uevent
if [ -e $TS_INFO_FILE -a "/bin/grep -q TouchScreen < $TS_INFO_FILE" ]; then
     export QWS_MOUSE_PROTO="TPanel:/dev/input/event0 USB:/dev/input/mice"
     if [ -e /etc/pointercal -a ! -s /etc/pointercal ] ; then
         rm /etc/pointercal
     fi
else
     export QWS_MOUSE_PROTO="USB:/dev/input/mice"
     >/etc/pointercal
fi
unset TS_INFO_FILE
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 侠客
UID: 8515
精华: 0
发帖: 62
金钱: 535 两
威望: 233 点
综合积分: 124 分
注册时间: 2009-08-26
最后登录: 2014-06-25
3楼  发表于: 2009-10-14 16:33
谢谢!
if [ -e /etc/pointercal -a ! -s /etc/pointercal ] ; then
         rm /etc/pointercal
     fi
这句是什么意思啊?
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
4楼  发表于: 2009-10-14 16:51

 回 3楼(xiongbiaowh) 的帖子

当/etc/pointercal文件存在并且大小为0时,删除/etc/pointercal.
为了确保第一次启动时触摸屏校准程序会启动(我猜如果/etc/pointercal存在,Qtopia启动时就不会启动触摸屏校准程序,认为已经校准过)
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 侠客
UID: 8515
精华: 0
发帖: 62
金钱: 535 两
威望: 233 点
综合积分: 124 分
注册时间: 2009-08-26
最后登录: 2014-06-25
5楼  发表于: 2009-10-14 17:17
谢谢拉 楼上的真是个好人!
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
6楼  发表于: 2009-10-14 17:18
引用第5楼xiongbiaowh于2009-10-14 17:17发表的  :
谢谢拉 楼上的真是个好人!

如果你多看一些脚本和源代码的话,你也会成为好人的
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."