ubuntu12.04 禁止鼠标触摸板
来源:互联网 发布:互联网流量监控软件 编辑:程序博客网 时间:2024/05/07 03:03
国庆节刚入手了一台新机器,装上ubuntu 12.04之后,发现禁止鼠标触摸板很是不爽,因为每次都需要按FN+F6来禁止,而且每次在重启之后又会重新启用,为了可以方便的关闭与启用,最后发现可以通过xinput来实现。
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灵活设置了,但每次都执行一次tpOff也不是很方便,可不可以在一开机就就自动禁用呢?当然是可以的,我们可以在 ~/.config/autostart/下新增一个xinput.desktop文件即可,内容如下:
[Desktop Entry]
Type=Application
Exec=xinput set-prop 'SynPS/2 Synaptics TouchPad' 'Device Enabled' 0
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[zh_CN]=touchpad enable
Name=touchpad enable
Comment[zh_CN]=禁用触摸板
Comment=禁用触摸板
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灵活设置了,但每次都执行一次tpOff也不是很方便,可不可以在一开机就就自动禁用呢?当然是可以的,我们可以在 ~/.config/autostart/下新增一个xinput.desktop文件即可,内容如下:
[Desktop Entry]
Type=Application
Exec=xinput set-prop 'SynPS/2 Synaptics TouchPad' 'Device Enabled' 0
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[zh_CN]=touchpad enable
Name=touchpad enable
Comment[zh_CN]=禁用触摸板
Comment=禁用触摸板
0 0
- ubuntu12.04 禁止鼠标触摸板
- ubuntu12.04 实现插入鼠标时自动使触摸板失效
- Ubuntu12.04如何禁用触摸板
- ubuntu12.04 不识别触摸板
- Ubuntu12.04禁用触摸板的方法
- ubuntu 禁止触摸板
- Ubuntu 禁止触摸板
- UBUNTU禁止触摸板
- [ubuntu] ubuntu12.04 下禁用触摸板的 方法
- ubuntu12.04 解决触摸板无法使用问题
- Ubuntu12.04下触摸板(Synaptics Touchpad)失灵解决方法
- Ubuntu11.10 禁止触摸板
- ubuntu 禁止 笔记本触摸板
- win7禁止使用触摸板
- 禁止 DELL E5420 触摸板的方法
- Dell E5420 Win7禁止触摸板
- linux下开启-禁止笔记本触摸板
- Ubuntu12.04通过xinput禁用及启用联想笔记本的触摸板
- Codeforces #228 D2D / D1B:Fox and Minimal path
- linux c/c++ 聊天小程序代码示例 (使用socket 和 IO 多路复用技术)
- 零值比较
- typedef和#define的用法与区别
- windows下如何提高程序启动速度
- ubuntu12.04 禁止鼠标触摸板
- Android基于XMPP Smack Openfire下学习开发IM(二)对分组、好友和头像等一些操作
- Uml总结
- jvm内存机制总结篇
- 主成分分析(Principal components analysis)-最大方差解释
- 联想Q3净利润2.66亿美元 同比增长29.5%
- Android基于XMPP Smack Openfire下学习开发IM(三)会议室创建、加入以及查询会议室中所有成员等
- ubuntu12.04 64bits 安装 Atheros AR8161 有线网卡驱动的解决方法
- 四大因素决定 浅析iOS为什么比安卓流畅