首页 技术 正文
技术 2022年11月20日
0 收藏 803 点赞 2,804 浏览 2010 个字
1. 查看有什么设备
xinput list

输出:

⎡ Virtual core pointer                        id=2    [master pointer  (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ PS/2 Logitech Wheel Mouse id=14 [slave pointer (2)]
⎜ ↳ USB OPTICAL MOUSE id=10 [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)]
↳ Sleep Button id=9 [slave keyboard (3)]
↳ USB2.0 HD UVC WebCam id=11 [slave keyboard (3)]
↳ Asus WMI hotkeys id=12 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=13 [slave keyboard (3)]

那么PS/2 Logitech Wheel Mouse就是我的触摸板了. 设备id=14.

2. 查看触摸板属性

xinput list-props 14 或者
xinput list-props 'PS/2 Logitech Wheel Mouse'

输出

Device 'PS/2 Logitech Wheel Mouse':
Device Enabled (136): 1
Coordinate Transformation Matrix (138): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Accel Profile (262): 0
Device Accel Constant Deceleration (263): 1.000000
Device Accel Adaptive Deceleration (264): 1.000000
Device Accel Velocity Scaling (265): 10.000000
Device Product ID (254): 2, 1
Device Node (255): "/dev/input/event4"
Evdev Axis Inversion (266): 0, 0
Evdev Axes Swap (268): 0
Axis Labels (269): "Rel X" (146), "Rel Y" (147)
Button Labels (270): "Button Left" (139), "Button Middle" (140), "Button Right" (141), "Button Wheel Up" (142), "Button Wheel Down" (143)
Evdev Middle Button Emulation (271): 0
Evdev Middle Button Timeout (272): 50
Evdev Third Button Emulation (273): 0
Evdev Third Button Emulation Timeout (274): 1000
Evdev Third Button Emulation Button (275): 3
Evdev Third Button Emulation Threshold (276): 20
Evdev Wheel Emulation (277): 0
Evdev Wheel Emulation Axes (278): 0, 0, 4, 5
Evdev Wheel Emulation Inertia (279): 10
Evdev Wheel Emulation Timeout (280): 200
Evdev Wheel Emulation Button (281): 4
Evdev Drag Lock Buttons (282): 0

看到 Device Enabled (136): 1 为启动.

3. 开关触摸板

#禁用触摸板
xinput set-prop 14 'Device Enabled' 0 #通过设备编号+属性名禁用触摸板
xinput set-prop 'PS/2 Logitech Wheel Mouse' 'Device Enabled' 0 #通过设备名+属性名禁用触摸板
#启用触摸板
xinput set-prop 14 136 1 #通过设备编号+属性编号来设置
xinput set-prop 'PS/2 Logitech Wheel Mouse' 136 1 #通过设备名+属性编号启用

参考文献: http://www.chenyudong.com/archives/lenovo-laptop-disable-or-enable-touchpad-using-xinput-in-ubuntu.html#i

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,078
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,553
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,402
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,177
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,814
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,898