マウスマルチメディアボタンは "/dev/input/eventX"でイベントを生成しません。

マウスマルチメディアボタンは

プログラム可能なボタンが複数あり、その半分がマルチメディアボタンに設定されているマウス(Canyon CND-SGM14RGB)があります。設定ソフトウェアはWindows専用で、特別なドライバがなくてもボタンはWindowsで正常に動作します。

ただし、Linuxでは、標準のマウスアクション(lmb、rmb、中央、前後に)にマップされたボタンのみが機能します。マルチメディアボタンが機能しません。


次の診断手順を試しました。

  1. スタートwevxevウェイランドの代替)し、すべてのボタンを押します。

    通常のボタンは機能しますが、マルチメディアボタンは機能しません。

  2. cat /dev/input/eventX新しいデータを実行して検索します。

    マウスに関連する2つのファイルによると、それらの/proc/bus/input/devices1つは一般的なマウス活動を行うときにゴミを作成しますが、どちらのファイルもマルチメディアボタンを押すと音はしません。

  3. Wiresharkを起動し、マウスパケットを見つけた結果、次のものが見つかりました。

    • ハンドシェイク(???)デバイス2.27.0(バス2、デバイス27、エンドポイント0)から送信されました
    • 通常のマウスイベント(で発生したイベント/dev/input/eventX)はデバイス2.27.1で送信されます。
    • マルチメディアボタン押下は、デバイス2.27.2で送信されます。

このボタンを正しく機能させる方法はありますか?必要に応じてWiresharkダンプファイルを提供できます。

編集1:lsusb出力

Bus 002 Device 027: ID 258a:0027 SINOWEALTH Wired Gaming Mouse
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x258a 
  idProduct          0x0027 
  bcdDevice            1.02
  iManufacturer           1 SINOWEALTH
  iProduct                2 Wired Gaming Mouse
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x003b
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              480mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      71
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      1 Keyboard
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     213
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
Device Status:     0x0000
  (Bus Powered)

編集2:関連libinput list-devices出力

Device:           SINOWEALTH Wired Gaming Mouse
Kernel:           /dev/input/event9
Group:            9
Seat:             seat0, default
Capabilities:     pointer 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      disabled
Nat.scrolling:    disabled
Middle emulation: disabled
Calibration:      n/a
Scroll methods:   button
Click methods:    none
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles:   flat *adaptive
Rotation:         n/a

Device:           SINOWEALTH Wired Gaming Mouse Keyboard
Kernel:           /dev/input/event10
Group:            9
Seat:             seat0, default
Capabilities:     keyboard 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      n/a
Nat.scrolling:    n/a
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles:   n/a
Rotation:         n/a

ベストアンサー1

bInterfaceClass         3 Human Interface Device
bInterfaceSubClass      1 Boot Interface Subclass
bInterfaceProtocol      1 Keyboard

マウスは通常のUSB HIDプロトコルを使用せずに別々のプロトコルを使用しているようです。USB HIDブートプロトコルusbkbd、別のカーネルモジュールによって処理されますusbmouse。ほとんどのUSBマウスはhidこのプロトコルを好み、一部のディストリビューションではマウスの起動プロトコルドライバを自動的にロードできない場合があります。

このusbhidモジュールは通常、通常のUSBマウスとキーボードデバイスとして認識されるすべてのデバイスを宣言するため、マウスの実行プロトコルドライバに明示的に優先順位を付ける必要があるかもしれません。

/etc/modprobe.d/canyonmouse.conf次の内容を含むファイルを作成します。

# Prioritize boot protocol for the multimedia keys of this mouse
install usbhid /sbin/modprobe usbkbd; /sbin/modprobe -i usbhid
alias usb:v258ap0027* usbkbd

このファイルを作成したら、initrd / initramfsファイルを更新する必要があります。

これにより、キーボード起動プロトコルモジュールがモジュールの前にロードされるように強制し、ドライバが引き継がれるusbhid前にマウス(特に「キーボード」インタフェース)を制御する機会を提供します。usbhid

Webベースのリモート管理接続のキーストロークに応答するAST2400ベースのリモート管理インターフェースをサーバーに持たせるには、同じ操作を実行する必要がありました。リモート管理接続は、サーバーに仮想マウスとキーボードデバイスを提供することがわかりました。 、どちらも実行プロトコルのみをサポートします。マウス機能の場合、これは問題ではありませんが、実行プロトコルのみをサポートするキーボードは非常にまれで、まだ自動的にはサポートされていません。

HIDブートプロトコルを使用する必要が非常にまれなため、一部のディストリビューション(Debian 11など)は標準のカーネルでブートプロトコルドライバの提供を中止しました。したがって、root権限が原因でモジュールが利用できないというエラーが発生した場合は、カーネルビルド時間設定オプションを使用して代替/カスタムカーネルを有効にする必要がmodprobe usbkbdあります。CONFIG_USB_KBD

おすすめ記事