Home > System Tutorial > LINUX > body text

How to disable and enable CentOS touchpad

WBOY
Release: 2024-01-02 15:58:01
forward
953 people have browsed it

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:

How to disable and enable CentOS touchpad

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!

Related labels:
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!