How to set mouse speed in X using xset or XF86Config

88 篇文章 0 订阅
53 篇文章 0 订阅

转自Setting the mouse speed in X


1. Changing the mouse speed on the fly using xset

The syntax for setting the mouse acceleration and threshold using xset is

xset m acceleration threshold

The first argument, "acceleration", is a multiplier number that defines how many times faster than the standard speed the cursor will move. Try numbers between 2 and 5, setting a high multiplier like 9 makes the mouse movements very jerky and jumpy. This does not need to be a whole number, you can use 1/2 to get half the standard speed or 5/2 (=2.5) if 2 is too slow and 3 is too fast.

The second argument, threshold(阈值), defines how many pixels the mouse must move in a short period of time before the acceleration setting is used. Using a threshold of 1, as in xset m 5 1, disables this and gives you the same mouse speed at all times. Setting xset m 5 10 requires the mouse the move to move 10 pixels before the pointer is accelerated.

'xset m 5 1' is known to be a good setting.

xset m default returns the standard setting.

Add xset to ~/.xinitrc to get your desired mouse speed when X starts.

2. Setting the mouse speed in XF86Config

The mouse is configured in the file X config file XF86Config ('/etc/X11/XF86Config' or '/etc/X11/XF86Config-4').

Find the section named "InputDevice":

   Section "InputDevice"
           Identifier  "Mouse0"
   Driver      "mouse"
           Option      "Protocol" "imps/2"
           Option      "Device" "/dev/mouse"
           Option      "ZAxisMapping" "4 5"
           Option      "Resolution" "500"
   EndSection

The Resolution option will set the mouse device resolution to N counts per inch. Not all mice and OS support this option, and this forces this setting on all users. USB mouse generally do not support setting the mouse speed this way.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值