Disable mouse acceleration linux

How to disable mouse acceleration in Ubuntu 16.04

I checked through the answers currently available, but none of them seems to disable mouse acceleration permanently. xset m 0 0 seems to disable it for a brief moment, but it comes back within minutes. How do I permanently disable mouse acceleration?

6 Answers 6

You can modify certain parameters of the mouse driver permanently, i.e. accross reboots.

First list Xorg input devices.
Results are for my present machine and will be different in yr case.
List Xorg session input devices in terminal (CRTL-ALT+T):

$ xinput --list ⎡ Virtual core pointer [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer [slave pointer (2)] ⎜ ↳ SynPS/2 Synaptics TouchPad [slave pointer (2)] ⎜ ↳ PS/2 Generic Mouse [slave pointer (2)] ⎣ Virtual core keyboard [master keyboard (2)] ↳ Virtual core XTEST keyboard [slave keyboard (3)] ↳ Power Button [slave keyboard (3)] ↳ Video Bus [slave keyboard (3)] ↳ Sleep Button [slave keyboard (3)] ↳ AT Translated Set 2 keyboard [slave keyboard (3)] ↳ HP WMI hotkeys [slave keyboard (3)] 

So my mouse is identified by: «PS/2 Generic Mouse» and has identifier 11. For you it might be different.

Next, to list the mouse properties, do in terminal:

$ xset q | grep -A 1 Pointer Pointer Control: acceleration: 2/1 threshold: 4 

To experiment with zero mouse acceleration parameters,use:

Your device may have other parameters values. You can experiment with them until you are satisfied with the result. Doing so with the cli utility xset allows you to tweak the device parameters on the fly, i.e. without restarting the Xorg session. However those settings will not be preserved across reboots.

You need to make them persistent (until the next driver or system upgrade), by creating a new file in /usr/share/X11/xorg.conf.d/ . For instance:

$ cd /usr/share/X11/xorg.conf.d $ sudo vim 80-mouse-accel-disable.conf Section "InputClass" Identifier "Set mouse acceleration to zero" MatchIsPointer "on" MatchDevicePath "/dev/input/event*" # Default value of mouse acceleration: 2/1 4 # Set AccelerationNumerator to zero to disable Option "AccelerationNumerator" "0" Option "AccelerationDenominator" "1" Option "AccelerationThreshold" "4" EndSection $ sudo chmod 644 80-mouse-accel-disable.conf 

That’s it. You can logout and back in or reboot. In principle yr mouse acceleration should be persistently set to 0.

EDIT: As suggested in one of the comments below, the above may only apply to Ubuntu 14.04 and derived flavors. In later versions the config file syntax and keywords may change slightly, although the general principle of the solution remains valid. See this tip for version 16.04 and (perhaps) later (not tested by me).

Читайте также:  Header files linux location

Источник

Mouse acceleration

Setting the mouse acceleration depends on the windowing protocol you are using: either Xorg or Wayland.

  • On Xorg, there are several ways of setting mouse acceleration
  • by editing Xorg configuration files
  • xorg-xset and xorg-xinput which provide xset and xinput respectively
  • and configuration interfaces common in desktop environments.
  • If you are using Wayland, the events are controlled via libinput. It is the compositor’s job to expose the settings brought by libinput. There is currently no standard way to change settings across compositors.[1]
  • GNOME manages mouse acceleration by itself. A choice between «adaptive» and «flat» profiles can be chosen by installing dconf-editor and editing the value in org/gnome/desktop/peripherals/mouse/acceleration-profile. Alternatively, gnome-tweaks can also be used to edit the org/gnome/desktop/peripherals/mouse/acceleration-profile.

Mouse acceleration with libinput

When using the adaptive pointer acceleration profile, libinput calculates the mouse acceleration depending on the DPI and the parameter Acceleration Speed [2]. libinput relies on the resolution reported by evdev [3]. Feedback settings set with xset m are effectively ignored. When using the flat pointer acceleration profile, the acceleration factor is constant regardless of the velocity of the pointer. This provides 1:1 movement between the device and the pointer on-screen.

Changing the acceleration

Find the id of your device with xinput list and set the acceleration speed with the following command. Note that the acceleration speed has to be in the range of [-1,1]. Check this plot to see the impact of different acceleration speed values.

$ xinput —set-prop ‘libinput Accel Speed’

Confirm your changes with the following:

Persistent configuration

libinput does not store configuration options, it is up to the caller to manage these. Under Wayland configuration is restored by the desktop environment. Under X xf86-input-libinput reads the xorg configuration files and applies the options [4]. To make changes persistent under X create a file like this:

/etc/X11/xorg.conf.d/99-libinput-custom-config.conf
Section "InputClass" Identifier "" MatchDriver "libinput" MatchProduct "" Option "AccelSpeed" "" EndSection

Setting mouse acceleration

In Xorg configuration

This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.

Reason: Do not use comments in code blocks, provide more description in the wiki text instead. (Discuss in Talk:Mouse acceleration)

/etc/X11/xorg.conf.d/50-mouse-acceleration.conf
Section "InputClass" Identifier "My Mouse" MatchIsPointer "yes" # set the following to 1 1 0 respectively to disable acceleration. Option "AccelerationNumerator" "2" Option "AccelerationDenominator" "1" Option "AccelerationThreshold" "4" EndSection
/etc/X11/xorg.conf.d/50-mouse-deceleration.conf
Section "InputClass" Identifier "My Mouse" MatchIsPointer "yes" # some curved deceleration # Option "AdaptiveDeceleration" "2" # linear deceleration (mouse speed reduction) Option "ConstantDeceleration" "2" EndSection

You can also assign settings to specific hardware by using «MatchProduct», «MatchVendor» and other matches inside class sections. Run lsusb to find out the product name and vendor to match:

$ lsusb -v | grep -e idProduct -e idVendor

If you are unable to identify your device, try running xinput list . Some devices the use Logitech Unifying Recceiver share the same USB connection therefore, the mouse do not appear using lsusb

Читайте также:  Linux check permissions on directory

Using xinput

First, get a list of devices plugged in (ignore any virtual pointers):

Take note of the ID. You may also use the full name in commands if the ID is prone to changing.

Get a list of available properties and their current values available for modification with

where 9 is the ID of the device you wish to use. Or

$ xinput list-props "mouse name"

where mouse name is the name of your mouse given by xinput list .

Example, changing the property of Constant Deceleration to 2:

Device 'mouse name': Device Enabled (121): 1 Device Accel Profile (240): 0 Device Accel Constant Deceleration (241): 1.000000 Device Accel Adaptive Deceleration (243): 1.000000 Device Accel Velocity Scaling (244): 10.000000
$ xinput --set-prop "mouse name" "Device Accel Constant Deceleration" 2

To make it permanent, edit Xorg configuration (see above) or add commands to xprofile. The latter will not affect speed in a display manager.

Configuration example

You may need to resort to using more than one method to achieve your desired mouse settings. Here is what I did to configure a generic optical mouse: First, slow down the default movement speed 3 times so that it is more precise.

$ xinput --set-prop 9 'Device Accel Constant Deceleration' 3 &

Then, enable acceleration and make it 3 times faster after moving past 6 units.

If you are satisfied with the results, store the preceding commands in ~/.xinitrc .

Disabling mouse acceleration

Mouse acceleration has changed dramatically in recent X server versions; using xset to disable acceleration does not work as it used to and is not recommended anymore. Recent changes on PointerAcceleration can be read here.

Disabling the mouse acceleration means that a linear function will be used to map from physical to virtual mouse movements. The mouse speed setting controls the inclination of this linear function.

To completely disable any sort of acceleration/deceleration, create the following file:

/etc/X11/xorg.conf.d/50-mouse-acceleration.conf
Section "InputClass" Identifier "My Mouse" MatchIsPointer "yes" Option "AccelerationProfile" "-1" Option "AccelerationScheme" "none" Option "AccelSpeed" "-1" EndSection

with libinput

Alternatively, since libinput -1.1.0-1 and xf86-input-libinput -0.15.0-1 you can use a flat acceleration profile. To enable it create the following file:

/etc/X11/xorg.conf.d/50-mouse-acceleration.conf
Section "InputClass" Identifier "My Mouse" Driver "libinput" MatchIsPointer "yes" Option "AccelProfile" "flat" Option "AccelSpeed" "0" EndSection

and restart X. Notice that under certain conditions (for example if you have a different Pointer Speed value for your mouse in Plasma 5.13) your desktop environment may try to override some of these values even if you have this X configuration file.

Читайте также:  Change keyboard layout in linux console

Another option is this command:

$ xinput --set-prop device-id 'libinput Accel Profile Enabled' 0, 1

Which does not need an X restart, but is not persistent. Although it can be set up to run automatically with Autostarting.

To confirm that acceleration has been disabled, enter the following:

$ xinput list-props 2>/dev/null | grep -F 'libinput Accel Profile Enabled ('

The profile should read 0, 1 .

From KDE Plasma mouse settings

KDE Plasma supports disabling mouse acceleration from the System Settings. Open the System Settings, go to Input Devices > Mouse > Acceleration Profile and select Flat.

  • This settings will only apply when using KDE Plasma.
  • Trying to change the mouse acceleration settings from the KDE Plasma mouse settings in Xorg will not work because of a bug in xf86-input-libinput . Use the #with libinput method as a workaround for this bug.

Источник

How To Completely Disable Mouse Acceleration In Linux

mouse

Some desktop environments don’t provide a way to change the mouse acceleration (GNOME and Unity for instance), and even for those that do (like Cinnamon), you can’t completely turn it off. Here’s how to completely disable mouse acceleration in Linux (for Xorg).

Disabling mouse acceleration is useful for FPS gaming. Mouse acceleration makes the pointer movement depend on the speed with which you move the mouse, accelerating as you move it faster. So moving the mouse across the same distance can have different results, based on movement speed. In FPS games, this can make aiming difficult.

With mouse acceleration disabled, the movement of the pointer is the same as the movement of the mouse, and it doesn’t change based on the movement speed. As a result, your aim should be more accurate in first-person shooters.

To completely disable mouse acceleration, create a file called «50-mouse-acceleration.conf» in xorg.conf.d. The path to xorg.conf.d can vary depending on the Linux distribution you use. For instance, in Ubuntu, Linux Mint, and derivatives, it’s /usr/share/X11/xorg.conf.d/. On Arch Linux, it’s /etc/X11/xorg.conf.d/.

To open an empty 50-mouse-acceleration.conf file in /usr/share/X11/xorg.conf.d/ with Nano (command line text editor; should be installed by default in most Linux distributions), use the following command:

sudo nano /usr/share/X11/xorg.conf.d/50-mouse-acceleration.conf
Section "InputClass" Identifier "My Mouse" MatchIsPointer "yes" Option "AccelerationProfile" "-1" Option "AccelerationScheme" "none" Option "AccelSpeed" "-1" EndSection

Then save the file (to save the file in Nano, use Ctrl + o, then press Enter; to exit, use Ctrl + x). Note that the section just needs an identifier, but the actual name doesn’t matter, so you don’t have to replace «My Mouse» with anything.

Источник

Оцените статью
Adblock
detector