Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to disable and open the touchpad in CentOS

Shulou Source: shulou.com Published: 2022-06-01 17:40:11 10月19日 Update

This article is about how to disable and open the touchpad in CentOS. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

I don't know about others. Anyway, when I type on my notebook, I must disable the touchpad, otherwise it must be the cursor flying around. It is easy to say under Windowns that officials generally have a touchpad management program, which can be turned off and turned on easily, but this small function is not so easy to achieve in linux.

Look at the online tutorials, many netizens edit xorg.conf text, and then synclient touchpadoff=1/synclient touchpadoff=0 to achieve it. I also did this on the Dell I used before, but the versatility of this method is not so good. I haven't been able to configure it for a long time in my friend's association book, and so is my Asustek.

In contrast, I feel that the following method is more universal.

1.yum install xorg-x11-apps

2.xinput-list

This command looks at the ID of toucpad, as shown below:

You can see from the picture that my original touchpad ID is 14, so you can turn it on and off with the following command:

Prohibit touchpad:xinput set-int-prop 14 "Device Enabled" 8 0

Open touchpad:xinput set-int-prop 14 "Device Enabled" 8 1

You can also write a script to do this:

#! / bin/bash

# echo "="

# echo "= touchpad hypervisor ="

If [$1 = = 'on']

Then

Xinput set-int-prop 6 "Device Enabled" 8 1

Echo "touchpad opened 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 "such as opening the touchpad: chumoban on"

Fi

In addition to Centos, this method is also applicable to Linux distributions such as Ubuntu and Deban.

Thank you for reading! This is the end of the article on "how to disable and open the touchpad in CentOS". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Tags: Success content commands methods more programs articles generality management good practical cursors functions parameters can be passed official feeling tutorials articles friends Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info OPPO Reno Linux Shulou Information Microsoft