I would like to invert the scrolling direction so that when I scroll down (using two fingers in a downward direction) on my trackpad, the page also moves down (i.e. to content lower down).

I did this in Raspbian Jessie previously like this by editing the 10-evdev.conf file in /usr/share/X11/xorg.conf.d/.

However, Raspbian Stretch (9.x) uses libinput rather than evdev so the method above doesn't work.

1 Answer 1


I've figured it out!

The scrolling direction is determined by libinput - see here.

Navigate to the 40-libinput.conf file in /usr/share/X11/xorg.conf.d and change the first section as follows:

# Match on all types of devices but tablet devices and joysticks
Section "InputClass"
        Identifier "libinput pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
        Option "NaturalScrolling" "true" #ADD THIS LINE
  • 2
    You will have to use sudo nano 40-libinput.conf to edit the file.
    – nu-bo
    Nov 20, 2017 at 12:17
  • 2
    Also needs a reboot after adding the option line.
    – AaronD
    May 20, 2020 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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