I don’t know about others, but I have to disable the touchpad when typing on my laptop, otherwise the cursor will fly around. Fortunately, under Windowns, the official generally has a touchpad management program, and it is easy to turn it off and on. However, under Linux, this small function is not so easy to implement.
Looking at online tutorials, many netizens implement it by editing the xorg.conf file, and then synclient touchpadoff=1/synclient touchpadoff=0. I also did this on the Dell I used before, but this method is not universal. So good, I couldn't finish the configuration on my friend's Lenovo laptop for a long time, and the same goes for my Asus.
In comparison, I feel that the following method is more versatile.
1.yum install xorg-x11-apps
2.xinput –list
This command is to check the touchpad ID, as shown below:
As you can see from the picture, my notebook touchpad ID is 14, so I can turn it on and off through the following commands:
Disable touchpad: xinput set-int-prop 14 "Device Enabled" 8 0
Enable touchpad: xinput set-int-prop 14 "Device Enabled" 8 1
You can also write a script to achieve this:
#!/bin/bash
#echo "==================================="
#echo "============Touchpad Manager============"
if [ $1 == 'on' ]
then
xinput set-int-prop 6 "Device Enabled" 8 1
echo "Touchpad turned on successfully!"
elif [ $1 == 'off' ]
then
xinput set-int-prop 6 "Device Enabled" 8 0
echo "Touchpad closed successfully!"
else
echo "Please enter parameters: on/off"
echo "For example, turn on the touchpad: chumoban on"
fi
In addition to Centos, this method is also applicable to Linux distributions such as Ubuntu and Deban.
The above is the detailed content of How to disable and enable CentOS touchpad. For more information, please follow other related articles on the PHP Chinese website!