2

When I'm typing in LibreOffice I keep accidentally bumping the trackpad. Is there a way I can temporarily disable the trackpad with a keyboard shortcut while I'm typing? (I understand there is an option to disable the mouse when typing but when I nudge the trackpad it gets back on anyway.)

rajlego
  • 833
  • 2
  • 11
  • 36

1 Answers1

1

Here is how to turn the touchpad off and on.

Run xinput from your terminal. When I do so, for my laptop, I see this:

$ xinput
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ PixArt USB Optical Mouse                  id=10   [slave  pointer  (2)]
⎜   ↳ PS/2 Mouse                                id=13   [slave  pointer  (2)]
⎜   ↳ AlpsPS/2 ALPS GlidePoint                  id=12   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Video Bus                                 id=6    [slave  keyboard (3)]
    ↳ Power Button                              id=7    [slave  keyboard (3)]
    ↳ Sleep Button                              id=8    [slave  keyboard (3)]
    ↳ Integrated_Webcam_1.3M                    id=9    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=11   [slave  keyboard (3)]
    ↳ Dell WMI hotkeys                          id=14   [slave  keyboard (3)]
$ 

The trackpad here is AlpsPS/2 ALPS GlidePoint with a device id of 12. You'll need to figure out what is what on your system.

To disable this device within this particular current session, I'll run:

xinput --disable 12

To enable it, I'll run:

xinput --enable 12

But if I want to have code I can safely use even after a reboot I would use the device name itself.

So, one can use:

xinput --disable 'AlpsPS/2 ALPS GlidePoint'

and

xinput --enable 'AlpsPS/2 ALPS GlidePoint'

The single quotes are important!

How you actually make these keyboard shortcuts depends on the desktop environment you are using and what keys are free on your system for the purpose. You need to make sure they won't be needed for other purposes.

DK Bose
  • 42,548
  • 23
  • 127
  • 221