Disable/Enable Touchpad

At work I use a very new lenovo laptop and I’m really stressed out of the touchpad. It is a really large one and a lot of times I write on the keyboard, I touch the touchpad, even if I don’t want to. So how can it be disabled for that time and enabled if I need it? First of all we need to know where this can be done. Therefore at Ubuntu/Debian there is a pretty cool tool called xinput — utility to configure and test X input devices — which can be used to disable/enable the touchpad.

To get a list of X input devices just run

$ xinput list

This will produce an ouput according to the following:

⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=10   [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                     id=11   [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)]
    ↳ Integrated Camera                         id=8    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=9    [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                    id=12   [slave  keyboard (3)]

Here you can see that the Touchpad has id 10.

To disable the Touchpad now, just type:

$ xinput set-prop 10 "Device Enabled" 0

And to enable it again:

$ xinput set-prop 10 "Device Enabled" 1

So, that’s it. Quite easy and saves a lot of nerves.

comments powered by Disqus