# Synaptics Right-Click Bug?

## hypoon

I don't remember when this started, but it's been driving me nuts for a very long time.

I have an older macbook pro, where the trackpad has one wide button at the bottom (the button is not a touch-enabled surface. It is exactly as I said: a button). The trackpad supports multitouch.

Many users like "tap-to-click" behavior. Briefly touching the trackpad sends a "button X down" event and a "button X up" event in rapid succession, where X (right, left, or middle) is determined by how many fingers were used to tap the trackpad. I do *not* want this behavior.

The alternative behavior is to only send button events upon the pressing of the physical hardware button. In this behavior, pressing the button sends "button X down", and releasing the button sends "button X up", where X (right, left, or middle) is determined by how many fingers are on the trackpad when the button was pushed. Typically, three fingers corresponds to a middle click, two corresponds to a right click, and one OR zero fingers corresponds to a left click. This is the behavior that I want.

I can almost get there. The defaults are close, but have one key issue, as is shown by xev. Left clicks work correctly and exactly as they should:

On press:

```
ButtonPress event, serial 25, synthetic NO, window 0x1a00001,

    root 0x3fa, subw 0x0, time 2572100, (268,183), root:(1229,792),

    state 0x10, button 1, same_screen YES

```

On release:

```
ButtonRelease event, serial 25, synthetic NO, window 0x1a00001,

    root 0x3fa, subw 0x0, time 2576583, (268,183), root:(1229,792),

    state 0x110, button 1, same_screen YES

```

But right clicks (two fingers resting on the trackpad while the button is pressed) do not:

On press:

```
ButtonPress event, serial 25, synthetic NO, window 0x1a00001,

    root 0x3fa, subw 0x0, time 2702348, (506,95), root:(1467,704),

    state 0x10, button 2, same_screen YES

ButtonPress event, serial 25, synthetic NO, window 0x1a00001,

    root 0x3fa, subw 0x0, time 2702351, (506,95), root:(1467,704),

    state 0x210, button 1, same_screen YES

ButtonRelease event, serial 25, synthetic NO, window 0x1a00001,

    root 0x3fa, subw 0x0, time 2702351, (506,95), root:(1467,704),

    state 0x310, button 2, same_screen YES

```

On release:

```
ButtonRelease event, serial 25, synthetic NO, window 0x1a00001,

    root 0x3fa, subw 0x0, time 2705934, (506,95), root:(1467,704),

    state 0x110, button 1, same_screen YES

```

And middle clicks have the same erroneous behavior. Instead of RightDown and RightUp, I have RightDown-LeftDown-RightUp and LeftUp. Applications see this, too, causing my context menu to quickly flash, if it comes up at all. It occasionally works, and xev reveals that this is because it occasionally does not send the events for the left mouse button. I've observed this occasional behavior both for short clicks and for click-and-hold in applications, but in xev I have only observed it from short clicks.

If I enable the "ClickPad" option through synclient, it behaves almost correctly. The extra left-click events are gone, but there's a problem. It now requires one finger resting on the trackpad to send a normal left-click. If there are no fingers on the trackpad, pressing the button does nothing.

Can this be fixed through configuration, or is this a driver bug?

Thanks all!

(By the way, I hope this thread is in the right section, because it's definitely related to hardware, even though I don't think it's related to the kernel. Mods, please move me to a more relevant section if need be.)

----------

## hypoon

It's one week later, I've had over 200 views (not from me refreshing the page), but no replies yet  :Sad: 

Can anyone suggest a better place to ask?

----------

## cboldt

"Better place" to me would be a generic google or bing or whatever search engine.

I assume you have set "ClickFinger1",  "ClickFinger2", and "ClickFinger3", see `man synaptics`

----------

## hypoon

I searched quite a bit before starting a thread here. I've also read through the Synaptics manpage, yes.

No, I did not set ClickFinger1, ClickFinger2, and ClickFinger3, because I am happy with the defaults (as given by "synclient -l", see below). I am taking for granted that the output of "synclient -l" is accurate.

I've searched google to no avail, but nobody's perfect. Perhaps you found a result that I missed?

The default settings:

```
Parameter settings:

    LeftEdge                = -4004

    RightEdge               = 4004

    TopEdge                 = 207

    BottomEdge              = 3911

    FingerLow               = 70

    FingerHigh              = 75

    MaxTapTime              = 180

    MaxTapMove              = 467

    MaxDoubleTapTime        = 180

    SingleTapTimeout        = 180

    ClickTime               = 100

    EmulateMidButtonTime    = 75

    EmulateTwoFingerMinZ    = 283

    EmulateTwoFingerMinW    = 7

    VertScrollDelta         = 212

    HorizScrollDelta        = 212

    VertEdgeScroll          = 0

    HorizEdgeScroll         = 0

    CornerCoasting          = 0

    VertTwoFingerScroll     = 1

    HorizTwoFingerScroll    = 0

    MinSpeed                = 1

    MaxSpeed                = 1.75

    AccelFactor             = 0.0188164

    TouchpadOff             = 0

    LockedDrags             = 0

    LockedDragTimeout       = 5000

    RTCornerButton          = 0

    RBCornerButton          = 0

    LTCornerButton          = 0

    LBCornerButton          = 0

    TapButton1              = 0

    TapButton2              = 0

    TapButton3              = 0

    ClickFinger1            = 1

    ClickFinger2            = 3

    ClickFinger3            = 2

    CircularScrolling       = 0

    CircScrollDelta         = 0.1

    CircScrollTrigger       = 0

    CircularPad             = 0

    PalmDetect              = 0

    PalmMinWidth            = 10

    PalmMinZ                = 200

    CoastingSpeed           = 20

    CoastingFriction        = 50

    PressureMotionMinZ      = 30

    PressureMotionMaxZ      = 160

    PressureMotionMinFactor = 1

    PressureMotionMaxFactor = 1

    GrabEventDevice         = 0

    TapAndDragGesture       = 1

    AreaLeftEdge            = 0

    AreaRightEdge           = 0

    AreaTopEdge             = 0

    AreaBottomEdge          = 0

    HorizHysteresis         = 38

    VertHysteresis          = 17

    ClickPad                = 0
```

I call these "default" because I make no changes to them in xorg.conf nor using the synclient tool. Perhaps some of them are being set by the synaptics driver after identifying my trackpad.

----------

## cboldt

I've never tried to duplicate the behavior you are seeking, but I noticed those "ClickFinger?" options, which seem to exist in order to do what you are trying to do.

Otherwise, I was just going to suggest maybe there is some "pressure" or "width" issue, to differentiate between 1, 2 and 3 finger contact.

Edit to add, whether you set them via a config file, or them being set by default, I would consider that "you have set" the ClickFinger? variables.  My first reaction when reading "not set" was that they weren't set.  I see from reading the output though, those variables are set.  So the problem appears to be the touchpad recognizing the difference between 1, 2 and 3 fingers being on the pad.

----------

## hypoon

Suppose that were true... the touchpad was incorrectly recognizing the number of fingers. I would expect it to send the *wrong* mouse button event in that case. What is actually happening, is it is sending the correct mouse button event, but also sending the left mouse button event as well. Why would it send two mouse button events instead of one?

----------

## cboldt

Try setting ClickFinger1=0 and enabling ClickPad.

ClickPad would work for ClickFinger2 and ClickFinger3, but be disabled for 1 finger.  I'm not sure what the effect would be, and maybe you have tried that.  My thought is that if ClickFinger1=0, that the pad/button assembly will use the button only for the 1 finger events, and would use button+pad when 2 or 3 fingers are on the pad.

----------

## hypoon

Surprisingly (to me), setting ClickFinger1=0 appears to have no effect, regardless of whether ClickPad is set to 1 or 0.

----------

## cboldt

From `man synaptics`, I would think that ClickPad would have no effect on what you are trying to do, because I read "ClickPad" as enabling certain zones of the pad to emulate buttons.  Just saying, the man page is a mixed bag for help, and maybe you're stuck with tinkering.

I don't know if any of the window manager programs (KDE, Gnome, etc.) offer the sort of arrangement you are looking for, in their GUI mouse/trackpad configuration programs.  I'm not suggesting you take up KDE, Gnome or whatever, just that those configuration utilities might have the magic incantation for revising the effect of a real button click, depending on how many fingers are simultaneously on the pad.

I've never tried to do what you are after, so have no particular experience to offer.

----------

## hypoon

I don't think what I'm trying to accomplish is terribly unusual. In fact, I think it's supposed to be the default behavior. Users normally have to deliberately enable tap-to-click. Because of this, I'm not optimistic about trying random configuration utilities which may-or-may-not function properly without dozens of other Gnome or KDE packages which I really don't want to install (I run neither Gnome nor KDE).

At first, my understanding of "ClickPad" was that it was special code intended for newer Apple laptops, which have the entire trackpad mounted on a button, such that you press down the entire trackpad to click. Upon further reading, I now understand it to cover that special case, yes, but as part of a broader set of circumstances where the trackpad is slightly flexible and extends over the right and left mouse buttons at the bottom. The user then exploits the flexibility of the trackpad to press the buttons by pressing on that corner of the trackpad. Such trackpads normally have the right and left mouse buttons drawn on them in some subtle way. See https://i.ytimg.com/vi/5QERQUkBWm4/hqdefault.jpg for an example.

----------

## gguiesi

Well I know that it's a cold question. But even then it's good to have the answers.

What works to me is:

```
synclient TapButton1= 1

synclient TapButton2= 3

synclient TapButton3= 2

```

my synclient -l:

```
Parameter settings:

    LeftEdge                = -3642

    RightEdge               = 4348

    TopEdge                 = 500

    BottomEdge              = 6125

    FingerLow               = 70

    FingerHigh              = 75

    MaxTapTime              = 180

    MaxTapMove              = 517

    MaxDoubleTapTime        = 180

    SingleTapTimeout        = 180

    ClickTime               = 100

    EmulateMidButtonTime    = 0

    EmulateTwoFingerMinZ    = 283

    EmulateTwoFingerMinW    = 7

    VertScrollDelta         = 235

    HorizScrollDelta        = 235

    VertEdgeScroll          = 0

    HorizEdgeScroll         = 0

    CornerCoasting          = 0

    VertTwoFingerScroll     = 1

    HorizTwoFingerScroll    = 0

    MinSpeed                = 1

    MaxSpeed                = 1.75

    AccelFactor             = 0.0169909

    TouchpadOff             = 0

    LockedDrags             = 0

    LockedDragTimeout       = 5000

    RTCornerButton          = 0

    RBCornerButton          = 0

    LTCornerButton          = 0

    LBCornerButton          = 0

    TapButton1              = 1

    TapButton2              = 3

    TapButton3              = 2

    ClickFinger1            = 1    

    ClickFinger2            = 3

    ClickFinger3            = 2

    CircularScrolling       = 0

    CircScrollDelta         = 0.1

    CircScrollTrigger       = 0

    CircularPad             = 0

    PalmDetect              = 0

    PalmMinWidth            = 10

    PalmMinZ                = 200

    CoastingSpeed           = 20

    CoastingFriction        = 50

    PressureMotionMinZ      = 30

    PressureMotionMaxZ      = 160

    PressureMotionMinFactor = 1

    PressureMotionMaxFactor = 1

    GrabEventDevice         = 0

    TapAndDragGesture       = 1

    AreaLeftEdge            = 0

    AreaRightEdge           = 0

    AreaTopEdge             = 0

    AreaBottomEdge          = 0

    HorizHysteresis         = 58

    VertHysteresis          = 58

    ClickPad                = 1

    RightButtonAreaLeft     = 0

    RightButtonAreaRight    = 0

    RightButtonAreaTop      = 0

    RightButtonAreaBottom   = 0

    MiddleButtonAreaLeft    = 0

    MiddleButtonAreaRight   = 0

    MiddleButtonAreaTop     = 0

    MiddleButtonAreaBottom  = 0

```

----------

