Mouse acceleration

出自 Arch Linux 中文维基

本文內容或本節內容已經過期。

原因: 請提供模板的第一個位置參數以概括原因。 (在Talk:Mouse acceleration討論)

這篇文章或章節的翻譯不反映原文。

原因:Last updated in 2014 (331821), out of sync with English page(在 Talk:Mouse acceleration# 中討論)

這裡有以下幾種方式設置鼠標加速:

  1. 通過設置xorg配置文件
  2. xorg-server-utils[損壞的鏈接:package not found]包提供了這兩個命令讓您能通過Shell和腳本方式來調整鼠標設置:
    • xset
    • xinput
  3. 大部分的desktop environment提供了圖形化的鼠標設置界面,您可以非常容易的找到並使用它。

設置鼠標加速[編輯 | 編輯原始碼]

通過xorg配置文件[編輯 | 編輯原始碼]

參見 xorg.conf(5) 來獲得詳細信息.

範例:

/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

您還可以通過使用"MatchProduct", "MatchVendor" 等設置特定的硬件。

通過使用xset[編輯 | 編輯原始碼]

查看現在的設置,請鍵入以下命令:

$ xset q | grep -A 1 Pointer

如要改變設置,輸入:

$ xset m acceleration threshold

acceleration處輸入想要加快的倍速. threshold為鼠標加速的閥值。

acceleration也可以用分數來表示,如果想要減慢鼠標的移動速度,您可以嘗試1/2, 1/3, 1/4等速率, ... 如果想要更快,您也可以嘗試 2/1, 3/1, 4/1等速率,比如:

$ xset m 3/2 0

as suggested in the man page, then acceleration is treated as "the exponent of a more natural and continuous formula."

如要恢復默認設置:

$ xset m default

獲得更多細節,參見xset(1)頁面.

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

通過使用xinput[編輯 | 編輯原始碼]

首先,列出所有已連接電腦的輸入設備(忽略Virtual pointer):

$ xinput list

記下ID號碼.您也有可能需要記下設備全名當在ID容易改變的情況下。

列出鼠標的所有設置和它們的值:

$ xinput list-props 9

9是您希望使用的設備的ID值

您也可以通過使用下面的命令來達到相同的效果

$ xinput list-props mouse brand

請將mouse brand替換為在$ xinput list中得到的名字

例如,改變Constant Deceleration屬性的值為2:

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

Device Accel Constant Deceleration可以調整鼠標的移動速度。

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

設置範例[編輯 | 編輯原始碼]

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.

$ xset mouse 3 6 &

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

取消鼠標加速[編輯 | 編輯原始碼]

鼠標加速度的在最近的版本的x server中已經發生了很很大的變化;、,所以用xset來改變設置是不成功和不被推薦的。

here頁面中您可以查看PointerAcceleration變化的內容。

想要完全取消鼠標加速、減速, 請創建以下文件:

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

並重啟X。