Kanru’s 探險日誌

當發現美好的事物時,所要做的第一件事,就是把它分享給所有人

Xorg and Logitech V450 Cordless Mouse

with 3 comments

這隻無線老鼠算起來有 7 個鍵(左、右、滾輪、滾輪左、滾輪右、滾輪上、滾輪下),但是 xorg.conf 怎麼設都只有原本的 1~5 個鍵,滾輪左右都沒辦法驅動。

後來試了新的 evdev driver,終於所有的鍵都偵測到了。

xorg.conf:

Section "InputDevice"
    Identifier  "USB Mouse"
    Driver      "evdev"
    Option      "CorePointer"
    Option      "Device"        "/dev/input/event2"
    Option      "Protocol"      "Auto"
EndSection

Xorg.0.log:

(**) USB Mouse-usb-0000:00:1d.0-2/input0: Core Pointer
(II) USB Mouse-usb-0000:00:1d.0-2/input0: Found 4 relative axes.
(II) USB Mouse-usb-0000:00:1d.0-2/input0: Configuring as pointer.
(**) USB Mouse-usb-0000:00:1d.0-2/input0: HWHEELRelativeAxisButtons: 6 7.
(**) USB Mouse-usb-0000:00:1d.0-2/input0: WHEELRelativeAxisButtons: 4 5.

但是這個問題其實沒有想像中簡單,因為根據 evdev(4)

       Option "Device" "string"
              Specifies the device  note  through  which  the  device  can  be
              accessed.   At  this time ONLY /dev/input/event<N>, where <N> is
              an integer, are matched against this this field.
              This option uses globbing.
              Please note that use of this option is strongly discouraged.

因為 /dev/input/event<N> 會隨 usb 的插入順序而改變,所以並不是一個很好的介面來設定滑鼠。而使用 udev 萊特製 device name 也行不通,因為 evdev 不認得。所以要改用 evdev(4) 推薦使用的用 <map>Bits 的方法來設定,通常使用以下的設定就可以抓到滑鼠:

Section "InputDevice"
    Identifier "mouse"
    Driver "evdev"
    Option "evBits"  "+1-2"
    Option "keyBits" "~272-287"
    Option "relBits" "~0-2 ~6 ~8"
    Option "Pass"    "3"
         ...
EndSection

可是不知道為什麼只要一使用到 <map>Bits 來設定,每次啟動 X 的時候都會 block 在某個地方,只能用 ssh 進去把 X 砍掉。而使用 “Name” 的方法來設定也不行,因為這隻 V450 很奇怪,在 /proc/bus/input/devices 裡面會顯示兩個 “Logitech USB Receiver” 的節點,其中一個被顯示為 kbd 設備…。

I: Bus=0003 Vendor=046d Product=c518 Version=4203
N: Name="Logitech USB Receiver"
P: Phys=usb-0000:00:1d.0-2/input0
S: Sysfs=/class/input/input2
H: Handlers=mouse1 event2 
B: EV=7
B: KEY=ffff0000 0 0 0 0 0 0 0 0
B: REL=143

I: Bus=0003 Vendor=046d Product=c518 Version=4203
N: Name="Logitech USB Receiver"
P: Phys=usb-0000:00:1d.0-2/input1
S: Sysfs=/class/input/input3
H: Handlers=kbd event3 
B: EV=f
B: KEY=c0002 400 0 0 1 f80 78000 6639fa d84157ad 8e0000 0 0 0
B: REL=40
B: ABS=1 0

最後我還是暫時用 /dev/input/event2 來設定。

待補: References, xinput

※ 歷史上的今天

Written by Kanru Chen

September 23rd, 2006 at 11:03 pm

Posted in Linux

3 Responses to 'Xorg and Logitech V450 Cordless Mouse'

Subscribe to comments with RSS or TrackBack to 'Xorg and Logitech V450 Cordless Mouse'.

  1. You can use

    Option “Phys” “USB-0000:00:1d.0-2/input0″

    Ref: http://news.gmane.org/group/gmane.linux.kernel.console/last=/force_load=t

    Follow the discussion at “faketty is not needed with XOrg-7.x”

    Hong-Hsing Liu

    3 Oct 06 at 2:29 am

  2. @Hong-Hsing Liu:

    這個 “Phys” 的屬性,就像字面上寫的一樣,是跟 USB 的實際 Port 有關的,所以如果我的接收器換了位置,那麼這個值就會跟著變動。我的筆電上面有兩個 USB Port,平常也不一定會插什麼東西上去,所以我沒有用 “Phys” 來當作接收器的代號。

    kanru

    3 Oct 06 at 12:51 pm

Leave a Reply