红联Linux门户
Linux帮助

linux下外接两块触摸屏的处理办法

发布时间:2017-06-05 11:19:08来源:linux网站作者:yuan_da_xian
Linux下外接两块触摸显示器时,不做任何处理的情况下,触摸A屏,可能会导致B屏响应,解决办法如下:
 
#!/bin/bash
MYID_FIRST=$1
MYID_SECOND=$2
OUT_PUT=$3
for I in $(xinput list --id-only)
do
CUR_FIRST=$(xinput list-props $I|grep "Device Product ID"|awk -F : '{print $2}'|awk -F , '{print $1}'|awk '{print $1}')
CUR_SECOND=$(xinput list-props $I|grep "Device Product ID"|awk -F : '{print $2}'|awk -F , '{print $2}'|awk '{print $1}')
if [ "$MYID_FIRST" == "$CUR_FIRST" ] && [ "$MYID_SECOND" == "$CUR_SECOND" ];
then
MY_INDEX=$I
break;
fi
done
xinput map-to-output $MY_INDEX $OUT_PUT
#xrandr 查看显示器端口(HDMI1和HDMI2参数)
#xinput 查看触摸屏id
#xinput list-props id 
#export DEVICE_NAME="Multi touch   Multi touch overlay device"
#./mxinput.sh 8238 6 HDMI2
#./mxinput.sh 1111 4282 HDMI1
 
本文永久更新地址:http://www.linuxdiyf.com/linux/31274.html