Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Has anyone managed to make natural scrolling work on Ubuntu 12.10? And with make work I mean to find a setup working for all the applications and not something based on Xmodmap which seems to be considered more an hack than a clean solution and in addition it doesn't enable natural scrolling on Nautilus.

I am asking that because the workaround I found to enable it with Magic Trackpads (i.e. tweak the setting Synaptic Scrolling Distance using xinput) doesn't work with Magic Mouses because such devices seem not to make use of the synaptic driver. Can you confirm that?

The following is the output of the command: xinput list-props 'Apple Magic Mouse'

Device 'Apple Magic Mouse':
Device Enabled (126):   1
Coordinate Transformation Matrix (128): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Accel Profile (247): 0
Device Accel Constant Deceleration (248):   5.000000
Device Accel Adaptive Deceleration (249):   1.000000
Device Accel Velocity Scaling (250):    5.000000
Device Product ID (243):    1452, 781
Device Node (244):  "/dev/input/event16"
Evdev Axis Inversion (251): 0, 0
Evdev Axes Swap (253):  0
Axis Labels (254):  "Rel X" (136), "Rel Y" (137), "Rel Horiz Wheel" (375), "Rel Vert Wheel" (376)
Button Labels (255):    "Button Left" (129), "Button Middle" (130), "Button Right" (131), "Button Wheel Up" (132), "Button Wheel Down" (133), "Button Horiz Wheel Left" (134), "Button Horiz Wheel Right" (135)
Evdev Middle Button Emulation (256):    0
Evdev Middle Button Timeout (257):  50
Evdev Third Button Emulation (258): 0
Evdev Third Button Emulation Timeout (259): 1000
Evdev Third Button Emulation Button (260):  3
Evdev Third Button Emulation Threshold (261):   20
Evdev Wheel Emulation (262):    0
Evdev Wheel Emulation Axes (263):   0, 0, 4, 5
Evdev Wheel Emulation Inertia (264):    10
Evdev Wheel Emulation Timeout (265):    300
Evdev Wheel Emulation Button (266): 4
Evdev Drag Lock Buttons (267):  0
share|improve this question
I spent a lot of time on Google looking for possible solutions before ask that question here: unfortunately, none of them seemed to be a system-wide solution (ie. natural scrolling was not working with all the applications like for example nautilus which as I said above, does not honor Xmodmap setings). So please, if you have any kind of working solution, post it here. – landimatte Dec 29 '12 at 20:16
up vote 6 down vote accepted

Find the device ID of your magic mouse by doing:

xinput list

Then set the inverse scrolling by doing:

xinput set-button-map ID 1 2 3 5 4

(replacing ID with the ID of your device)

share|improve this answer
This works, but does not survive a reboot. – Bram Sep 18 '13 at 3:43
you could create a script to run on login, but this method still doesn't reverse the scroll in system windows, e.g. Files – Tom Imrei Dec 12 '13 at 15:41
Do 3 2 1 5 4 if you prefer the primary button to be the on the right. – Waldir Leoncio Apr 10 '15 at 17:19
For complete natural scrolling use: xinput set-button-map 13 1 2 3 5 4 7 6 – Orlando Leite Apr 23 '15 at 12:12
Surviving a reboot is not the real problem. If for some reason you disable Bluetooth and re-enable it again, settings will get lost. So it's a matter to run the script when the mouse gets connected. – Paulo Pedroso Mar 8 at 21:26

In order to automatically change to natural scrolling in boot time, I did the following steps:

  1. I created a simple script, as follows:

    mouse_id=$(xinput list | grep 's Mouse' | egrep -o "[[:digit:]]{2}") 
    eval "$(xinput set-button-map $mouse_id 1 2 3 5 4)"
  2. I made a soft link in /bin directory

  3. Finally, I added this script to startup applications

After a restart it works perfectly.

My script is not perfect but it works. Maybe someone can suggest a better script for this or better approach. Fill free to edit my script. (I am using Ubuntu 12.04.)

share|improve this answer
Can't you just add xinput set-button-map $mouse_id 1 2 3 5 4 to startup applications? – Waldir Leoncio Apr 10 '15 at 16:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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