7

The right button on my kid's acer v5 is broken. It got wet with milk and now it suddenly appears to keep pressed.

How can I deactivate the buttons at all to only work with the touchpad?

I have OpenSUSE 13.1 with KDE.

1 Answer 1

10

Most touchpads can be manipulated with the command line tools synclient and xinput. You can read more about both of these command line tools here in the ArchLinux wiki:

Of the 2 tools, I do not believe you can disable the uttons using synclient. You may be able to do so using xinput. Of the 2 tools, this is the more cumbersome one to use, but it's not overly difficult.

If you run it with the -h switch you'll get the following usage info:

$ xinput -h
usage :
    xinput get-feedbacks <device name>
    xinput set-ptr-feedback <device name> <threshold> <num> <denom>
    xinput set-integer-feedback <device name> <feedback id> <value>
    xinput get-button-map <device name>
    xinput set-button-map <device name> <map button 1> [<map button 2> [...]]
    xinput set-pointer <device name> [<x index> <y index>]
    xinput set-mode <device name> ABSOLUTE|RELATIVE
    xinput list [--short || --long || --name-only || --id-only] [<device name>...]
    xinput query-state <device name>
    xinput test [-proximity] <device name>
    xinput create-master <id> [<sendCore (dflt:1)>] [<enable (dflt:1)>]
    xinput remove-master <id> [Floating|AttachToMaster (dflt:Floating)] [<returnPointer>] [<returnKeyboard>]
    xinput reattach <id> <master>
    xinput float <id>
    xinput set-cp <window> <device>
    xinput test-xi2 <device>
    xinput map-to-output <device> <output name>
    xinput list-props <device> [<device> ...]
    xinput set-int-prop <device> <property> <format (8, 16, 32)> <val> [<val> ...]
    xinput set-float-prop <device> <property> <val> [<val> ...]
    xinput set-atom-prop <device> <property> <val> [<val> ...]
    xinput watch-props <device>
    xinput delete-prop <device> <property>
    xinput set-prop <device> [--type=atom|float|int] [--format=8|16|32] <property> <val> [<val> ...]
    xinput disable <device>
    xinput enable <device>

I would start with the options whose names include the text "button".

$ xinput -h 2>&1 | grep button
    xinput get-button-map <device name>
    xinput set-button-map <device name> <map button 1> [<map button 2> [...]]

You'll need the device's name in order to query it. For that you'll use xinput list.

Example

$ xinput list
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Logitech Unifying Device. Wireless PID:4013   id=9    [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=11   [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                     id=12   [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)]
    ↳ Sleep Button                              id=8    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=10   [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                    id=13   [slave  keyboard (3)]

It's typically "SynPS/2 Synaptics TouchPad" this device handle, but may vary for your particular hardware.

$ xinput get-button-map "SynPS/2 Synaptics TouchPad"
1 2 3 4 5 6 7 8 9 10 11 12 

These are all the "buttons" that are specified for my Thinkpad T410 laptop's touchpad. Any corners and such on the touchpad are also considered "buttons", that's why there are so many in the above output. You can find out more about which buttons are which number in the above list using the --long switch.

Example

$ xinput list --long "SynPS/2 Synaptics TouchPad" 
...
⎜   ↳ SynPS/2 Synaptics TouchPad                id=11   [slave  pointer  (2)]
    Reporting 8 classes:
        Class originated from: 11. Type: XIButtonClass
        Buttons supported: 12
        Button labels: "Button Left" "Button Middle" "Button Right" "Button Wheel Up" "Button Wheel Down" "Button Horiz Wheel Left" "Button Horiz Wheel Right" None None None None None
        Button state:
        Class originated from: 11. Type: XIValuatorClass
        Detail for Valuator 0:
          Label: Rel X
          Range: 1472.000000 - 5888.000000
          Resolution: 75000 units/m
          Mode: relative
        Class originated from: 11. Type: XIValuatorClass
        Detail for Valuator 1:
          Label: Rel Y
          Range: 1408.000000 - 4820.000000
          Resolution: 105000 units/m
          Mode: relative
        Class originated from: 11. Type: XIValuatorClass
        Detail for Valuator 2:
          Label: Rel Horiz Scroll
          Range: 0.000000 - -1.000000
          Resolution: 0 units/m
          Mode: relative
        Class originated from: 11. Type: XIValuatorClass
        Detail for Valuator 3:
          Label: Rel Vert Scroll
          Range: 0.000000 - -1.000000
          Resolution: 0 units/m
          Mode: relative
    ...

OK that's great, but how do I disable a button?

If you take a look at the man page for xinput you'll see the following clue:

$ man xinput
...
   --set-button-map device map_button_1 [map_button_2 [...]]
        Change the button mapping of device. The buttons are specified 
        in physical order (starting with button 1) and  are  mapped  to
        the logical button provided. 0 disables a button. The default 
        button mapping for a device is 1 2 3 4 5 6 etc.
...

So if you take note of which button is the one that you want to disable using the xinput list --long "SynPS/2 Synaptics TouchPad", you could do the following, if say you wanted to disable button #5.

$ xinput set-button-map "SynPS/2 Synaptics TouchPad" 1 2 3 4 0 6 7 8 9 10 11 12

NOTE: In the above example, "SynPS/2 Synaptics TouchPad" can also be replaced by 11, as that is the ID of this particular input, so this is the same as above:

$ xinput set-button-map 11 1 2 3 4 0 6 7 8 9 10 11 12

Tip on device names

In the output of xinput list you may have noticed a column with the strings id=#.

$ xinput list
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Logitech Unifying Device. Wireless PID:4013   id=9    [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=11   [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                     id=12   [slave  pointer  (2)]

Those IDs can be used instead of the long annoying string: "SynPS/2 Synaptics TouchPad".

$ xinput list-props 11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.