烦死我了,欠揍的触摸板......
用笔记本时经常不小心碰到触摸屏从而导致光标乱跑
方法一:
很简单,输入sudo modprobe -r psmouse
即可
如果想打开的话, 将-r
去掉即可。
当然也可以用最近学的bash
写个文件,然后每次交互式的开关触摸屏。
你可以用vim ~/psmouse
进行别写,只需要在psmouse
中写入如下代码(当然可以直接复制粘贴)然后保存退出,以后直接./psmouse
来运行。
代码:
echo ""
echo ""
read -p "开启或关闭触摸板?(开启/关闭)(y/n):" yn
if [ "$yn" = "y" ] || [ "$yn" = "Y" ]
then
sudo modprobe psmouse
echo "触摸板已经开启"
echo ""
echo ""
elif [ "$yn" = "n" ] || [ "$yn" = "N" ]
then
sudo modprobe -r psmouse
echo "触摸板已经关闭"
echo ""
echo ""
fi
方法二:
查看已近启用的设备:xinput list
jack@jack-W65KJ1-KK1:~ $ xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ PixArt Gaming Mouse Consumer Control id=12 [slave pointer (2)]
⎜ ↳ PixArt Gaming Mouse id=16 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=17 [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)]
↳ Power Button id=9 [slave keyboard (3)]
↳ Sleep Button id=10 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=15 [slave keyboard (3)]
↳ BisonCam,NB Pro: BisonCam,NB Pr id=14 [slave keyboard (3)]
↳ Video Bus id=8 [slave keyboard (3)]
↳ PixArt Gaming Mouse Keyboard id=11 [slave keyboard (3)]
↳ PixArt Gaming Mouse Consumer Control id=13 [slave keyboard (3)]
眼花缭乱对吧,你把自己的鼠标拔了试试:
jack@jack-W65KJ1-KK1:~ $ xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=17 [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)]
↳ Power Button id=9 [slave keyboard (3)]
↳ Sleep Button id=10 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=15 [slave keyboard (3)]
↳ BisonCam,NB Pro: BisonCam,NB Pr id=14 [slave keyboard (3)]
↳ Video Bus id=8 [slave keyboard (3)]
少了几个......
其实咱们都知道,触摸板是这一行:
⎜ ↳ SynPS/2 Synaptics TouchPad id=17 [slave pointer (2)]
可以输入xinput -h
看一下用法
使用xinput disable 17
来禁用触摸板
使用xinput enable 17
来开启触摸板
即:xinput disable/enable <device>(此处是该设备的id)
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。