michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef touchinjection_sdk80_h michael@0: #define touchinjection_sdk80_h michael@0: michael@0: // Note, this isn't inclusive of all touch injection header info. michael@0: // You may need to add more to expand on current apis. michael@0: michael@0: #ifndef TOUCH_FEEDBACK_DEFAULT michael@0: michael@0: #define TOUCH_FEEDBACK_DEFAULT 0x1 michael@0: #define TOUCH_FEEDBACK_INDIRECT 0x2 michael@0: #define TOUCH_FEEDBACK_NONE 0x3 michael@0: michael@0: enum { michael@0: PT_POINTER = 0x00000001, // Generic pointer michael@0: PT_TOUCH = 0x00000002, // Touch michael@0: PT_PEN = 0x00000003, // Pen michael@0: PT_MOUSE = 0x00000004, // Mouse michael@0: }; michael@0: michael@0: typedef DWORD POINTER_INPUT_TYPE; michael@0: typedef UINT32 POINTER_FLAGS; michael@0: michael@0: typedef enum { michael@0: POINTER_CHANGE_NONE, michael@0: POINTER_CHANGE_FIRSTBUTTON_DOWN, michael@0: POINTER_CHANGE_FIRSTBUTTON_UP, michael@0: POINTER_CHANGE_SECONDBUTTON_DOWN, michael@0: POINTER_CHANGE_SECONDBUTTON_UP, michael@0: POINTER_CHANGE_THIRDBUTTON_DOWN, michael@0: POINTER_CHANGE_THIRDBUTTON_UP, michael@0: POINTER_CHANGE_FOURTHBUTTON_DOWN, michael@0: POINTER_CHANGE_FOURTHBUTTON_UP, michael@0: POINTER_CHANGE_FIFTHBUTTON_DOWN, michael@0: POINTER_CHANGE_FIFTHBUTTON_UP, michael@0: } POINTER_BUTTON_CHANGE_TYPE; michael@0: michael@0: typedef struct { michael@0: POINTER_INPUT_TYPE pointerType; michael@0: UINT32 pointerId; michael@0: UINT32 frameId; michael@0: POINTER_FLAGS pointerFlags; michael@0: HANDLE sourceDevice; michael@0: HWND hwndTarget; michael@0: POINT ptPixelLocation; michael@0: POINT ptHimetricLocation; michael@0: POINT ptPixelLocationRaw; michael@0: POINT ptHimetricLocationRaw; michael@0: DWORD dwTime; michael@0: UINT32 historyCount; michael@0: INT32 InputData; michael@0: DWORD dwKeyStates; michael@0: UINT64 PerformanceCount; michael@0: POINTER_BUTTON_CHANGE_TYPE ButtonChangeType; michael@0: } POINTER_INFO; michael@0: michael@0: typedef UINT32 TOUCH_FLAGS; michael@0: typedef UINT32 TOUCH_MASK; michael@0: michael@0: typedef struct { michael@0: POINTER_INFO pointerInfo; michael@0: TOUCH_FLAGS touchFlags; michael@0: TOUCH_MASK touchMask; michael@0: RECT rcContact; michael@0: RECT rcContactRaw; michael@0: UINT32 orientation; michael@0: UINT32 pressure; michael@0: } POINTER_TOUCH_INFO; michael@0: michael@0: #define TOUCH_FLAG_NONE 0x00000000 // Default michael@0: michael@0: #define TOUCH_MASK_NONE 0x00000000 // Default - none of the optional fields are valid michael@0: #define TOUCH_MASK_CONTACTAREA 0x00000001 // The rcContact field is valid michael@0: #define TOUCH_MASK_ORIENTATION 0x00000002 // The orientation field is valid michael@0: #define TOUCH_MASK_PRESSURE 0x00000004 // The pressure field is valid michael@0: michael@0: #define POINTER_FLAG_NONE 0x00000000 // Default michael@0: #define POINTER_FLAG_NEW 0x00000001 // New pointer michael@0: #define POINTER_FLAG_INRANGE 0x00000002 // Pointer has not departed michael@0: #define POINTER_FLAG_INCONTACT 0x00000004 // Pointer is in contact michael@0: #define POINTER_FLAG_FIRSTBUTTON 0x00000010 // Primary action michael@0: #define POINTER_FLAG_SECONDBUTTON 0x00000020 // Secondary action michael@0: #define POINTER_FLAG_THIRDBUTTON 0x00000040 // Third button michael@0: #define POINTER_FLAG_FOURTHBUTTON 0x00000080 // Fourth button michael@0: #define POINTER_FLAG_FIFTHBUTTON 0x00000100 // Fifth button michael@0: #define POINTER_FLAG_PRIMARY 0x00002000 // Pointer is primary michael@0: #define POINTER_FLAG_CONFIDENCE 0x00004000 // Pointer is considered unlikely to be accidental michael@0: #define POINTER_FLAG_CANCELED 0x00008000 // Pointer is departing in an abnormal manner michael@0: #define POINTER_FLAG_DOWN 0x00010000 // Pointer transitioned to down state (made contact) michael@0: #define POINTER_FLAG_UPDATE 0x00020000 // Pointer update michael@0: #define POINTER_FLAG_UP 0x00040000 // Pointer transitioned from down state (broke contact) michael@0: #define POINTER_FLAG_WHEEL 0x00080000 // Vertical wheel michael@0: #define POINTER_FLAG_HWHEEL 0x00100000 // Horizontal wheel michael@0: #define POINTER_FLAG_CAPTURECHANGED 0x00200000 // Lost capture michael@0: michael@0: #endif // TOUCH_FEEDBACK_DEFAULT michael@0: michael@0: #define TOUCH_FLAGS_CONTACTUPDATE (POINTER_FLAG_UPDATE|POINTER_FLAG_INRANGE|POINTER_FLAG_INCONTACT) michael@0: #define TOUCH_FLAGS_CONTACTDOWN (POINTER_FLAG_DOWN|POINTER_FLAG_INRANGE|POINTER_FLAG_INCONTACT) michael@0: michael@0: typedef BOOL (WINAPI* InitializeTouchInjectionPtr)(UINT32 maxCount, DWORD dwMode); michael@0: typedef BOOL (WINAPI* InjectTouchInputPtr)(UINT32 count, CONST POINTER_TOUCH_INFO *info); michael@0: michael@0: #endif // touchinjection_sdk80_h