Ubuntu disables and enables the touch pad of a Lenovo notebook via XInput

Source: Internet
Author: User
Tags lenovo

View Device List

See what devices are available through XInput first

XInput #或者 xinput List

The results are shown below

[Email protected]:~$ xinput List
Virtual core pointer id=2 [master pointer (3)]

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

? MLK rapoo 1800 id=11 [slave pointer (2)]

? ETPS/2 Elantech Touchpad id=14 [slave pointer (2)]

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

? Virtual Core XTEST keyboard id=5 [slave keyboard (3)]

? Power Button id=6 [slave keyboard (3)]

? Video Bus id=7 [slave keyboard (3)]

? Video Bus id=8 [slave keyboard (3)]

? Sleep Button id=9 [slave keyboard (3)]

? MLK rapoo 1800 id=10 [slave keyboard (3)]

? Lenovo Easycamera id=12 [slave keyboard (3)]

? At translated Set 2 keyboard id=13 [slave keyboard (3)]

? Ideapad extra buttons id=15 [slave keyboard (3)]

One of the ETPS/2 Elantech Touchpad is my notebook's touchpad, where id=14 is the number of the device. The two are equivalent.
Viewing device properties

XInput List-props 14

XInput list-props ' etps/2 elantech Touchpad '

The results of the display are as follows: (not all, just to show what the content is about)

[Email protected]:~$ xinput list-props ' etps/2 elantech Touchpad '

Device ' Etps/2 Elantech Touchpad ':

Device Enabled (132): 1

Device Accel Profile (259): 1

Device Accel Velocity Scaling (262): 12.500000

Synaptics Edges (282): 56, 1352, 34, 606

Synaptics Finger (283): 1, 1, 256

Synaptics Tap Time (284): 180

Synaptics Tap Move (285): 68

Device Product ID (249): 2, 14

Device Node: "/dev/input/event7"

A property device enabled indicates whether the device is disabled or enabled, 1 means enabled, and 0 disables. The other 132 in parentheses also indicates device Enabled, which is equivalent. The device name and device ID mentioned above are also equivalent.
Disable, enable Touchpad

Used Set-porp to set the properties of the device.

XInput set-prop ' Device Enabled ' 0 #通过设备编号 + property name Disable Touchpad
XInput set-prop ' etps/2 elantech Touchpad ' Device Enabled ' 0 #通过设备名 + property name Disable Touchpad
XInput Set-prop 1 #通过设备编号 + property number to set
XInput set-prop ' etps/2 elantech Touchpad ' 1 #通过设备名 + property number enabled

Just said in My computer etps/2 Elantech Touchpad and 14 are equivalent, Device enabled and 132 are equivalent, so the two can be substituted, so the time to knock the command can be lazy. But looking at it like this is more intuitive what this command is all about.

XInput set-prop ' etps/2 elantech Touchpad ' Device Enabled ' 0

Quickly enable and disable the touchpad through scripting

It is troublesome to knock commands every time, and the script will switch quickly.

if [= = ' on ']
Set-prop ' etps/2 elantech Touchpad ' Device Enabled ' 1
echo "Touchpad turned on successfully! "
elif [= = ' off ']
Set-prop ' etps/2 elantech Touchpad ' Device Enabled ' 0
echo "Touchpad off successfully! "
echo "Please input parameters: On/Off"
echo "Turn on Touchpad: Touchpadenable on"
echo "Disable Touchpad: Touchpadenable off"

By disabling the touchpad, it really solves a lot of trouble for me.
Auto Disable touchpad on boot

But this after the boot restart and resumed, for some students like to shut down rather than sleep students do also have to improve, is to let the power on the automatic operation to disable the Touch Pad command.
Under ~/.config/autostart/, create a launcher Xinput.desktop file that reads as follows

[Desktop Entry]
Exec=xinput set-prop ' etps/2 elantech Touchpad ' Device Enabled ' 0
Name[zh_cn]=touchpad Enable
Name=touchpad Enable
comment[zh_cn]= Disabling the Touchpad
comment= Disabling the Touchpad

This will automatically disable the touchpad at boot time.

The bad place is the original through the Fn+f8 disabled touchpad when there is light, and now not light, the better way is to disable the touchpad by scripting Fn+f8.

Ubuntu disables and enables the touch pad of a Lenovo notebook via XInput

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.