最終更新:2019-02-03 (日) 08:15:55 (1901d)  

レポートディスクリプタ/マウス

メモ

3ボタンマウスの例

レポートディスクリプタ

  • 左側がレポートのバイナリ。右のは説明。
    05 01  G Usage Page (Generic Desktop), ;Use the Generic Desktop Usage Page
    09 02  L Usage (Mouse),  
    A1 01  M Collection (Application), ;Start Mouse collection
    09 01  L  Usage (Pointer),  
    A1 00  M  Collection (Physical), ;Start Pointer collection
    05 09  G   Usage Page (Buttons), 
    19 01  L   Usage Minimum (01), 
    29 03  L   Usage Maximum (03), ;3 Button
    15 00  G   Logical Minimum (0),  
    25 01  G   Logical Maximum (1), ;Fields return values from 0 to 1
    95 03  G   Report Count (3),  ;Create three 1 bit fields (button 1, 2, & 3)
    75 01  G   Report Size (1), 
    81 02  M   Input (Data, Variable, Absolute), ;3 button bits 
    95 01  G   Report Count (1), 
    75 05  G   Report Size (5), ;Create 5 bit constant field
    81 01  M   Input (Constant),   ;5 bit padding 
    05 01  G   Usage Page (Generic Desktop), 
    09 30  L   Usage (X),  
    09 31  L   Usage (Y), 
    15 81  G   Logical Minimum (-127),  
    25 7F  G   Logical Maximum (127),  ;Fields return values from -127 to 127
    75 08  G   Report Size (8),  
    95 02  G   Report Count (2),   ;Create two 8 bit fields (X & Y position)
    81 06  M   Input (Data, Variable, Relative), ;2 position bytes (X & Y) 
    C0     M  End Collection,  ;Close Pointer collection
    C0     M End Collection ;Close Mouse collection

定義されたレポート

  • バイト012
    ビット765432107654321076543210
    Paddingボタン3ボタン2ボタン1XY
  • バイナリをエンコード/デコードするHID Descriptor Toolというツールが用意されている。

関連