6

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"
EndSection

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?

sawa
  • 872

4 Answers4

5

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. 
Jodie C
  • 1,879
  • 1
    You may are using evdev instead of mouse - have a look at http://linux.die.net/man/4/evdev - it may be InvertY and InvertX – Ulrich Dangel Jun 04 '12 at 03: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 04 '12 at 04:52
0

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
perror
  • 3,239
  • 7
  • 33
  • 45
Mike
  • 1
0

Late to the party, but I found the correct solution. I have a Kensington Orbit trackball, so adapt the "sed" string accordingly.

## Invert mouse axels, two button trackball
for id in $(xinput --list | sed -n '/Kensington USB\/PS2 Orbit/s/.*=\([0-9]\+\).*/\1/p')
do
  # Shift left-right mousebutton 3 _ 1 disable all other 0 0 0 0
  xinput set-button-map $id 3 0 1 0 0 0 0   
  # Invert mouse axels. see https://wiki.ubuntu.com/X/InputCoordinateTransformation
  xinput set-prop $id 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
done
sneeze
  • 1
0

I have "Primax Kensington Eagle Trackball":

enter image description here

You just need to set Natural Scrolling to 1:

xinput --set-prop 'Primax Kensington Eagle Trackball' 278 1

I find that when the trackball is plugged into my laptop or into my desktop, the xinput option numbers appear different, even though both machines are running Ubuntu.

Here is the xinput options for my laptop: enter image description here

When the trackball is plugged into my desktop, the number 278 is now 303.