ubuntu 关闭/打开触摸板功能

 1、先通过 xinput 查看一下有哪些输入设备,找出触摸板的名称,执行 xinput list  得出结果大致如下:

 

 

⎡ Virtual core pointer                     id=2 [master pointer  (3)]

⎜   ↳ Virtual core XTEST pointer               id=4 [slave  pointer  (2)]

⎜   ↳ Logitech USB Receiver                    id=11 [slave  pointer  (2)]

⎜   ↳ Logitech USB Receiver                    id=12 [slave  pointer  (2)]

⎜   ↳ SynPS/2 Synaptics TouchPad               id=14 [slave  pointer  (2)]

⎣ Virtual core keyboard                    id=3 [master keyboard (2)]

    ↳ Virtual core XTEST keyboard              id=5 [slave  keyboard (3)]

    ↳ Power Button                             id=6 [slave  keyboard (3)]

    ↳ Video Bus                                id=7 [slave  keyboard (3)]


从上面结果,可以看出触摸板名称为"SynPS/2 Synaptics TouchPad",id为14。
   
   2、再通过 xinput list-props 14 查看触摸板所有相关属性,结果大致如下:
Device 'SynPS/2 Synaptics TouchPad':
Device Enabled (132): 0
Coordinate Transformation Matrix (134): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Accel Profile (260): 1
Device Accel Constant Deceleration (261): 2.500000
Device Accel Adaptive Deceleration (262): 1.000000
Device Accel Velocity Scaling (263): 12.500000
Synaptics Edges (285): 1768, 5406, 1640, 4498
Synaptics Finger (286): 25, 30, 256
Synaptics Tap Time (287): 180
Synaptics Tap Move (288): 236
Synaptics Tap Durations (289): 180, 180, 100
其中“ Device Enabled (132) 就是用来控制是否开启的,值 0:代表禁用,1:代表启用。
     
    3、然后再通过 xinput set-prop 更改其属性值,如: xinput set-prop 'SynPS/2 Synaptics TouchPad' 'Device Enabled' 0,但如果每次都需要敲这么长的命令肯定是不可能的,我们可以通过在 ~/.bashrc文件中添加命令别名,如:     
        alias tpOff="xinput set-prop 'SynPS/2 Synaptics TouchPad' 'Device Enabled' 0"
        alias tpOn="xinput set-prop 'SynPS/2 Synaptics TouchPad' 'Device Enabled' 1"
成功添加之后,再执行 source ~/.bashrc ,就可以通过 tpOff 、tpOn灵活设置了
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值