在Linux系统中关闭触摸板
2014-05-04 13:43
337 查看
0x01 用xinput关闭触摸板
Ubuntu对笔记本的支持已经做的很到位了,但是还是会有些这样那样的问题。比如说我这款 Dell 14TR-4528 ,就不能关闭触摸板。这样在打字的时候就会很捉急,于是我想了个办法关闭触摸板。
我们需要xinput这个工具,可以从源安装。安装之后在终端输入xinput,就会出现当前的x设备列表。
可以看到有几个mouse,找到你想禁用的设备,然后就可以
例如我的:
这样就可以看到这个设备的属性了,找到 Device Node 这一行,上面写着 "/dev/input/event8"。
既然他都这么写了,那就去 /dev/input 这个目录里,看看确实有event8这个东西,用管理员权限cat它,动动触摸板,看看有没有动静。如果是你找的设备,就会出现好多乱码。如果没反映就换一个试试,找到为止。
0x03 更方便地开关触摸板
这个脚本会检测你的触摸板是否已经开启,如果开启了就关闭,关闭了就开启。
不过你要改改DeviceName这个变量,把它改成自己的设备名字。
Ubuntu对笔记本的支持已经做的很到位了,但是还是会有些这样那样的问题。比如说我这款 Dell 14TR-4528 ,就不能关闭触摸板。这样在打字的时候就会很捉急,于是我想了个办法关闭触摸板。
我们需要xinput这个工具,可以从源安装。安装之后在终端输入xinput,就会出现当前的x设备列表。
james@james-PC ~ % xinput ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ USB Mouse id=11 [slave pointer (2)] ⎜ ↳ USB Mouse id=12 [slave pointer (2)] ⎜ ↳ PS/2 Generic Mouse id=15 [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)] ↳ Video Bus id=8 [slave keyboard (3)] ↳ Power Button id=9 [slave keyboard (3)] ↳ Sleep Button id=10 [slave keyboard (3)] ↳ Laptop_Integrated_Webcam_HD id=13 [slave keyboard (3)] ↳ AT Translated Set 2 keyboard id=14 [slave keyboard (3)] ↳ Dell WMI hotkeys id=16 [slave keyboard (3)]
可以看到有几个mouse,找到你想禁用的设备,然后就可以
xinput disable [Device Name]
例如我的:
xinput disable "PS/2 Generic Mouse"
0x02 怎么找到要关闭的设备呢
用下面的命令:james@james-PC ~ % xinput list-props "PS/2 Generic Mouse" Device 'PS/2 Generic Mouse': Device Enabled (135): 0 Coordinate Transformation Matrix (137): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 Device Accel Profile (265): 0 Device Accel Constant Deceleration (266): 1.000000 Device Accel Adaptive Deceleration (267): 1.000000 Device Accel Velocity Scaling (268): 10.000000 Device Product ID (254): 2, 1 Device Node (255): "/dev/input/event8" Evdev Axis Inversion (269): 0, 0 Evdev Axes Swap (271): 0 Axis Labels (272): "Rel X" (145), "Rel Y" (146) Button Labels (273): "Button Left" (138), "Button Middle" (139), "Button Right" (140), "Button Wheel Up" (141), "Button Wheel Down" (142) Evdev Middle Button Emulation (274): 0 Evdev Middle Button Timeout (275): 50 Evdev Third Button Emulation (276): 0 Evdev Third Button Emulation Timeout (277): 1000 Evdev Third Button Emulation Button (278): 3 Evdev Third Button Emulation Threshold (279): 20 Evdev Wheel Emulation (280): 0 Evdev Wheel Emulation Axes (281): 0, 0, 4, 5 Evdev Wheel Emulation Inertia (282): 10 Evdev Wheel Emulation Timeout (283): 200 Evdev Wheel Emulation Button (284): 4 Evdev Drag Lock Buttons (285): 0
这样就可以看到这个设备的属性了,找到 Device Node 这一行,上面写着 "/dev/input/event8"。
既然他都这么写了,那就去 /dev/input 这个目录里,看看确实有event8这个东西,用管理员权限cat它,动动触摸板,看看有没有动静。如果是你找的设备,就会出现好多乱码。如果没反映就换一个试试,找到为止。
sudo cat /dev/input/event8
0x03 更方便地开关触摸板
#!/bin/bash DeviceName="PS/2 Generic Mouse" statu=$(xinput list-props "$DeviceName" | grep "Device Enabled" | awk '{print $4}') if [ $statu == 1 ] ; then xinput disable "$DeviceName" else xinput enable "$DeviceName" fi
这个脚本会检测你的触摸板是否已经开启,如果开启了就关闭,关闭了就开启。
不过你要改改DeviceName这个变量,把它改成自己的设备名字。
相关文章推荐
- Linux系统关闭笔记本触摸板的方法
- linux系统关闭开启触摸鼠标
- linux系统中Oracle数据库异常关闭重启
- 教你关闭Linux下不必要的系统服务
- Linux下chkconfig命令详解即添加服务以及两种方式启动关闭系统服务
- 常见Linux系统优化方法,关闭不必要的服务
- Linux系统上启用/禁用触摸板
- 如何在Linux关闭前向其他系统用户发送自定义消息
- Linux中利用shutdown命令关闭系统方法
- linux系统关闭禁用防火墙
- linux增加快捷键打开或关闭触摸板
- linux系统关闭不需要的服务
- linux系统服务优化--关闭无用的服务
- Linux系统引导和系统关闭
- Linux系统下Oracle数据库的安装和启动关闭操作教程
- Linux系统上启用/禁用触摸板
- linux重启和关闭系统命令
- Linux系统关闭防火墙
- Linux下Ubuntu关闭触摸板(TinkPad)
- 安装linux系统后,笔记本触摸板,那些让人蛋疼的事!