Difference between revisions of "Mouse acceleration"

From ArchWiki
Jump to: navigation, search
(Add instructions for xinput deceleration)
(reorganization/rewrite, I hope the examples work as I haven't tried them)
Line 1: Line 1:
[[Category:X Server (English)]][[Category:HOWTOs (English)]][[Category:Mice (English)]]
+
[[Category:X Server (English)]]
Mouse acceleration settings typically can be configured using tools provided by your desktop environment. Alternatively, Xorg supplies similar methods more directly, using the '''xset''' command. Along with sensitivity, your mouse speed is controlled by acceleration and threshold levels. The command synopsis is <code>xset m acceleration threshold</code>.
+
[[Category:HOWTOs (English)]]
 +
[[Category:Mice (English)]]
  
For example:
+
There are several ways of setting mouse acceleration:
<pre>
+
xset m 4 1
+
</pre>
+
  
''Acceleration'' defines how many times faster the cursor will move than the default speed, when the cursor moves more than ''threshold'' pixels in a short time. ''Acceleration'' can be a fraction, so if you want to slow down the mouse you can use 1/2, and if 3 is slightly too fast, but 2 is too slow, you can use 5/2. You effectively disable the threshold by setting it to 1, that way the cursor will always move the same speed. To get the default settings back, type <code>xset m default</code>.  
+
# by editing xorg configuration files
 +
# the {{Package Official|xorg-server-utils}} package provides two programs that can be used to change those settings from a shell or a script:
 +
#* {{Codeline|xset}}
 +
#* {{Codeline|xinput}}
 +
# many [[Desktop Environment]]s provide a configuration GUI for mouse settings. They should be easy to find and use.
  
===Decelerating A Mouse===
+
 
When your device is too fast even with acceleration disables you can use xinput to set deceleration.
+
== Setting mouse acceleration ==
 +
 
 +
=== In xorg configuration ===
 +
 
 +
See {{Codeline|man xorg.conf}} for details.
 +
 
 +
Examples:
 +
 
 +
{{File|name=/etc/X11/xorg.conf.d/50-mouse-acceleration.conf|content=<nowiki>
 +
Section "InputDevice"
 +
Option "AccelerationNumerator" "2"
 +
Option "AccelerationDenominator" "1"
 +
Option "AccelerationThreshold" "4"
 +
EndSection
 +
</nowiki>}}
 +
 
 +
{{File|name=/etc/X11/xorg.conf.d/50-mouse-deceleration.conf|content=<nowiki>
 +
Section "InputDevice"
 +
Option "AdaptiveDeceleration" "2"
 +
EndSection
 +
</nowiki>}}
 +
 
 +
=== Using xset ===
 +
 
 +
To get the current values, use:
 +
xset q | grep -A 1 Pointer
 +
 
 +
To set new values, type:
 +
xset m ACCELERATION THRESHOLD
 +
 
 +
where ACCELERATION defines how many times faster the cursor will move than the default speed, when the cursor moves more than THRESHOLD pixels in a short time. ACCELERATION can be a fraction, so if you want to slow down the mouse you can use 1/2, and if 3 is slightly too fast, but 2 is too slow, you can use 5/2, etc.
 +
 
 +
To get the default settings back:
 +
xset m default
 +
 
 +
For more info see {{Codeline|man xset}}.
 +
 
 +
To make it permanent, edit xorg configuration (see above) or add commands to [[xprofile]]. The latter won't affect speed in a [[Display Manager]].
 +
 
 +
=== Using xinput ===
 +
 
 +
First, get a list of devices plugged in (ignore any virtual pointers):
 
  xinput list
 
  xinput list
gives a list of devices plugged in (ignore any virtual pointers). Take not of the ID. You may also use the full name in commands if the ID is prone to changing.
+
 
 +
Take not 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
 
Get a list of available properties and their current values available for modification with
 
  xinput list-props 9
 
  xinput list-props 9
where 9 is the ID of the device you wish to use. Or
+
 
 +
where {{Codeline|9}} is the ID of the device you wish to use. Or
 
  xinput list-props 'Bobs mouse brand'
 
  xinput list-props 'Bobs mouse brand'
where 'Bobs mouse brand' is the name of your mouse given by ''xinput list''
+
 
;eg:
+
where {{Codeline|Bobs mouse brand}} is the name of your mouse given by {{Codeline|xinput list}}
 +
 
 +
Example, changing the property of {{Codeline|Constant Deceleration}} to 2:
 
  $ xinput list-props 9
 
  $ xinput list-props 9
 
  Device 'Bobs mouse brand':
 
  Device 'Bobs mouse brand':
Line 26: Line 74:
 
         Device Accel Adaptive Deceleration (243):      1.000000
 
         Device Accel Adaptive Deceleration (243):      1.000000
 
         Device Accel Velocity Scaling (244):    10.000000
 
         Device Accel Velocity Scaling (244):    10.000000
;eg, Change the property of Constant Deceleration to 2:
 
 
  $ xinput --set-prop 'Bobs mouse brand' 'Device Accel Constant Deceleration' 2
 
  $ xinput --set-prop 'Bobs mouse brand' 'Device Accel Constant Deceleration' 2
  
===Disabling mouse acceleration===
+
To make it permanent, edit xorg configuration (see above) or add commands to [[xprofile]]. The latter won't affect speed in a [[Display Manager]].
  
Mouse acceleration has changed dramatically in recent X server's, using 'xset' to disable acceleration doesn't work as it used to, and now is not recommend to use.
+
== Disabling mouse acceleration ==
  
Recent changes on ''''PointerAcceleration'''' can be read [http://xorg.freedesktop.org/wiki/Development/Documentation/PointerAcceleration#Introduction here]
+
Mouse acceleration has changed dramatically in recent X server versions, using {{Codeline|xset}} to disable acceleration doesn't work as it used to and is not recommended anymore.
 
+
 
+
The current way of completely disabling any sort of accele/decele(ration) in xorg.conf are using two options;
+
 
+
Option "AccelerationProfile" "-1"
+
disables 'velocity-dependent pointer acceleration or deceleration' (which ignores 'xset m' commands.)
+
 
+
Option "AccelerationScheme" "none"
+
disables all acceleration/deceleration (ignores 'ConstantDeceleration' option)
+
 
+
Option "Sensitivity" ".5"
+
 
+
optional setting to slow the pointer speed to desired level.
+
 
+
 
+
example '''xorg.conf''' with mouse options;
+
 
+
Section "ServerLayout"
+
Identifier "l0"
+
Screen 0 "s0" 0 0
+
Option "AIGLX" "0"
+
EndSection
+
+
Section "ServerFlags"
+
Option "AutoAddDevices" "0"
+
Option "NoPM" "1"
+
EndSection
+
+
Section "InputDevice"
+
Identifier "i0"
+
Driver "mouse"
+
Option "Device" "/dev/input/mice"
+
Option "Sensitivity" ".5"
+
Option "AccelerationProfile" "-1"
+
Option "AccelerationScheme" "none"
+
Option "ExpectedRate" "1000"
+
Option "VelocityScale" "1
+
Option "AdaptiveDeceleration" "1"
+
Option "ConstantDeceleration" "1"
+
Option "Emulate3Buttons" "0"
+
EndSection
+
+
Section "Device"
+
Identifier "v0"
+
Driver "nvidia"
+
Option "ConnectedMonitor" "DFP"
+
Option "DynamicTwinView" "0"
+
EndSection
+
+
Section "Screen"
+
Identifier "s0"
+
Device "v0"
+
EndSection
+
+
Section "Extensions"
+
Option "DAMAGE" "0"
+
Option "XINERAMA" "0"
+
Option "MIT-SCREEN-SAVER" "0"
+
Option "Composite" "0"
+
EndSection
+
 
+
===Query currently used settings===
+
The current acceleration/threshold settings can be checked using:
+
 
+
xset q | grep -A 1 Pointer
+
  
==Making changes permanent==
+
Recent changes on {{Codeline|PointerAcceleration}} can be read [http://xorg.freedesktop.org/wiki/Development/Documentation/PointerAcceleration#Introduction here].
You can add the xset command to your ~/.xinitrc to get the desired mouse speed every time X starts.
+
  
For more info see <code>man xset</code>.
+
To completely disable any sort of acceleration/deceleration, create the following file:
 +
{{File|name=/etc/X11/xorg.conf.d/50-mouse-acceleration.conf|content=<nowiki>
 +
Section "InputDevice"
 +
Option "AccelerationProfile" "-1"
 +
Option "AccelerationScheme" "none"
 +
EndSection
 +
</nowiki>}}

Revision as of 15:55, 30 July 2010


There are several ways of setting mouse acceleration:

  1. by editing xorg configuration files
  2. the Template:Package Official package provides two programs that can be used to change those settings from a shell or a script:
  3. many Desktop Environments provide a configuration GUI for mouse settings. They should be easy to find and use.


Setting mouse acceleration

In xorg configuration

See Template:Codeline for details.

Examples:

Template:File

Template:File

Using xset

To get the current values, use:

xset q | grep -A 1 Pointer

To set new values, type:

xset m ACCELERATION THRESHOLD

where ACCELERATION defines how many times faster the cursor will move than the default speed, when the cursor moves more than THRESHOLD pixels in a short time. ACCELERATION can be a fraction, so if you want to slow down the mouse you can use 1/2, and if 3 is slightly too fast, but 2 is too slow, you can use 5/2, etc.

To get the default settings back:

xset m default

For more info see Template:Codeline.

To make it permanent, edit xorg configuration (see above) or add commands to xprofile. The latter won't affect speed in a Display Manager.

Using xinput

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

xinput list

Take not 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

xinput list-props 9

where Template:Codeline is the ID of the device you wish to use. Or

xinput list-props 'Bobs mouse brand'

where Template:Codeline is the name of your mouse given by Template:Codeline

Example, changing the property of Template:Codeline to 2:

$ xinput list-props 9
Device 'Bobs mouse brand':
       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 'Bobs mouse brand' 'Device Accel Constant Deceleration' 2

To make it permanent, edit xorg configuration (see above) or add commands to xprofile. The latter won't affect speed in a Display Manager.

Disabling mouse acceleration

Mouse acceleration has changed dramatically in recent X server versions, using Template:Codeline to disable acceleration doesn't work as it used to and is not recommended anymore.

Recent changes on Template:Codeline can be read here.

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