How does one enable Natural (a.k.a. "Reverse") scrolling for attached mice?

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
Portreve
Level 13
Level 13
Posts: 4870
Joined: Mon Apr 18, 2011 12:03 am
Location: Within 20,004 km of YOU!
Contact:

How does one enable Natural (a.k.a. "Reverse") scrolling for attached mice?

Post by Portreve »

So, two things...

The old "Natural Scrolling" package I'm assuming is gone because it's no longer in the repos, as far as I can tell.

The built in Reverse Scrolling function only seems to work with on-board tracking devices; i.e. a touchpad on a laptop. There are no options under the "Mouse" tab related to said scrolling functionality, and no options under "Touchpad" to extend the functionality to other devices.

When I have done Google searches on this, I'm really basically only finding results which are pretty out-of-date.

Thoughts, folks?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Flying this flag in support of freedom 🇺🇦

Recommended keyboard layout: English (intl., with AltGR dead keys)

Podcasts: Linux Unplugged, Destination Linux

Also check out Thor Hartmannsson's Linux Tips YouTube Channel
User avatar
all41
Level 19
Level 19
Posts: 9523
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: How does one enable Natural (a.k.a. "Reverse") scrolling for attached mice?

Post by all41 »

I had this same request a couple weeks ago and I was able to reverse the direction of the scroll
wheel using:

Code: Select all

xinput --list
In this screenshot you can see the id=10 for my mouse, yours may be a different id#
Screenshot at 2016-08-05 21-40-30.png
Then I look at the parameters for dev=10 in a terminal:

Code: Select all

xinput list-props 10
Screenshot at 2016-08-05 21-53-421.png
Scroll down to find Endev Scrolling Distance. It will also have a parameter number in parenthesis.
In my system it is 513 (bottom of the second screenshot. It is followed by the attributes 1, 1, 1. These need to be changed to -1, -1, -1.
To do that in a terminal:

Code: Select all

xinput set-prop 10 513 -1, -1, -1
Screenshot at 2016-08-05 21-44-58.png
of coarse substitute your device number for the 10 and your parameter number for 513
This will all get reset at boot but a small startup script can take care of that.
Everything in life was difficult before it became easy.
DeMus

Re: How does one enable Natural (a.k.a. "Reverse") scrolling for attached mice?

Post by DeMus »

Maybe a stupid question, but what does it do differently now than what it did before?
User avatar
all41
Level 19
Level 19
Posts: 9523
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: How does one enable Natural (a.k.a. "Reverse") scrolling for attached mice?

Post by all41 »

DeMus wrote:Maybe a stupid question, but what does it do differently now than what it did before?
I first encountered the "natural scrolling" on a different OS--I have never liked it.
Normally when you scroll down (rotate the mousewheel toward you) the viewed page moves upward on the screen.
I personally don't get the point of reversing the direction of movement but at least a few people do.
Everything in life was difficult before it became easy.
DeMus

Re: How does one enable Natural (a.k.a. "Reverse") scrolling for attached mice?

Post by DeMus »

all41 wrote: Normally when you scroll down (rotate the mousewheel toward you) the viewed page moves upward on the screen.
When I rotate the mousewheel towards me, the screen scrolls down. So in your book, that is not normal. This is however the way I always use it and I never, and I really mean never, do anything to change it after an installation of an OS. In other words this must be normal, this must be default. How else can it work like that if I don't change it?
I looked in the mouse settings just now and "Reverse scroll direction" is not on, still pulling the wheel towards me makes the screen scroll down.
Are you sure your way is the default way or do you change the setting and call it "normal"?
Don't get me wrong please, I am just trying to understand it.
User avatar
all41
Level 19
Level 19
Posts: 9523
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: How does one enable Natural (a.k.a. "Reverse") scrolling for attached mice?

Post by all41 »

When I rotate the mouse wheel towards me the scroll bars move downward but the page text moves upward---which is how I have always used a mouse wheel for scrolling.
I mostly use a usb trackpad for scrolling and this feels comfortable for me on that device as well.

Mint 17.3 and 18 has the Settings choice for 'Natural Scrolling' when a trackpad is present. This reverses thedirection of scrolling. It was my understanding the OP wanted to incorporate this for a standard mouse/mousewheel.
There must be some who use this feature but as I have said it is not my cup of tea.
Everything in life was difficult before it became easy.
musicin3d

Re: How does one enable Natural (a.k.a. "Reverse") scrolling for attached mice?

Post by musicin3d »

For the lazy...

Code: Select all

regex='Mouse.*id=([0-9]+)'
mouseline=$(xinput --list | egrep "$regex")
[[ $mouseline =~ $regex ]]
mouseid="${BASH_REMATCH[1]}"

regex='Evdev Scrolling Distance \(([0-9]+)\)'
scrollline=$(xinput list-props $mouseid | egrep "$regex")
[[ $scrollline =~ $regex ]]
scrollid="${BASH_REMATCH[1]}"

xinput set-prop $mouseid $scrollid -1, -1, -1
Copy/paste that or save it as a shell script.
wackywalt

Re: How does one enable Natural (a.k.a. "Reverse") scrolling for attached mice?

Post by wackywalt »

all41 wrote: Fri Aug 05, 2016 11:15 pm I had this same request a couple weeks ago and I was able to reverse the direction of the scroll
wheel using:

Code: Select all

xinput --list
In this screenshot you can see the id=10 for my mouse, yours may be a different id#
Screenshot at 2016-08-05 21-40-30.png
Then I look at the parameters for dev=10 in a terminal:

Code: Select all

xinput list-props 10
Screenshot at 2016-08-05 21-53-421.png
Scroll down to find Endev Scrolling Distance. It will also have a parameter number in parenthesis.
In my system it is 513 (bottom of the second screenshot. It is followed by the attributes 1, 1, 1. These need to be changed to -1, -1, -1.
To do that in a terminal:

Code: Select all

xinput set-prop 10 513 -1, -1, -1
Screenshot at 2016-08-05 21-44-58.png
of coarse substitute your device number for the 10 and your parameter number for 513
This will all get reset at boot but a small startup script can take care of that.
Thanks all41!
I found the device id for my mouse, which is 12
then I followed that up with:

Code: Select all

xinput list-props 12
I then see these 2 properties:

Code: Select all

libinput Natural Scrolling Enabled (278):	0
libinput Natural Scrolling Enabled Default (279):	0
Changing the value to 1 for the first of these seems to do the trick for me:

Code: Select all

xinput set-prop 12 278 1
User avatar
all41
Level 19
Level 19
Posts: 9523
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: How does one enable Natural (a.k.a. "Reverse") scrolling for attached mice?

Post by all41 »

Good report and you're welcome @wackywalt
You are wielding the power
Enjoy
Everything in life was difficult before it became easy.
wackywalt

Re: How does one enable Natural (a.k.a. "Reverse") scrolling for attached mice?

Post by wackywalt »

I have a shell script started up and it works fine on startups and reboots.
However, I do find that when my laptop wakes up from sleep it no longer is natural scrolling.
I have to rerun the script to get it working again. :(

Is there a better solution?
Thanks in advance!
Walt
mvamos
Level 1
Level 1
Posts: 6
Joined: Sun Jan 20, 2019 1:08 pm

Re: How does one enable Natural (a.k.a. "Reverse") scrolling for attached mice?

Post by mvamos »

Thanks wackywalt.

My output for xinput showed one 0 for natural scrolling direction. Tried changing to a 1, but got this message:

xinput set-prop 10 293 1

X Error of failed request: BadAccess (attempt to access private resource denied)
Major opcode of failed request: 131 (XInputExtension)
Minor opcode of failed request: 57 ()
Serial number of failed request: 20
Current serial number in output stream: 21

Can anyone help with this? What do I have wrong?
Locked

Return to “Software & Applications”