centos 6.5 关闭触控板

1. 检查是否安装xorg-x11-app;

  rpm -qa xorg-x11-apps
    如果没有安装使用下面命令安装xorg-x11-app
 
    yum install xorg-x11-apps
2.查看在图形模式下可用的输入设备
  
   xinput list
   我的电脑显示的是如下结果
 
[root@reage input]# xinput list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ Macintosh mouse button emulation        	id=14	[slave  pointer  (2)]
⎜   ↳ SIGMACHIP Usb Mouse                     	id=15	[slave  pointer  (2)]
⎜   ↳ ImPS/2 Logitech Wheel Mouse             	id=13	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Asus Laptop extra buttons               	id=6	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=7	[slave  keyboard (3)]
    ↳ Lid Switch                              	id=8	[slave  keyboard (3)]
    ↳ USB 2.0 Camera                          	id=9	[slave  keyboard (3)]
    ↳ Sleep Button                            	id=10	[slave  keyboard (3)]
    ↳ Video Bus                               	id=11	[slave  keyboard (3)]
    ↳ Power Button                            	id=12	[slave  keyboard (3)]
3.查找触控板对应的设备好
    不同的触控设备可能名字不同,但是一般触控板都是一个PS/2设备。所以在触控板的名字中可能会出现PS/2、touchpad字样。如果都找不到可以将Virtual core pointer 中的所有的设备id使用 xinput --set-prop 设备的id "Device Enabled" 0 依次执行,执行后滑动触控板看触控板是否可用,不可用表示已经找到,触控板对应的设备。然后使用xinput --set-prop 设备的id "Device Enabled" 1,将所有非触控板的输入设备依次启用。
4.书写自动禁用触控板的脚本

建立touchpad.sh

  vim touchpad.sh

输入一下内容

#!/bin/bash
if [ "$1" = "on" ] || [ "$1" = "1" ]
then
        xinput --set-prop 13 "Device Enabled" 1
        echo "open"
elif [ "$1" = "off" ] || [ "$1" = "0" ]
then
        xinput --set-prop 13 "Device Enabled" 0
        echo "close"
else
        echo "请输入正确的参数:on/off 、0/1。"
        echo "开启触控板sh touchpad on或者sh touchpad 1。"
        echo "关闭触控板sh touchpad off或者sh touchpad 0";
fi

开启  :   sh touchpad.sh on    or   sh touchpad.sh 1

关闭   :  sh touchpad.sh off    or   sh touchpad.sh 0

设备的id又可能改变。在关闭打开触控板不成时,可以查看设备ID是否改变了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值