-
Notifications
You must be signed in to change notification settings - Fork 0
/
SynthPointer.h
145 lines (127 loc) · 3.71 KB
/
SynthPointer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#ifndef SYNTHPOINTER_H
#define SYNTHPOINTER_H
#include <windows.h>
/**
* # Synthetic Pointer DLL
*
* This is a DLL for simulating pen input using the Synthetic Pointer API in Windows.
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* ## Public Functions
*/
/** (CreateSynthPointer)
* Create a synthetic pointer device.
*
* # Return
*
* Return a handle to the synthetic pointer device.
*/
HSYNTHETICPOINTERDEVICE CreateSynthPointer();
/** (GetDefaultPointerTypeInfo)
* Get an initial POINTER_TYPE_INFO with default values.
*
* # Return
*
* Return a POINTER_TYPE_INFO structure with default values.
*/
POINTER_TYPE_INFO *GetDefaultPointerTypeInfo();
/** (HoverMove)
* Move the hover position of the pen.
*
* # Parameters
*
* - `device` - Handle to the synthetic pointer device.
* - `info` - Pointer to the POINTER_TYPE_INFO structure.
* - `x` - Normalized x-coordinate of the hover position.
* - `y` - Normalized y-coordinate of the hover position.
* - `screenId` - ID of the screen.
* - `buttonPressed` - Boolean indicating if the button is pressed.
*/
void HoverMove(HSYNTHETICPOINTERDEVICE device, POINTER_TYPE_INFO *info, float x, float y, int screenId, BOOL buttonPressed);
/** (ContactMove)
* Move the contact position of the pen.
*
* # Parameters
*
* - `device` - Handle to the synthetic pointer device.
* - `info` - Pointer to the POINTER_TYPE_INFO structure.
* - `x` - Normalized x-coordinate of the contact position.
* - `y` - Normalized y-coordinate of the contact position.
* - `screenId` - ID of the screen.
* - `buttonPressed` - Boolean indicating if the button is pressed.
* - `pressure` - The pressure of the pen contact.
*/
void ContactMove(HSYNTHETICPOINTERDEVICE device, POINTER_TYPE_INFO *info, float x, float y, int screenId, BOOL buttonPressed, UINT32 pressure);
/** (HoverExit)
* Exit the hover state of the pen.
*
* # Parameters
*
* - `device` - Handle to the synthetic pointer device.
* - `info` - Pointer to the POINTER_TYPE_INFO structure.
*/
void HoverExit(HSYNTHETICPOINTERDEVICE device, POINTER_TYPE_INFO *info);
/** (Down)
* Enter the down state of the pen.
*
* # Parameters
*
* - `device` - Handle to the synthetic pointer device.
* - `info` - Pointer to the POINTER_TYPE_INFO structure.
*/
void Down(HSYNTHETICPOINTERDEVICE device, POINTER_TYPE_INFO *info);
/** (Up)
* Enter the up state of the pen.
*
* # Parameters
*
* - `device` - Handle to the synthetic pointer device.
* - `info` - Pointer to the POINTER_TYPE_INFO structure.
*/
void Up(HSYNTHETICPOINTERDEVICE device, POINTER_TYPE_INFO *info);
/** (ScreenCount)
* Get the number of screens.
*
* # Parameters
*
* - `count` - Pointer to the number of screens.
*/
void ScreenCount(int* count);
/**
* ## Internal Functions
*
* The following functions are intended for internal use by the DLL and should not be used by applications.
*/
/** (_ScreenToGlobal)
* Convert the screen coordinates to global coordinates.
*
* # Parameters
*
* - `screenX` - The screen X coordinate.
* - `screenY` - The screen Y coordinate.
* - `screenId` - The screen ID.
*
* # Returns
* The global coordinates.
*/
POINT _ScreenToGlobal(int screenX, int screenY, int screenId);
/** (injectPointer)
* Inject the pointer input.
*
* # Parameters
*
* - `device` - Handle to the synthetic pointer device.
* - `info` - Pointer to the POINTER_TYPE_INFO structure.
*/
void _injectPointer(HSYNTHETICPOINTERDEVICE device, POINTER_TYPE_INFO *info);
/** (handleError)
* Handle an error that occurred during the DLL's operation.
*/
void _handleError();
#ifdef __cplusplus
}
#endif
#endif // SYNTHPOINTER_H