CentOS 6.4 uses script to disable the touchpad.

  

The touchpad is the mobile cursor-enabled device on the notebook. It usually has a shortcut key to enable or disable it quickly. In CentOS 6.4, scripts can be used automatically. Close the touchpad, the following small series will introduce you to how CentOS6.4 uses the script to disable the touchpad, let's learn together.

Method:

1. Check whether xorg-x11-app installed;

rpm -qa xorg-x11-apps

If there is no Installation Use the following command to install xorg-x11-app

yum install xorg-x11-apps

2. View the input devices available in graphics mode

xinput list

My computer displays the following results

[root@reage input]# xinput list

⎡ Virtual core pointer id=2 [master pointer (3)]

⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]

⎜ ↳ Macintosh mouse button emulation id=14 [slave pointer (2)]

⎜ ↳ SIGMACHIP Usb Mouse id=15 [slave pointer (2)]

⎜ ↳ ImPS/2 Logitech Wheel Mouse id=13 [slave pointer (2)]

⎣ Virtual core keyboard id=3 [ Master keyboard (2)]

↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]

↳ Asus Laptop extra buttons i d=6 [slave keyboard (3)]

↳ AT Translated Set 2 keyboard id=7 [slave keyboard (3)]

↳ Lid Switch id=8 [slave keyboard (3) ]

↳ USB 2.0 Camera id=9 [slave keyboard (3)]

↳ Sleep Button id=10 [slave keyboard (3)]

↳ Video Bus id =11 [slave keyboard (3)]

↳ Power Button id=12 [slave keyboard (3)]

3. Find the device corresponding to the touchpad

Different touch devices may have different names, but generally the touchpad is a PS/2 device. Therefore, PS/2 and touchpad characters may appear in the name of the touchpad. If you can't find all the device ids in the Virtual core pointer, use the xinput --set-prop device's id “Device Enabled” 0 to execute them. After sliding, the touchpad is displayed to see if the touchpad is available. Indicates that the device corresponding to the touchpad has been found. Then use the idput-set-prop device id “Device Enabled” 1, to enable all non-touchpad input devices in turn.

4. Write scripts that automatically disable the touchpad

Create touchpad.sh

vim touchpad.sh

Enter the content

#! /bin/bash

if [ “$1” = “on” ] | |  [ “$1” = “1” ]

then

xinput --set-prop 13 “Device Enabled” 1

echo “open”< Br>

elif [ “$1” = “off” ] | |  [ “$1” = “0” ]

then

xinput --set-prop 13 “Device Enabled& rdquo; 0

echo “close”< Br>

else

echo “Please enter the correct parameters: on/off, 0/1. ”

Echo “ Turn on the touchpad sh touchpad on or sh touchpad 1. ”

echo “ Turn off the touchpad sh touchpad off or sh touchpad 0”;

fi

The above is the way CentOS6.4 uses the script to close the touchpad Introduced, although it is a bit more troublesome than the shortcut, if the shortcut fails, the method will come in handy.

Copyright © Windows knowledge All Rights Reserved