I have Linux Mint 19.3 (MATE x64), and I have a Logitech G402 mouse I would like to use with it.

Using the default settings, my cursor moves exactly 50 times faster than I would like it to move.

I have tried all manner of settings to make my cursor go slower, but they just don't work.

The pointer speed settings (Start Menu -> Preferences -> Mouse) barely make a difference, even if I set them to their absolute minimum.

Here's the output of xinput with default settings:

$ xinput list-props "Logitech Gaming Mouse G402"
Device 'Logitech Gaming Mouse G402':
    Device Enabled (155):   1
    Coordinate Transformation Matrix (157): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    libinput Natural Scrolling Enabled (292):   0
    libinput Natural Scrolling Enabled Default (293):   0
    libinput Scroll Methods Available (294):    0, 0, 1
    libinput Scroll Method Enabled (295):   0, 0, 0
    libinput Scroll Method Enabled Default (296):   0, 0, 0
    libinput Button Scrolling Button (297): 2
    libinput Button Scrolling Button Default (298): 2
    libinput Middle Emulation Enabled (299):    1
    libinput Middle Emulation Enabled Default (300):    0
    libinput Accel Speed (301): 0.000000
    libinput Accel Speed Default (302): 0.000000
    libinput Accel Profiles Available (303):    1, 1
    libinput Accel Profile Enabled (304):   1, 0
    libinput Accel Profile Enabled Default (305):   1, 0
    libinput Left Handed Enabled (306): 0
    libinput Left Handed Enabled Default (307): 0
    libinput Send Events Modes Available (277): 1, 0
    libinput Send Events Mode Enabled (278):    0, 0
    libinput Send Events Mode Enabled Default (279):    0, 0
    Device Node (280):  "/dev/input/event5"
    Device Product ID (281):    1133, 49278
    libinput Drag Lock Buttons (308):   <no items>
    libinput Horizontal Scroll Enabled (309):   1

The only option here that can affect my cursor speed is the Coordinate Transformation Matrix (also Accel Speed, but that doesn't go past -1 and I would need it to go way past -1). If I set it to 1 0 0 0 1 0 0 0 50, my cursor speed is properly divided by 50. However a nonstandard Coordinate Transformation Matrix will cause games that capture the cursor (e.g. Minecraft) to work improperly, resetting the cursor to almost the top left corner of the screen everytime the cursor is freed, and making my character rotate wildly towards the top left while it is captured.

It looks to me like I've run out of options to make my mouse work properly using intended methods, so I feel like I have to edit some source code to make my cursor go at reasonable speeds, as crazy as it sounds. I'm so desperate that I'd be ready to slap a hardcoded / 50.0 somewhere into some C code, compile, install, and call it a day, but unfortunately I have no idea where to slap it.

Of course we're all probably aware that this is a monster of an XY question I'm asking here, so if there are more options to configure my cursor which I just failed to find or Google for several days, then I'd be happy to know about them.

1 Answer 1


I found the relevant code in libinput, in filter-low-dpi.c. I divided the return value of function calculate_acceleration_factor by 50.0, then compiled and installed as per the instructions.

If you have similar issues, depending on your mouse model you might need to edit filter-mouse.c instead.

  • Just had to recompile my change in a newer version of libinput after the package repository libinput version finally caught up with the version of my old libinput build. If you use this solution, you will want to check for libinput updates in the update manager package list to avoid being caught off guard.
    – Magma
    Jan 31, 2021 at 13:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .