I.MX6 linux eGalaxTouch 自动获取设备节点

                       I.MX6 linux eGalaxTouch 自动获取设备节点

                        \\\\\\\\\\\\\\-*- 目录 -*-/////////////
| 一. 需求:
| 二. /proc/bus/input/devices 内容:
| 三. 解决方法:
| 四. 实际应用:
-------------------------------------- 一. 需求:
获取eGalaxTouch的输入设备节点 二. /proc/bus/input/devices 内容:
root@freescale /proc/bus/input$ cat /proc/bus/input/devices
I: Bus= Vendor= Product= Version=
N: Name="gpio-keys"
P: Phys=gpio-keys/input0
S: Sysfs=/devices/platform/gpio-keys/input/input0
U: Uniq=
H: Handlers=kbd event0
B: PROP=
B: EV=
B: KEY= I: Bus= Vendor=0eef Product= Version=
N: Name="eGalax Inc. eGalaxTouch EXC7200-0031v1000"
P: Phys=usb-fsl-ehci.-1.3/input0
S: Sysfs=/devices/platform/fsl-ehci./usb2/-/-1.3/-1.3:1.0/input/input1
U: Uniq=
H: Handlers=cpufreq_interactive
B: PROP=
B: EV=1b
B: KEY=
B: ABS= 3f
B: MSC= I: Bus= Vendor=0eef Product= Version=
N: Name="eGalaxTouch Virtual Device for Multi"
P: Phys=
S: Sysfs=/devices/virtual/input/input2
U: Uniq=
H: Handlers=cpufreq_interactive event1
B: PROP=
B: EV=b
B: KEY=
B: ABS= I: Bus= Vendor=0eef Product= Version=
N: Name="eGalaxTouch Virtual Device for Single"
P: Phys=
S: Sysfs=/devices/virtual/input/input3
U: Uniq=
H: Handlers=event2
B: PROP=
B: EV=b
B: KEY=
B: ABS= root@freescale /proc/bus/input$ 三. 解决方法:
. 采用shell脚本的进行解决;
. shell脚本如下:
inputCheckLine=`cat /proc/bus/input/devices | grep -n "Vendor=0eef" | grep "Product=0020 Version=0001"| awk -F: '{print $1}'`
touchEvent=`sed -n "$((${inputCheckLine}+5))p" /proc/bus/input/devices | grep -o "event."` 四. 实际应用:
......
while [ -z $touchEvent ]
do
inputCheckLine=`cat /proc/bus/input/devices | grep -n "Vendor=0eef" | grep "Product=0020 Version=0001"| awk -F: '{print $1}'`
touchEvent=`sed -n "$((${inputCheckLine}+5))p" /proc/bus/input/devices | grep -o "event."`
echo "please hang up USB TOUCH !"
usleep
done
......
export TSLIB_TSDEVICE=/dev/input/${touchEvent}
export QWS_MOUSE_PROTO=tslib:/dev/input/${touchEvent}
......
上一篇:关于c#中的Timer控件的简单用法


下一篇:MySQL的联结(Join)语法