Advanced inertial scrolling configuration

Is it possible configure the synaptic inertial scrolling in a way so it is disrupted when any key is pressed on the keyboard?

To explain this question: I often use shortcuts. Now when I am for example browsing the Web and scroll back to the top of a website using inertial scrolling, I zoom the site like crazy if I try to open a new tab with Ctrl+T because the browser only detects Ctrl+scrolling.

This happens in a lot of applications and is really annoying. I used to like inertial scrolling but as long as this problem persists, I have to disable it.


Solution 1:

I am afraid this has already been discussed on Xorg and is marked as "Resolved Fixed" but won't be fixed since Xorg won't realize when you press Ctrl and inertial scrolling is still in place. (See Peter Hutterer's comment and its analogy with Ctrl).

So at least until we have Unity 8(when Xorg is replaced with Mir and hopefully we see this as really resolved), we can only have a wordaround rather than a perfect fix or completely disabling inertial scrolling.

One of the fixes I would recommend is to disable Ctrl+scrolling feature in the application itself. This sure is an unclean solution since the problem is still in place but only the effect is removed and you would have to do this for whatever application you most frequently use inertial scrolling.

For disabling Ctrl+scrolling feature in Firefox, type about:config in the address bar and then click on "I'll be careful, I promise!" Now, in the search bar, type mousewheel.with_control.action and double click on the first result and set its value to 1, which would only scroll contents instead of zooming. You can set its value to the following values with the corresponding effects:

  • 0 (disabled)
  • 1 (scroll contents)
  • 2 (go back/forward in your history)
  • 3 (default, zoom in/out)

I'll update the answer if I am able to find a cleaner, better solution.

Solution 2:

Corner coasting helps! While not a real fix, I found that using the Synaptics driver's CornerCoasting mode instead of the normal (finger-off) inertial scrolling mode helps. Reason: corner coasting mode is active while keeping the finger in the corner and stops immediately when releasing it. While pressing Ctrl during corner coasting still creates the "Firefox zoom madness" problem you describe, I found I am very unlikely to do that while I am actively involved in an action (i.e. with the finger on the touchpad rather than finger-off coasting).

Trying out corner coasting. The following command will set up corner coasting mode:

synclient VertEdgeScroll=1 CornerCoasting=1 CoastingSpeed=1 CoastingFriction=0

VertEdgeScroll=1 is because corner coasting only works with edge scrolling, not with two-finger scrolling. If you like corner coasting at both right and bottom edges, add HorizEdgeScroll=1 to the above line. CornerCoasting=1 enables corner coasting mode. CoastingSpeed is the minimum speed of scrolling during coasting, but that seems also to be the minimum cursor speed to trigger it. So I set it to its minimum to make it easiest to trigger the mode, which else can be tricky (and impossible with something like CoastingSpeed=100). CoastingFriction is a value to let inertial scrolling fade out. We disable it here to keep it going until you lift the finger, different from what is usually desired in finger-off conventional coasting. For more details on these options, see the Synaptics manpage.

Something not mentioned in the manpage: corner coasting is seemingly enabled by swiping from a non-corner edge area into a corner area, and then keeping the finger there. So, corner coasting movement stops if you accidentally lift the finger, for a very short time even, by bumping into / over the touchpad edge. The "move into a corner area" trigger mode also means, corner coasting won't work or will be difficult to trigger if your TopEdge and BottomEdge parameters leave little or no non-corner area at the edge. These are relevant here as the corner areas are defined by the intersections of edge areas. Also, without an accessibly sized right edge area, triggering corner coasting will also be difficult to impossible. For my hardware (ThinkPad X201), I found these values to work well (yours may be different, it takes some experimenting):

synclient RightEdge=4800 TopEdge=2000 BottomEdge=4000

Making corner coasting stick. While synclient is great for testing settings out with immediate effect, they are lost when restarting X. To make them stick, create a /etc/X11/xorg.conf.d/51-synaptics-cornercoasting.conf or similarly named config file as described here (it also works in Ubuntu!). For the above case, the content would be:

Section "InputClass"
    Identifier "Touchpad tweaks"
    Driver "synaptics"
    MatchIsTouchpad "on"
        Option "VertEdgeScroll" "on"
      # Option "HorizEdgeScroll" "on" # Enable if you want this.
        Option "CornerCoasting" "on"
        Option "CoastingSpeed" "1"
        Option "CoastingFriction" "0"

        Option "RightEdge" "4800"
        Option "TopEdge" "2000"
        Option "BottomEdge" "4000"
EndSection

And then restart X to see the effect, of course.