Want left and right mouse buttons to both map to select

In Ubuntu 12.04 my Asus N56DP mapped both the right and left mouse buttons to be select, or left mouse button. To get a right click or context menu, I would use a two finger click. I quickly got used to this.

That all changed with 12.10 and later. I am now on Ubuntu 13.10. Now lmb is select and rmb is context menu.

Note this is one of those clickpad trackpads with two buttons underneath it. But physically the buttons are not separate, they are hidden under the trackpad. I now hate the right / left mouse button behavior. With no physical context clues you never know which button you're actually clicking anymore.

I'd like the old 12.04 functionality of treating this like a single button trackpad back, but can't figure out how to do it. All the research I've done so far shows how to re-order the buttons on a device but not how to reassign them in such a way that rmb and lmb are the same.

recap: I want lmb and rmb to initiate select. I want two finger click to initiate context menu.

    xinput --list
 Virtual core pointer                       id=2    [master pointer  (3)]
   ↳ Virtual core XTEST pointer                 id=4    [slave  pointer  (2)]
   ↳ ETPS/2 Elantech Touchpad                   id=14   [slave  pointer  (2)]


xinput --list-props "ETPS/2 Elantech Touchpad"
Device 'ETPS/2 Elantech Touchpad':
    Device Enabled (144):   1
    Coordinate Transformation Matrix (146): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    Device Accel Profile (267): 1
    Device Accel Constant Deceleration (268):   2.500000
    Device Accel Adaptive Deceleration (269):   1.000000
    Device Accel Velocity Scaling (270):    12.500000
    Synaptics Edges (271):  136, 3284, 110, 1942
    Synaptics Finger (272): 1, 1, 0
    Synaptics Tap Time (273):   180
    Synaptics Tap Move (274):   175
    Synaptics Tap Durations (275):  180, 180, 100
    Synaptics ClickPad (276):   1
    Synaptics Middle Button Timeout (277):  0
    Synaptics Two-Finger Pressure (278):    282
    Synaptics Two-Finger Width (279):   7
    Synaptics Scrolling Distance (280): 79, 79
    Synaptics Edge Scrolling (281): 0, 0, 0
    Synaptics Two-Finger Scrolling (282):   1, 1
    Synaptics Move Speed (283): 1.000000, 1.750000, 0.050150, 0.000000
    Synaptics Off (284):    0
    Synaptics Locked Drags (285):   0
    Synaptics Locked Drags Timeout (286):   5000
    Synaptics Tap Action (287): 2, 3, 0, 0, 1, 3, 0
    Synaptics Click Action (288):   1, 3, 0
    Synaptics Circular Scrolling (289): 0
    Synaptics Circular Scrolling Distance (290):    0.100000
    Synaptics Circular Scrolling Trigger (291): 0
    Synaptics Palm Detection (292): 0
    Synaptics Palm Dimensions (293):    10, 200
    Synaptics Coasting Speed (294): 20.000000, 50.000000
    Synaptics Pressure Motion (295):    30, 160
    Synaptics Pressure Motion Factor (296): 1.000000, 1.000000
    Synaptics Resolution Detect (297):  1
    Synaptics Grab Event Device (298):  1
    Synaptics Gestures (299):   1
    Synaptics Capabilities (300):   1, 0, 0, 1, 1, 1, 1
    Synaptics Pad Resolution (301): 31, 31
    Synaptics Area (302):   0, 0, 0, 0
    Synaptics Soft Button Areas (303):  1710, 0, 1682, 0, 0, 0, 0, 0
    Synaptics Noise Cancellation (304): 19, 19
    Device Product ID (260):    2, 14
    Device Node (261):  "/dev/input/event7"

synclient -l
Parameter settings:
    LeftEdge                = 136
    RightEdge               = 3284
    TopEdge                 = 110
    BottomEdge              = 1942
    FingerLow               = 1
    FingerHigh              = 1
    MaxTapTime              = 180
    MaxTapMove              = 175
    MaxDoubleTapTime        = 180
    SingleTapTimeout        = 180
    ClickTime               = 100
    EmulateMidButtonTime    = 0
    EmulateTwoFingerMinZ    = 282
    EmulateTwoFingerMinW    = 7
    VertScrollDelta         = 79
    HorizScrollDelta        = 79
    VertEdgeScroll          = 0
    HorizEdgeScroll         = 0
    CornerCoasting          = 0
    VertTwoFingerScroll     = 1
    HorizTwoFingerScroll    = 1
    MinSpeed                = 1
    MaxSpeed                = 1.75
    AccelFactor             = 0.0501505
    TouchpadOff             = 0
    LockedDrags             = 0
    LockedDragTimeout       = 5000
    RTCornerButton          = 2
    RBCornerButton          = 3
    LTCornerButton          = 0
    LBCornerButton          = 0
    TapButton1              = 1
    TapButton2              = 3
    TapButton3              = 0
    ClickFinger1            = 1
    ClickFinger2            = 3
    ClickFinger3            = 0
    CircularScrolling       = 0
    CircScrollDelta         = 0.1
    CircScrollTrigger       = 0
    PalmDetect              = 0
    PalmMinWidth            = 10
    PalmMinZ                = 200
    CoastingSpeed           = 20
    CoastingFriction        = 50
    PressureMotionMinZ      = 30
    PressureMotionMaxZ      = 160
    PressureMotionMinFactor = 1
    PressureMotionMaxFactor = 1
    ResolutionDetect        = 1
    GrabEventDevice         = 1
    TapAndDragGesture       = 1
    AreaLeftEdge            = 0
    AreaRightEdge           = 0
    AreaTopEdge             = 0
    AreaBottomEdge          = 0
    HorizHysteresis         = 19
    VertHysteresis          = 19
    ClickPad                = 1
    RightButtonAreaLeft     = 1710
    RightButtonAreaRight    = 0
    RightButtonAreaTop      = 1682
    RightButtonAreaBottom   = 0
    MiddleButtonAreaLeft    = 0
    MiddleButtonAreaRight   = 0
    MiddleButtonAreaTop     = 0
    MiddleButtonAreaBottom  = 0

Solution 1:

In terminal:

xinput --list

Will output something like this:

⎡ 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)]
⎣ 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)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=9    [slave  keyboard (3)]
    ↳ Toshiba input device                      id=11   [slave  keyboard (3)]

Using the the device name you want to change ( e.g. I will change my touchpad's buttons, so I will use "SynPS/2 Synaptics TouchPad") do this:

xinput set-button-map "YOUR_DEVICE" 1 3 1 4 5 6 7 8 9 

E.g for me:

xinput set-button-map "SynPS/2 Synaptics TouchPad" 1 3 1 4 5 6 7 8 9

(Watch out for the case in the device name, because it is important.) After this both of your left and right clicks are treated as a left click and your middle click is treated as a right click. This is only temporarily, after a reboot the changes are lost. To make it permanent just make the /etc/lightdm/touchpad_setup file with the following contents:

#!/bin/bash
xinput set-button-map "YOUR_DEVICE" 1 3 1 4 5 6 7 8 9
exit 0

and make it executable: sudo chmod +x /etc/lightdm/touchpad_setup. After that edit the /etc/lightdm/lightdm.conf file and add the following line to it under the [SeatDefaults] section:

session-setup-script=/etc/lightdm/touchpad_setup

(If you already had a session-setup-script in your lightdm.conf file then you will have to add the xinput set-button-map "YOUR_DEVICE" 1 3 1 4 5 6 7 8 9 line to the file pointed in those lines in lightdm.conf.)


Update 1:

Also you may want to take a look at the options of the synaptics driver. Based on what you wrote in the comments I think by modifying the

Option "ClickPad" "boolean"

          Whether  the  device  is  a  click  pad.  A click pad device has
          button(s) integrated into the touchpad surface.  The  user  must
          press  downward  on  the touchpad in order to generated a button
          press. This property may be set automatically  if  a  click  pad
          device  is detected at initialization time. Property: "Synaptics
          ClickPad"

or more likely the

Option "TapButton2" "integer"

          Which mouse button is reported on a non-corner  two-finger  tap.
          Set to 0 to disable. Property: "Synaptics Tap Action"

option will solve your problem. Check your current settings with xinput --list-props "ETPS/2 Elantech Touchpad" or with synclient -l. Then modify your settings with either xinput or synclient, which you like more.


Update 2:

So you figured it out and you only had to disable the soft button area for the right button by setting every RightButtonArea* parameter to 0, with synclient RightButtonAreaLeft=0, synclient RightButtonAreaTop=0. (As the other were already on 0.) The same command with xinput would be xinput --set-prop "ETPS/2 Elantech Touchpad" "Synaptics Soft Button Areas" 0 0 0 0 0 0 0 0.