Reverse Mouse Wheel Scroll ala OS X Lion in Ubuntu 10.04

Learned a new command today: xinput. This allows you to (re)configure how X11 maps your input devices.

If you are on Ubuntu, and you’d want what Apple calls the “Natural Scrolling”, then you may do the following:

In the shell:

$ xinput list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ Macintosh mouse button emulation        	id=11	[slave  pointer  (2)]
⎜   ↳ SIGMACH1P USB Keykoard                  	id=9	[slave  pointer  (2)]
⎜   ↳ A4Tech USB Mouse                        	id=12	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Power Button                            	id=7	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=10	[slave  keyboard (3)]
    ↳ SIGMACH1P USB Keykoard                  	id=8	[slave  keyboard (3)]

In my case, my mouse is an “A4Tech USB Mouse”. Yours might be different so check carefully the output of xinput list.

I reversed mine using:

xinput set-button-map "A4Tech USB Mouse" 1 2 3 5 4 6 7 8 9 10 11 12 13 14 15 16

Check your wheel up/down scrolling. That’s it.

But this is not a permanent setting; it will be lost after a reboot. Add this command in the:

System > Preferences > Startup Applications.

The so called natural scrolling is a mode that was introduced in the release of OS X Lion; which corresponds to how one scrolls on an iPad/iPhone. It does feel awkward at first, but I retrained my brain/hand in continued usage. It does make sense when you think “I want to scroll the content” vs. “I want to scroll the scrollbar”.

People either love or hate this.

Advertisements

5 thoughts on “Reverse Mouse Wheel Scroll ala OS X Lion in Ubuntu 10.04

  1. Pingback: Ubuntu inverted scrolling (aka max os x lion style – natural scrolling » IT Blog

  2. @Emmanuel
    If you’ve noticed, 4 and 5 are reversed and swapped …

    reverse scroll – as detailed in this post
    xinput set-button-map “A4Tech USB Mouse” 1 2 3 5 4 6 7 8 9 10 11 12 13 14 15 16

    normal / original scroll mode
    xinput set-button-map “A4Tech USB Mouse” 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

  3. Thanks for the hint! I applied this to my Apple Magic Mouse (in my case device id 14) with:

    asc@iMac:~$ xinput
    ⎡ Virtual core pointer id=2 [master pointer (3)]
    ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
    ⎜ ↳ Alexander Schwabs Maus id=14 [slave pointer (2)]
    ⎣ Virtual core keyboard id=3 [master keyboard (2)]
    ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
    ↳ Power Button id=6 [slave keyboard (3)]
    ↳ Video Bus id=7 [slave keyboard (3)]
    ↳ Power Button id=8 [slave keyboard (3)]
    ↳ Sleep Button id=9 [slave keyboard (3)]
    ↳ Apple, Inc Apple Keyboard id=10 [slave keyboard (3)]
    ↳ Apple, Inc Apple Keyboard id=11 [slave keyboard (3)]
    ↳ Apple Computer, Inc. IR Receiver id=12 [slave keyboard (3)]
    ↳ Built-in iSight id=13 [slave keyboard (3)]

    asc@iMac:~$ xinput set-button-map 14 1 2 3 5 4 7 6

    That is reversing the X and Y axis of the scroll-wheel. If you only want Y-axis you should do:

    xinput set-button-map 14 1 2 3 5 4 6 7

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s