I've got a Logitech Marble Mouse trackball with four buttons:

enter image description here

Using the instructions here, I've got 50-marblemouse.conf (xorg.conf) set up so that the holding the "back" button lets me scroll:

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

However, sometimes "hold" registers as a click on "back", which is super annoying when I'm browsing a web page. Is there any way I can use the button to scroll but disable single click?

The usual workaround seems to be to use the "forward" button for scrolling, since clicks on that are mostly harmless, but I find having to click that with my ring finger much more awkward than thumbing the back button.


I think the option you're looking for is ButtonMapping. I had a similar annoying feature with my mouse ( https://www.kensington.com/en/no/4493/k72327eu/slimblade-trackball ), so figured this out a while ago.

The "EmulateWheelButton" option still should work even if you disable the button or reassign the mapping...

Now, I've only tested this with xinput on evdev. It's a lot quicker to try things out with xinput and then you could just add a script to your "Startup Applications" instead of having to modify /etc/X11/ and restart X over and over.

So this should be all you need in xorg.d/mouse.conf (the commented out lines are what should be needed if you don't want to use a login script to do this per user), though you might not need this at all if you use xinput:

Section "InputDevice"
    Identifier  "Configured Mouse"
    Driver    "evdev"
    Option    "Device"                "/dev/input/mice"
    Option    "Protocol"              "auto"
    #Option    "EmulateWheel"          "1"
    #Option    "EmulateWheelButton"    "8"
    #Option    "ButtonMapping"        "1 2 3 4 5 6 7 0 9 10 11 12"

Here's what I did to figure out my solution (replace my device with your device in the following commands obviously):

Show devices:

$ xinput list
Virtual core pointer                        id=2    [master pointer  (3)]
  ↳ Virtual core XTEST pointer                  id=4    [slave  pointer  (2)]
  ↳ ELAN Touchscreen                            id=11   [slave  pointer  (2)]
  ↳ SynPS/2 Synaptics TouchPad                  id=13   [slave  pointer  (2)]
  ↳ Kensington Kensington Slimblade Trackball   id=18   [slave  pointer  (2)]

See what properties are supported for that device:

$ xinput list-props "Kensington Kensington Slimblade Trackball"
Device 'Kensington Kensington Slimblade Trackball':
    Device Enabled (142):        1
    Coordinate Transformation Matrix (144):        1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    Device Accel Profile (273):        0
    Device Accel Constant Deceleration (274):        1.000000
    Device Accel Adaptive Deceleration (275):        1.000000
    Device Accel Velocity Scaling (276):        10.000000
    Device Product ID (260):        1149, 8257
    Device Node (261):        "/dev/input/event17"
    Evdev Axis Inversion (277):        0, 0
    Evdev Axes Swap (279):        0
    Axis Labels (280):        "Rel X" (152), "Rel Y" (153), "Rel Vert Wheel" (573)
    Button Labels (281):        "Button Left" (145), "Button Middle" (146), "Button Right" (147), "Button Wheel Up" (148), "Button Wheel Down" (149), "Button Horiz Wheel Left" (150), "Button Horiz Wheel Right" (151), "Button Side" (679), "Button Unknown" (263), "Button Unknown" (263), "Button Unknown" (263), "Button Unknown" (263)
    Evdev Scrolling Distance (282):        1, 1, 1
    Evdev Middle Button Emulation (283):        0
    Evdev Middle Button Timeout (284):        50
    Evdev Third Button Emulation (285):        0
    Evdev Third Button Emulation Timeout (286):        1000
    Evdev Third Button Emulation Button (287):        3
    Evdev Third Button Emulation Threshold (288):        20
    Evdev Wheel Emulation (289):        1
    Evdev Wheel Emulation Axes (290):        0, 0, 4, 5
    Evdev Wheel Emulation Inertia (291):        10
    Evdev Wheel Emulation Timeout (292):        200
    Evdev Wheel Emulation Button (293):        8
    Evdev Drag Lock Buttons (294):        0

Now let's give it a shot:

$ xinput set-button-map "Kensington Kensington Slimblade Trackball" 1 2 3 4 5 6 7 0 9 10 11 12
$ xinput set-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation" 1
$ xinput set-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation Button" 8

Now my top right button only works as auto-scroll instead of the infuriating back behavior!


Here is my configuration for this very good trackball, on Ubuntu, back in 2009. I hope this is still working, maybe you will have a few differences with "Driver" and "Device". However, the buttons options should be the same.

Code: Section "InputDevice"
Identifier    "Marble Mouse"
Driver        "mouse"
Option        "CorePointer"
Option        "Device"   "/dev/input/mice"
Option        "Protocol"        "ExplorerPS/2"
Option        "Emulate3Buttons"    "true"
Option        "Buttons"        "9"
Option        "EmulateWheel"        "1"
Option        "EmulateWheelButton"    "8"
Option        "YAxisMapping"        "4 5"
Option        "XAxisMapping"        "6 7"

So, we have:

  • 3rd button is on "Forward" (9), very convenient.
  • emulate wheel is on "Back" (8)
  • note that I defined both X and Y axis, meaning that when pressing "Back" with the thumb, you can scroll in both directions using the ball, like with a touchpad.

Using the "Example Configuration #3, forgo "Back" button" instructions provided by your link, you could remap the back button to be something more harmless, such as right mouse button click.

I don't know exactly how you merge that with your above config file though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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