Mouse acceleration (日本語)
マウスのアクセラレーションを設定する方法はいくつかあります:
- xorg の設定ファイルを編集する
- xorg-server-utils パッケージにはシェルやスクリプトから設定を変えるためのプログラムが2つ入っています:
-
xset -
xinput
-
- ほとんどのデスクトップ環境にはマウスを設定するための設定 GUI が備わっています。簡単に使えるはずです。
Contents |
マウスのアクセラレーションを設定する
xorg 設定
詳しくは man xorg.conf を見て下さい。
例:
/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
class セクションの中で "MatchProduct", "MatchVendor" などの match を使うことで、特定のハードウェアだけに設定を適用することもできます。
xset を使う
現在の値を知るには:
xset q | grep -A 1 Pointer
新しい値をセットするには:
xset m ACCELERATION THRESHOLD
ACCELERATION で設定された倍だけデフォルトよりはやく動き、マウスを最小 THRESHOLD ピクセル以上動かすと動きだします。ACCELERATION は分数にすることもでき、マウスをスローダウンさせたいなら 1/2。3 では速すぎるが、2では遅すぎるときには 5/2 などにします。
デフォルトの設定に戻すには:
xset m default
詳しい情報は man xset を見て下さい。
設定を永続的にするには、xorg の設定(上記)をするか xprofile (日本語) にコマンドを加えます。後者は Display Manager (日本語) に速度的な影響がありません。
xinput を使う
まず、接続されているデバイスのリストを得ます (バーチャルポインタは無視します):
xinput list
ID を覚えておいてください。ID が変わってしまう場合、コマンドでフルネームを使うこともできます。
利用できるプロパティと現在の値のリストを得ます
xinput list-props 9
9 は使いたいデバイスの ID です。もしくは名前を使います
xinput list-props 'Bobs mouse brand'
Bobs mouse brand は xinput list によって表示されたマウスの名前にしてください
例として、Constant Deceleration プロパティを 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
設定を永続的にするには、xorg の設定(上記)をするか xprofile (日本語) にコマンドを加えます。後者は Display Manager (日本語) に速度的な影響がありません。
設定サンプル
あなたの期待通りのマウス設定をするには複数の方法を使わなくてはいけないかもしれません。一般的なオプティカルマウスを設定のサンプルです:
~/.xinitrc
# First, slow down the default movement speed 3 times so that it's more precise. xinput --set-prop 9 'Device Accel Constant Deceleration' 3 & # Then, enable acceleration and make it 3 times faster after moving past 6 pixels. xset mouse 3 6 &
マウスのアクセラレーションの無効化
マウスのアクセラレーションは最近の X サーバーのバージョンでは劇的に変わりました、xset を使ってアクセラレーションを無効化することは今までのようにはできませんし推奨されません。
最近の PointerAcceleration での変更はここで読むことができます。
全てのアクセラレーション/デクラレーションを無効化するには、次のファイルを作ります:
/etc/X11/xorg.conf.d/50-mouse-acceleration.conf
Section "InputClass" Identifier "My Mouse" MatchIsPointer "yes" Option "AccelerationProfile" "-1" Option "AccelerationScheme" "none" EndSection