加藤(大阪)です。
Wed, 29 Apr 2009 00:15:26 +0900 付
Daisuke SUZUKIさんのメールより:
> マウスは基本的には X では evdev でつかわれ、HAL で認識されます。
> ただ、環境によって認識の仕方が微妙で、手元の Logicool VX Revolution では
> ボタン14まで自動的に認識して水平スクロールも横の戻る進むボタンなどもうご
> いているのですが、他の環境で おなじマウスをつかっても認識がちがったりし
> ます。
> # ちょっと調べてみますが、、まだ原因がつかめていません。。
こちらでもいろいろやってみました。
教えていただいた HAL 関連から、lshal コマンドで、マウス関連とロジクール
(→Logitech) 関連の記述を探してみると、
access_control.file = '/dev/input/event0'
access_control.file = '/dev/input/event2'
という箇所が見つかりました。
前者は、
udi = '/org/freedesktop/Hal/devices/computer_logicaldev_input'
access_control.type = 'mouse'
後者は、
udi = \
'/org/freedesktop/Hal/devices/usb_device_46d_c50e_noserial_if0_logicaldev_input'
access_control.type = 'mouse'
とあり、共にマウスとして認識されているようでした。
(後者は、
info.product = 'Logitech USB RECEIVER'
とありましたので、コードレスマウスの受信機として認識されているのかも知れ
ません)
又、
$ less /proc/bus/input/devices
で調べた所、それぞれのデバイス名 '/dev/input/event0'、
と、'/dev/input/event2' に対応するものとして、
H: Handlers=mouse0 event0
H: Handlers=mouse1 event2
が見られ、それぞれ mouse0、mouse1 という識別名だと推測しました。
で、web 上の情報などを参考に、xorg.conf の "ServerLayout" セクションを、
Section "ServerLayout"
Identifier "single head configuration"
Screen 0 "Screen0" 0 0
InputDevice "mouse0" "CorePointer"
InputDevice "mouse1" "Always Core" ← 追加
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
とし、マウス関連の "InputDevice" セクションを、
Section "InputDevice"
Identifier "mouse0" ← /proc/bus/input/devices での識別名
Driver "mouse"
Option "Protocol" "ExplorerPS/2"
Option "Device" "/dev/input/event0" ← lshal でのデバイス名
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection
Section "InputDevice"
Identifier "mouse1" ← /proc/bus/input/devices での識別名
Driver "evdev"
Option "Protocol" "ExplorerPS/2"
Option "Device" "/dev/input/event2" ← lshal でのデバイス名
EndSection
と、修正し、X を再起動すると、ボタン 1 〜 ボタン 7 まで、全て認識された
のが xev で確認出来ました。
試してみた所、これで firefox、sylpheed、gimp でも、縦横スクロールが出来
るようになりました。
ちなみにこちらのマウスは、
http://www.logicool.co.jp/index.cfm/428/150&hub=1&selectedcrid=398&selectedcid=150&cl=jp,ja
このタイプで、コードレス/光学式で、ホイールをチルトするタイプの 5ボタン
マウスです。
又、xev では、ボタン 6 (ホイール左チルト)の操作では button 6 と共に 11
が、ボタン 7 (ホイール右チルト)の操作では button 7 と共に 12 が、出力さ
れていますが、このマウスでの操作には影響ないようです。
この情報が、他の(コードレス)マウスにも適用出来るかどうかは不明ですが。。。
--
加藤 雅 <mkato@xxxxxxxxxxxxx>
http://add10.hp.infoseek.co.jp/rox/
http://www2.odn.ne.jp/add10/fluxbox/