最終更新:2015-04-03 (金) 18:21:13 (1603d)  

Windows/デバイスドライバ/マルチタッチ はてなブックマークを見る
Top / Windows / デバイスドライバ / マルチタッチ

ドライバの提供方法

HIDデバイスの場合

  • Windows 7Windows Touchをサポートする場合、HIDデバイスならば、Windows 7標準のデバイスドライバが動くので、デバイスドライバを開発/提供しなくても良い。
  • The report descriptor for a multiple input device must include at least one top-level collection for the primary device and a separate top-level collection for the mouse.

HIDデバイスの場合

  • デバイスがHIDをサポートしない場合、HIDをシミュレートするドライバを含めなければならない。
  • ドライバを提供する場合、KMDFでLowerフィルタドライバを提供するのがオススメ。
    • Your driver should provide the same functionality as a HID minidriver, but register as a filter driver under a minimal WDM driver (also known as a shim driver). A shim driver is necessary because KMDF 1.9 does not natively support HID minidrivers. In Windows 7 and later versions of Windows, you can use the system-supplied Mshidkmdf.sys driver as a shim.
  • The report descriptor for a multiple input device must include at least one top-level collection for the primary device and a separate top-level collection for the mouse.

どちらにせよ

MSDN

Windows 8

Windows 7

ドキュメント

メモ

ドライバフレームワーク

  • KMDF:Elotouch Driverサンプル
  • UMDF:HIDのミニポートドライバは書けない。
  • WDM:新しいドライバ開発には推奨しない。

Windowsへの認識のさせ方

  • Multi-touch devices are a superset of HID touch devices
  • Use existing HID touch usages, but additionally report HID contact id and max number of supported contacts

レポートディスクリプタ

関連するUsage Page

デバイスクラス

  • Multitouch digitizers appear to the operating system as HID digitizers and not as a mouse or other proprietary device
  • Windows Touch is not available to devices that are not identified as HID digitizers. As defined in the USB HID Usage Tables specification, this identification consists of the digitizer page (0x0D), along with usage ID 0x04 to specify the Collection Application for touch screens.

Required HID Usages

Optional usages

  • Confidence (0x0D, 0x47) - 意図されたタッチかどうか
  • Width and height (0x0D, 0x48 and 0x49)
  • Pressure (page 0x0D, usage 0x30)

HID Additions to Support Multitouch

  • The HID Usage Tables define the following usages for multitouch input from digitizers. Windows 7 supports these multitouch usages, and vendors should implement them in devices and drivers.
    Usage IDNameDescriptionPageType
    0x51Contact identifierContact identifier0x0D DigitizerDynamic Value (DV)
    0x0EConfigurationConfiguration0x0D DigitizerCollection Application (CA)
    0x52Device modeInput mode0x0D DigitizerDV
    0x23Device settingsDevice setting0x0D DigitizerCollection Logical (CL)
    0x53Device identifierDevice index0x0D DigitizerDV
    0x54Contact countActual contact count0x0D DigitizerDV
    0x55Contact count maximumMaximum number of contacts supported0x0D DigitizerDV

  • The feature report must be in its own top-level collection and must include the multiple input configuration usages.
        0x09, 0x0E,                         // USAGE (Device Configuration)
        0xa1, 0x01,                         // COLLECTION (Application)
        0x85, REPORTID_FEATURE,             //   REPORT_ID (Configuration)
        0x09, 0x23,                         //   USAGE (Device Settings)
        0xa1, 0x02,                         //   COLLECTION (logical)    
        0x09, 0x52,                         //    USAGE (Device Mode)         
        0x09, 0x53,                         //    USAGE (Device Identifier)
        0x15, 0x00,                         //    LOGICAL_MINIMUM (0)      
        0x25, 0x0a,                         //    LOGICAL_MAXIMUM (10)
        0x75, 0x08,                         //    REPORT_SIZE (8)         
        0x95, 0x02,                         //    REPORT_COUNT (2)         
        0xb1, 0x02,                         //   FEATURE (Data,Var,Abs    
        0xc0,                               //   END_COLLECTION
        0xc0,                               // END_COLLECTION

Device Mode (0x52)

レポーティングモード

Serial mode

  • Each packet contains a single contact update.

Parallel mode

  • Each packet is “wide” enough to support reporting the maximum number of contacts that the device can detect.

Hybrid mode

  • Each packet contains a fixed number of contacts (less than the total number that the device can detect), and multiple packets are sent to convey all the contact data.

デバイスモード

  • Mouse (recommended default) 0x00
  • Single-input (single touch or stylus) 0x01
  • Multi-input 0x02

Windows Driver Kit/サンプル

Windows Touch Samples

HIDに対応してない場合のサンプル(シリアル接続なのをドライバでHIDに変換)。

関連

参考