Skip to content

Instantly share code, notes, and snippets.

@henriklindgren
Created May 8, 2023 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henriklindgren/b5d2168c09d39e306aa3ca42467cf454 to your computer and use it in GitHub Desktop.
Save henriklindgren/b5d2168c09d39e306aa3ca42467cf454 to your computer and use it in GitHub Desktop.
Linux Mint, Mousetrapper Advance 2.0 libinput xorg config, legacy
# /usr/share/X11/xorg.conf.d/50-mousetrapper.conf
#
# using "libinput debug-events --verbose", seems the scroll wheel report in 15 degree increments.
# Vertical scroll under-reports, horizontal works as promised. Not sure if hardware/software issue/choice in mousetrapper or just libinput issue.
Section "InputClass"
Identifier "MouseTrapper"
MatchUSBID "0d24:0010"
# Seems to be no need to match pointer even though it registers on keyboard as well
# MatchIsPointer "true"
Driver "libinput"
Option "NaturalScrolling" "false"
Option "LeftHanded" "false"
Option "TransformationMatrix" "1 0 0 0 1 0 0 0 3"
# not doing anything in libinput 1.15.5 for this mouse
# Option "RotationAngle" "15"
# Option "ScrollPixelDistance" "10"
# Option "HighResolutionWheelScrolling" "false"
EndSection
@SpangeJ
Copy link

SpangeJ commented Oct 12, 2023

Hello @henriklindgren
I'm a user of the MouseTrapper Advance 2.0 too, and I experience some of the same issues as you do.
I would like the MT to:

  • Scroll faster (vertically)
  • Move the cursor faster

I have added your script to /usr/share/X11/xorg.conf.d/, but I'm not sure if it does anything.
Any tips on modifying these parameters?

Here is some output from scrolling when I run libinput debug-events --verbose:

2: event6  - wheel state WHEEL_STATE_NONE → WHEEL_EVENT_SCROLL → WHEEL_STATE_ACCUMULATING_SCROLL
  21: event6  - wheel state WHEEL_STATE_ACCUMULATING_SCROLL → WHEEL_EVENT_SCROLL_ACCUMULATED → WHEEL_STATE_SCROLLING
-event6   POINTER_SCROLL_WHEEL    +0.512s	vert 7.50/60.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.532s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.552s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.568s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.580s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.592s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.612s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.636s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.656s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.680s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.704s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.720s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.744s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.768s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.784s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.804s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.824s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.844s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.864s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.876s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.896s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.920s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.952s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +0.984s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +1.008s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
 event6   POINTER_SCROLL_WHEEL    +1.092s	vert 0.38/3.0* horiz 0.00/0.0 (wheel)
  47: event6  - wheel state WHEEL_STATE_SCROLLING → WHEEL_EVENT_SCROLL_TIMEOUT → WHEEL_STATE_NONE

@henriklindgren
Copy link
Author

henriklindgren commented Nov 7, 2023

@SpangeJ Hi! Sorry, for late reply.

Option "TransformationMatrix" "1 0 0 0 1 0 0 0 3"

For speed, change the "3" in the transformation matrix, it works as a multiplier from what I remember, so try setting it higher.

I have shelved trying to get it to work on xorg, it's supposedly easier to get the scroll working under wayland, but I haven't gotten around to testing it. Tried finding the references I had for what works better under wayland but no luck.

From what I remember, the vertical scroll only triggered an event every so often, and it has to do with how the mouse trapper functions, so there is probably no good workaround under xorg.

@SpangeJ
Copy link

SpangeJ commented Dec 6, 2023

Thank you @henriklindgren

For speed, change the "3" in the transformation matrix, it works as a multiplier from what I remember, so try setting it higher.

I tried playing around with this setting for about a week now (I have to restart after every config change), but what happens is that the cursor speed slows down if I increase it, but I don't think the scrolling speeds up.

I ended up with the setting Option "TransformationMatrix" "1 0 0 0 1 0 0 0 1" along with
Option "HighResolutionWheelScrolling" "true", I am 80% happy, cursor speed is to my satisfaction, the scrolling is smooth, but not fast enough.
I'll let you know if I make any discoveries.

@em-eu
Copy link

em-eu commented Feb 1, 2024

Hello @SpangeJ

Thanks for sharing your setup. Did you change anything else in the meantime?

I added "Scroll Method Enabled" 0, 0, 1 and "Button Scrolling Button" 3 which is a huge improvement to me because that way I can scroll using right click (hold) and the touchpad.

@SpangeJ
Copy link

SpangeJ commented Feb 16, 2024

HI, @em-eu

I have two MouseTrappers, one at home, and one at the office.
The one at home is used with my personal, Windows, computer, but also when I have home-office with my Linux computer.
And they behave the same, they have the same scroll speed.

So I brought my office MouseTrapper home, connected it to my Windows machine, and it was configured automatically, and then it too behaved similarly to the other MT. However; today I brought it back to the office and the behavior is still as before with my Linux i.e. a slow scroll speed.

So maybe I will switch the two MTs around because I do not understand why the two MTs behave differently at my Linux machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment