Getting Logitech Optical Marble Mouse works in Ubuntu

Marble mouse doesn’t comes with a wheel, which makes it not quite usable in modern OS. By following the steps, you will add a button mappings for the little left button(8) so that it can emulate the middle button and emulate Wheel Button

Add a new file /usr/share/X11/xorg.conf.d/50-marblemouse.conf

The content is as followed.

Section "InputClass"
    Identifier      "Marble Mouse"
    MatchProduct    "Logitech USB Trackball"
    MatchIsPointer  "on"
    MatchDevicePath "/dev/input/event*"
    Driver          "evdev"
    Option          "SendCoreEvents" "true"

    #  Physical buttons come from the mouse as:
    #     Big:   1 3
    #     Small: 8 9
    #
    # This makes left small button (8) into the middle, and puts
    #  scrolling on the right small button (9).
    #
    Option "Buttons"            "9"
    #Option "ButtonMapping"      "1 8 3 4 5 6 7 2 9"
    Option "ButtonMapping"      "1 9 3 4 5 6 7 2 8"
    Option "EmulateWheel"       "true"
    #Option "EmulateWheelButton" "9"
    Option "EmulateWheelButton" "8"

EndSection