Freedom is the Heart of Liberty!
« How To Stop Constant Windows Updates (Windows 10 and 11)Are Polls Really Believable? »

Fixing Your Mouse Sensitivity in Linux

Permalink 12/08/24 18:11, by OGRE / (Jeff), Categories: Welcome, Background, In real life, On the web

I'm sure that this isn't a particularly interesting subject, but if you've used Linux as a desktop OS you might just be interested.

I've become more and more annoyed by Micro$oft as the years have gone by.

That being said, Linux is the obvious choice. Linux has come so far in recent years that it rivals any paid-for operating system -- even for novice users. Linux is stable and runs the same software (for the most part) that you might run on a Windows or a Mac machine.

I'm writing this post on a Toshiba laptop running MX Linux, It was given to me by a relative. It originally had Windows 7 on it. I put 16 gigs of RAM in this machine for $18 after tax. The only downside was that it had a mechanical hard drive, not an SSD, but I fixed that.

I installed MX Linux 23.4 and began setting things up.

I love the OS, it's snappy and things work well. Most of the software I use is preinstalled as part of the standard package.

The only downside was the mouse sensitivity. I'm running the vanilla XFCE version, which allows for lots of configurable options, themes, and tweaks to the GUI to make things look and feel the way you would like them. However, when I plugged in my Logitech M17c wireless mouse, things got squirrelly. So I went to adjust the mouse settings and go about my business, but something was missing!

Normal XFCE mouse settings

Notice there is acceleration and sensitivity.

Here's what I saw.

XFCE mouse settings in MX Linux 23.4

There is no sensitivity. These newer mice all have really high DPI so their sensitivity is insane. That's why mouse pads are now made of super smooth cloth-type material.

Without a sensitivity setting, there was no way to tamp down the overly sensitive mouse. Highlighting things was a nightmare, because 1/16th of an inch of movement was equal to 7 characters of a size 12 font!

After searching for quite some time about how to change the mouse sensitivity I found that the driver used by XFCE had changed, the current one lists different properties than the older one did. It's not that things can't be adjusted, they just have to be adjusted a different way.

More searching revealed that not many people knew how to adjust the mouse sensitivity. Normally with anything Linux related you can find where people have run into and solved the vast majority of issues you might run into. But not this time.

There are commands you can issue that will show what the mouse settings are, but first you have to find out which device it's listed as.

$ xinput -list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad              	id=11	[slave  pointer  (2)]
⎜   ↳ Logitech Wireless Mouse                 	id=13	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Video Bus                               	id=7	[slave  keyboard (3)]
    ↳ Power Button                            	id=8	[slave  keyboard (3)]
    ↳ TOSHIBA Web Camera - HD: TOSHIB         	id=9	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=10	[slave  keyboard (3)]
    ↳ ACPI Virtual Keyboard Device            	id=12	[slave  keyboard (3)]
    ↳ Logitech Wireless Mouse                 	id=14	[slave  keyboard (3)]

Now that you know the device ID you can issue another command to show the properties for that device ID, the Logitech mouse:

$ xinput -list-props 13
Device 'Logitech Wireless Mouse':
Device Enabled (177):	1
Coordinate Transformation Matrix (179):
0.370000, 0.000000, 0.000000,
0.000000, 0.370000, 0.000000,
0.000000, 0.000000, 1.000000
libinput Natural Scrolling Enabled (323):	0
libinput Natural Scrolling Enabled Default (324):	0
libinput Scroll Methods Available (327):	0, 0, 1
libinput Scroll Method Enabled (328):	0, 0, 0
libinput Scroll Method Enabled Default (329):	0, 0, 0
libinput Button Scrolling Button (665):	2
libinput Button Scrolling Button Default (666):	2
libinput Button Scrolling Button Lock Enabled (667):	0
libinput Button Scrolling Button Lock Enabled Default (668):	0
libinput Middle Emulation Enabled (333):	0
libinput Middle Emulation Enabled Default (334):	0
libinput Accel Speed (335):	0.440000
libinput Accel Speed Default (336):	0.000000
libinput Accel Profiles Available (337):	1, 1
libinput Accel Profile Enabled (338):	1, 0
libinput Accel Profile Enabled Default (339):	1, 0
libinput Left Handed Enabled (340):	0
libinput Left Handed Enabled Default (341):	0
libinput Send Events Modes Available (300):	1, 0
libinput Send Events Mode Enabled (301):	0, 0
libinput Send Events Mode Enabled Default (302):	0, 0
Device Node (303):	"/dev/input/event14"
Device Product ID (304):	1133, 16468
libinput Drag Lock Buttons (342):	
libinput Horizontal Scroll Enabled (343):	1
libinput Scrolling Pixel Distance (344):	15
libinput Scrolling Pixel Distance Default (345):	15
libinput High Resolution Wheel Scroll Enabled (346):	1

However, there is no sensitivity setting listed -- only acceleration. This is why it didn't show up under the mouse settings.

The question then becomes, "Is this the result of using a Logitech mouse, or is this a just the way that the XFCE driver works?" It appears that it's at the driver level. I tried multiple different mice, and none of them show properties for sensitivity.

Some versions of Linux use the "evdev" kernel-level driver and others use "libinput" the xorg-driver. That's where the difference is. Apparently the libinput driver is better suited for touch pads from what I've read.

Wanting to modify the OS as little as possible, I looked for some way to adjust the mouse sensitivity natively. Again this was a long and exhaustive search. Eventually I started poking around on my own.

I decided to change the Coordinate Transformation Matrix values. They appear in (3) groups of (3) numbers.

Click for larger image

The first two groups of 3 represent the (x) and (y) coordinates, the last value of 1.000000 needs to be left unchanged, if it is changed to anything other than "1" none of the other changes will take effect. I started by changing all of values of 1.000000 to 5.000000, and nothing changed at all. So then I tried changing them to fractional values, this also resulted in no change. Lastly, I tried changing just the first two from 1 to 5 -- that made the mouse nearly useless it was so sensitive. But there was a change. Next I tried with fractional values and found that the sensitivity was reduced. After messing around with the sensitivity and acceleration I found what worked best with my wireless mouse.

Here's what the optimal settings look like.

$ xinput -list-props 13
Device 'Logitech Wireless Mouse':
	Device Enabled (177):	1
	Coordinate Transformation Matrix (179):
0.370000, 0.000000, 0.000000,
0.000000, 0.370000, 0.000000,
0.000000, 0.000000, 1.000000

The downside is that if I unplug the mouse, or reboot the computer the defaults return. I'm sure there is a way to make the changes persistent, but I wasn't sure what might happen if I use a different mouse at some point. So I decided to write a simple shell script and place it on the desktop so I can double click it and put the mouse settings to where I want them.

#!/bin/sh

# This will set the mouse properties for a Logitech M317 wireless mouse.
# The default sensitivity is too high.

#Mouse Sensitivity
xinput --set-prop 13 179 0.370000, 0.000000, 0.000000, 0.000000, 0.370000, 0.000000, 0.000000, 0.000000, 1.000000

#Mouse Acceleration
xinput --set-prop 13 335 0.500000

exit 0

For now this will suffice. I don't change the mouse that often, and I usually suspend this computer when I'm not using it, so I don't have to change the settings frequently enough to worry about it.

I read many articles where people were searching for a way to adjust the mouse sensitivity -- and that was the only reason that they weren't using Linux as their primary operating system. Maybe this can help someone to make the switch!

Buy me a Ko-Fi 😉👉

Please leave a comment, like it or hate it... You DO NOT need to register to leave a comment. Email addresses are NOT used. Just make one up "someone@somehost.com"

No feedback yet

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)
December 2024
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
I believe that for the United States of America to survive, we will have to get back to our roots.

Search

XML Feeds

free open source blog

©2024 by Jeff Michaels

Contact | Help | Blog theme by Asevo | multiple blogs | web hosts