1

For some time now I was annoyed by behaviour of my mouse, but I was blaming it on surface used, not mouse. Today I got better surface for mousepad and found that I can not use my mouse precisely, using neither wire connected or wireless mouses. After some poking around I found that mouse acceleration is on by default for some reason, and most suggested solutions are:
1) Using command xset m 0 0 (this one looks like working, but does not feels like solid permanent solution)
2) Creating .conf file in /usr/share/X11/xorg.conf.d/ with content like this:

Section "InputClass"
           Identifier "My Mouse"
           Driver "libinput"
           MatchIsPointer "yes"
           Option "AccelProfile" "flat"
EndSection

3) Using xinput set-prop [device-id] [Accel Profile Enabled id] 0,1

But issue is, after I set acceleration profile to "flat" with those methods, my mouse pointer stop moving completely. Mouse does work, left click\right click, it is connected and listed. But any movement is ignored.

For example, we have this property:
libinput Accel Profile Enabled (278): 1, 0
After I run command xinput set-prop 11 278 0, 1 any mouse movement is ignored. After I run xinput set-prop 11 278 1, 0 everything is back to normal.

This happens on both mouses I have.
Question: How to properly disable mouse acceleration in Ubuntu MATE 17.04 and set "flat" profile, and what can cause issues in my case?

Esuil
  • 371
  • 3
  • 13

1 Answers1

1

After searching around I managed to find core of this issue.

Why mouse movement can be ignored after setting flat (no acceleration) profile?

Answer to this question was simple and problem was in libinput pointer setting called Accel Speed. As confusing as it is, when you are using flat no acceleration profile, this setting will actually act as sort of "sensitivity" setting most of the users are used to, but in range of 0% to 200%, corresponding to cursor speed. -1 would be 0%, 0 would be 100%, 1 would be 200% for cursor speed.
From what I understand, when you move your mouse your pointer (cursor) will move on distance of X + X*As, where X is basic value of how much cursor needs to be moved and As is value of Accel Speed option. Which means that if for some reason value of this setting will be -1, which can happen while you try to adjust sensetivity using some GUI for mouse control or by manually setting in, your mouse movement will be calculated like this "X + X*-1", which is basically "X-X", meaning your cursor will not move at all.

So if you have similar problem, first thing you should do is to look on value of this option.

1) List devices with command:
xinput list

2) Find ID of your mouse and use this command to see current values of its options:
xinput list-props 12
Where '12' would be ID of your device from "xinput list" output.

3) If "libinput Accel Speed" is -1 and you are using flat profile, you can change it with command:
xinput --set-prop 12 'libinput Accel Speed' 0

So if you got your mouse stuck after enabling flat profile, simply switching to console\terminal and running those 3 steps will give you ability to fix problem.

I am adding solution I used for disabling acceleration and adjusting Accel Speed just in case someone will stumble on this looking for answer.

How to set flat profile\disable mouse acceleration permanently

To permanently set libinput to flat profile and no change to basic sensetivity, you can just edit this file:
/usr/share/X11/xorg.conf.d/40-libinput.conf
It should have section with identifier "libinput pointer catchall". By default mine looked like this:

[...]
Section "InputClass"
        Identifier "libinput pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection
[...]

You can force it to use specific settings we need by adding two lines after "Driver" line:

[...]
Section "InputClass"
        Identifier "libinput pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
        Option "AccelProfile" "flat"
        Option "AccelSpeed" "0.0"
EndSection
[...]

Option "AccelProfile" will tell system to use flat, no acceleration, profile.
Option "AccelSpeed" will set default for modificator of basic pointer speed, which is pretty much sensitivity. Setting it to "1" will double pointer speed, -1 will set it to 0, 0.5 would make it 150%.

After saving the changes you can just restart GDE with service lightdm restart or just restart PC manually and check if libinput uses correct values now.

By running command:
xinput list-props {1..50} 2>/dev/null | fgrep 'libinput Accel Profile Enabled ('
you can check if system uses flat profile.

For flat profile it should return 0, 1 value like this:
libinput Accel Profile Enabled (282): 0, 1

And check Accel Speed value with similar command:
xinput list-props {1..50} 2>/dev/null | fgrep 'libinput Accel Speed ('
If after restart you have values corresponding to what you set in 40-libinput.conf file, everything works as it should.
For alternative solutions and more information you can lookup those links:
https://wiki.archlinux.org/index.php/Mouse_acceleration#Using_xinput
Configure mouse speed (not pointer acceleration!)

Esuil
  • 371
  • 3
  • 13