22* @author Valentin Simonov / http://va.lent.in/
33*/
44
5+ #define WINVER _WIN32_WINNT_WIN7
6+ #define _WIN32_WINNT _WIN32_WINNT_WIN7
7+
58#include <windows.h>
69
710#define EXPORT_API __declspec(dllexport)
@@ -23,6 +26,65 @@ typedef enum
2326 WIN8
2427} TOUCH_API ;
2528
29+ // <Windows 8 touch API>
30+
31+ #define WM_POINTERUPDATE 0x0245
32+ #define WM_POINTERDOWN 0x0246
33+ #define WM_POINTERUP 0x0247
34+
35+ #define POINTER_FLAG_CANCELED 0x00008000 // Pointer is departing in an abnormal manner
36+
37+ #define GET_POINTERID_WPARAM (wParam ) (LOWORD(wParam))
38+
39+ typedef UINT32 POINTER_FLAGS ;
40+
41+ typedef enum {
42+ PT_POINTER = 0x00000001 ,
43+ PT_TOUCH = 0x00000002 ,
44+ PT_PEN = 0x00000003 ,
45+ PT_MOUSE = 0x00000004 ,
46+ PT_TOUCHPAD = 0x00000005
47+ } POINTER_INPUT_TYPE ;
48+
49+ typedef enum {
50+ POINTER_CHANGE_NONE ,
51+ POINTER_CHANGE_FIRSTBUTTON_DOWN ,
52+ POINTER_CHANGE_FIRSTBUTTON_UP ,
53+ POINTER_CHANGE_SECONDBUTTON_DOWN ,
54+ POINTER_CHANGE_SECONDBUTTON_UP ,
55+ POINTER_CHANGE_THIRDBUTTON_DOWN ,
56+ POINTER_CHANGE_THIRDBUTTON_UP ,
57+ POINTER_CHANGE_FOURTHBUTTON_DOWN ,
58+ POINTER_CHANGE_FOURTHBUTTON_UP ,
59+ POINTER_CHANGE_FIFTHBUTTON_DOWN ,
60+ POINTER_CHANGE_FIFTHBUTTON_UP ,
61+ } POINTER_BUTTON_CHANGE_TYPE ;
62+
63+ typedef struct {
64+ POINTER_INPUT_TYPE pointerType ;
65+ UINT32 pointerId ;
66+ UINT32 frameId ;
67+ POINTER_FLAGS pointerFlags ;
68+ HANDLE sourceDevice ;
69+ HWND hwndTarget ;
70+ POINT ptPixelLocation ;
71+ POINT ptHimetricLocation ;
72+ POINT ptPixelLocationRaw ;
73+ POINT ptHimetricLocationRaw ;
74+ DWORD dwTime ;
75+ UINT32 historyCount ;
76+ INT32 InputData ;
77+ DWORD dwKeyStates ;
78+ UINT64 PerformanceCount ;
79+ POINTER_BUTTON_CHANGE_TYPE ButtonChangeType ;
80+ } POINTER_INFO ;
81+
82+ typedef BOOL (WINAPI * GET_POINTER_INFO )(UINT32 pointerId , POINTER_INFO * pointerInfo );
83+
84+ GET_POINTER_INFO GetPointerInfo ;
85+
86+ // </Windows 8 touch API>
87+
2688typedef void (__stdcall * PointerBeganFuncPtr )(int id , POINTER_INPUT_TYPE type , unsigned int buttons , Vector2 position );
2789typedef void (__stdcall * PointerMovedFuncPtr )(int id , POINTER_INPUT_TYPE type , unsigned int buttonsSet , unsigned int buttonsClear , Vector2 position );
2890typedef void (__stdcall * PointerEndedFuncPtr )(int id , POINTER_INPUT_TYPE type , unsigned int buttons );
0 commit comments