Enable and disable touchpad for CentOS

Source: Internet
Author: User
I don't know what others are doing. I have to disable the touchpad for typing in my notebook. Otherwise, the cursor must be flying. Windowns said that there are usually touchpad management programs on the official website, so it is easy to close and enable it, but this small function is not so easy to implement in linux. After reading online tutorials, many users edit and edit the xorg. conf file, and then synclienttouchpadoff = 1/synclienttouchpadoff = 0 to implement it.

I don't know what others are doing. I have to disable the touchpad for typing in my notebook. Otherwise, the cursor must be flying. Windowns said that there are usually touchpad management programs on the official website, so it is easy to close and enable it, but this small function is not so easy to implement in linux.

After reading online tutorials, many users edit and edit xorg. conf file, and then synclient touchpadoff = 1/synclient touchpadoff = 0 to implement it. I also did this on Dell, but this method is less universal, I haven't completed the configuration for half a day in my friend's Lenovo book, and I have also done the same for Asus.

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

1. yum install xorg-x11-apps

2. xinput-list

This command is used to view toucpad IDs, for example:

 

The figure shows that the ID of the TouchPad is 14, so you can enable and disable it by using the following command:

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 implement it:

#! /Bin/bash
# Echo "========================================"
# Echo "============= touchpad management program ============"
If [$1 = 'on']
Then
Xinput set-int-prop 6 "Device Enabled" 8 1
Echo "TouchPad enabled successfully! "
Elif [$1 = 'off']
Then
Xinput set-int-prop 6 "Device Enabled" 8 0
Echo "the TouchPad is disabled successfully! "
Else
Echo "Enter the parameter: on/off"
Echo "for example, enable the TouchPad: chumoban on"
Fi

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

Script Source: http://blog.sina.com.cn/s/blog_60d705b10100yy93.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.