Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

For some reason, I want to use a trackball Logitech (aka Logicool) Marble Mouse (aka Trackman Marble) upside down. Is there a way to reverse the left and right rolling and up and bottom rolling respectively software-wise, without modifying the hardware? I tried this by writing a configuration file in /etc/X11/xorg.conf.g/ such as

Section "InputClass"
    Identifier "Marble Mouse"
    MatchProduct "Logitech USB Trackball"
    Option "EmulateWheel" "true"
    Option "EmulateWheelButton" "8"
    Option "XAxisMapping" "6 7"
    Option "Emulate3Buttons" "true"
    Option "ButtonMapping" "1 2 3 5 4 7 6 2 2"

The crucial part is that I switched the keys 4 and 5 and 6 and 7 so that instead of:

    Option "ButtonMapping" "1 2 3 4 5 6 7 2 2"

I have:

    Option "ButtonMapping" "1 2 3 5 4 7 6 2 2"

But this is not working, and this maybe only valid for scroll wheel emulation mode. How can I reverse the rolling?

share|improve this question
up vote 4 down vote accepted

In gaming we just refer to this as "invert mouse".

From the Xorg mouse(4) man page:

Option "InvX" "boolean"
    Invert the X axis. Default: off. 
Option "InvY" "boolean"
    Invert the Y axis. Default: off. 
share|improve this answer
You may are using evdev instead of mouse - have a look at linux.die.net/man/4/evdev - it may be InvertY and InvertX – Ulrich Dangel Jun 4 '12 at 3:50
JodieC and @Ulrich Thanks. I tried this answer along the suggestion of Ulrich. I tried InvertX and InvertY, and it worked (Haven't tried InvX, InvY). – sawa Jun 4 '12 at 4:52

Is the a way to reverse the scrolling if you are using xinput as below:

xinput set-button-map "Logitech USB Trackball" 1 2 3 4 5 6 7 8 9
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation Button" 8 8
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation" 8 1
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation Axes" 8 6 7 4 5
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation X Axis" 8 6
xinput set-int-prop "Logitech USB Trackball" "Evdev Drag Lock Buttons" 8 9
share|improve this answer

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.