最終更新:2015-04-03 (金) 18:21:13 (3283d)
Windows/デバイスドライバ/マルチタッチ
ドライバの提供方法
HIDデバイスの場合
- Windows 7でWindows 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.
どちらにせよ
- ドライバを提供する/しないにかかわらず、INFファイルでセレクティブサスペンドをサポートし無くてはならない
MSDN
Windows 8
- Touch design and development in Windows 8 and Windows 8.1
Windows 7
- Windows Touch Overview (Windows 7)
- Supporting Usages in Multitouch Digitizer Drivers (Windows 7)
- Selecting Packet Reporting Modes in Multitouch Drivers (Windows 7)
ドキュメント
- How to Design and Test Multitouch Hardware Solutions for Windows 7
- Multi-touch Driver Development
- Digitizer Drivers for Windows Touch and Pen-Based Computers
メモ
ドライバフレームワーク
- 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
- Usage Page/Generic Desktop (0x01)
- Usage Page/Digitizer (0x0D)
デバイスクラス
- 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
Usage ID Name Description Page 0x30 X 0x01 Generic Desktop 0x31 Y 0x01 Generic Desktop 0x51 Contact identifier 0x0D Digitizer 0x42 Tip switch タッチしているかどうか 0x0D Digitizer 0x32 In-range 距離 0x0D Digitizer 0x55 Contact count maximum 0x0D Digitizer
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 ID Name Description Page Type 0x51 Contact identifier Contact identifier 0x0D Digitizer Dynamic Value (DV) 0x0E Configuration Configuration 0x0D Digitizer Collection Application (CA) 0x52 Device mode Input mode 0x0D Digitizer DV 0x23 Device settings Device setting 0x0D Digitizer Collection Logical (CL) 0x53 Device identifier Device index 0x0D Digitizer DV 0x54 Contact count Actual contact count 0x0D Digitizer DV 0x55 Contact count maximum Maximum number of contacts supported 0x0D Digitizer DV
例
- 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)
- 0x00 - Mouse (recommended default)
- 0x01 - Single-Input (Single touch or stylus)
- 0x02 - Multiple input
- http://msdn.microsoft.com/en-us/library/ff553734(VS.85).aspx
レポーティングモード
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に変換)。
関連
- デジタイザ
- Windows Touch API
- Touch Pack for Windows 7?
- マルチタッチ
- Windows 7/マルチタッチ