# Synaptics natural scrolling results inconsistent scroll direction



## zen3ger (Feb 9, 2020)

Hi,

I've found this review: Add natural scrolling support to psm. So I went ahead and added natural scrolling in /etc/sysctl.conf:

```
# Enable naturall scrolling on Synaptics touchpads
hw.psm.synaptics.natural_scroll=1
```

It works, however occasionally the scrolling direction is reversed then goes back to "natural scrolling" mode again. Is there anything else, that I potentially have to configure in moused or Xorg to get rid of this behavior?

I have moused running with a couple of additional flags:

```
/usr/sbin/moused -F 200 -A 1.5,2.0 -a 0.6 -r high -p /dev/psm0 -I /var/run/moused-psm0.pid
```

And I also configured the same refresh rate in /etc/X11/xorg.conf:

```
Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option      "Protocol" "auto"
        Option      "Device" "/dev/sysmouse"
        Option      "ZAxisMapping" "4 5 6 7"
        Option      "SampleRate" "200"
EndSection
```

/Thanks!


----------



## SirDice (Feb 12, 2020)

What version of FreeBSD?


----------



## zen3ger (Feb 14, 2020)

FreeBSD 12.1-STABLE


----------



## SirDice (Feb 17, 2020)

What revision?


----------



## Raffeale (Mar 13, 2020)

i think the problem is from the moused parameters, try to remove all parameters.  I got same problem before when I set some psm parameter with moused or in loader.conf ,remove hints about psm.


----------



## NapoleonWils0n (Mar 13, 2020)

What about just using xmodmap

create an ~/.xmodmap file


```
echo 'pointer = 1 2 3 4 5 6 7 8 9 10' > ~/.xmodmap
```

then run xmodmap


```
xmodmap ~/.xmodmap
```

or if you can reverse the scrolling direction

```
echo 'pointer = 1 2 3 5 4 6 7 8 9 10' > ~/.xmodmap2
```

then run xmodmap


```
xmodmap ~/.xmodmap2
```


----------



## cederom (Jan 30, 2021)

Xorg is now using `libinput` for input handling. This is probably why `sysctl` does not work anymore? It is worth mentioning that `libinput debug-events` shows all sorts of gestures like two finger horizontal and vertical scrolling as well as pitch, etc 

*Update: I did find a way to configure  libinput directly and this is the only sensible place to configure NaturalScroll as all other places will keep scroll/zoom inconsistent - some applications will scroll up some down etc. Use this to setup only Touchpad and you can still use your mouse as you like.*


```
/usr/local/share/X11/xorg.conf.d/40-libinput.conf:

Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event5"
        Option "NaturalScrolling" "on"
        Option "Tapping" "on"
        Option "ClickMethod" "clickfinger"
        Driver "libinput"
EndSection
```


----------



## Mjölnir (Jan 31, 2021)

`sysrc moused_flags+=" -l 2"`
Read `pkg info -D xorg-server` and add `kern.evdev.rcpt_mask=6` to sysctl.conf(5) (and of course `service moused restart`)
Remove any custom configuration in /usr/local/etc/X11/Xorg.conf.d except those that you _really_ understand.  Better let Xorg(1)'s _automagic_ do it's job.
Likewise, any customization in your .dot files may interfere... Back them up and only enable what the _automagic_ can not solve to your satisfaction.
Instead of fiddling around with sysctl(8) knobs for the psm(4) driver, use a graphical config tool (e.g. KDE) to configure the touchpad.  I.e. all you need is `hw.psm.synaptics_support="1"` and `hw.psm.trackpoint_support="1"` in loader.conf(5)


----------



## Mjölnir (Jan 31, 2021)

Standard disclaimer:

install the docs:`pkg install {de,en}-freebsd-doc`, replace `de` with your native tongue, and point your favorite browser to /usr/local/share/doc/freebsd.
You may want to add `message: "query '[%C/%n] %M'",` to the _ALIAS_ section of /usr/local/etc/pkg.conf, then read through all `pkg message|less` and *apply the requested settings*.
Instead of less(1), you may find sysutils/most more user-friendly.  Beginners will prefer edit(1) (ee(1)), editors/aee or editors/nano over the old-school, UNIX'ish vi(1) (wizzard's choice  ).
The utilities sysutils/psearch or sysutils/portfind will help you to find available software in the ports(7) tree.
ports-mgmt/octopkg is a user-friendly graphical frontend to the pkg-ng package manager.  It uses the Qt toolkit and runs on every GUI.  AFAIK there is no Gtk-based counterpart
Use sysrc(8) to safely edit system rc(8) files instead of editing rc.conf(5).  It does some checks to prevent typos, and allows for advanced tricks like `sudo sysrc moused_flags+=" -l 2"` (note the space).


----------

