FreeRDP
Loading...
Searching...
No Matches
channels/rdpei.h
1
22#ifndef FREERDP_CHANNEL_RDPEI_H
23#define FREERDP_CHANNEL_RDPEI_H
24
25#include <winpr/wtypes.h>
26
27#ifdef __cplusplus
28extern "C"
29{
30#endif
31
32#define RDPINPUT_HEADER_LENGTH 6
33
36#define RDPINPUT_MAX_PDU_LENGTH (UINT16_MAX * 40ull)
37
42#define RDPEI_CHANNEL_NAME "rdpei"
43#define RDPEI_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::Input"
44
46enum
47{
48 RDPINPUT_PROTOCOL_V10 = 0x00010000,
49 RDPINPUT_PROTOCOL_V101 = 0x00010001,
50 RDPINPUT_PROTOCOL_V200 = 0x00020000,
51 RDPINPUT_PROTOCOL_V300 = 0x00030000
52};
53
54/* Server feature flags */
55#define SC_READY_MULTIPEN_INJECTION_SUPPORTED 0x0001
56
57/* Client Ready Flags */
58#define CS_READY_FLAGS_SHOW_TOUCH_VISUALS 0x00000001
59#define CS_READY_FLAGS_DISABLE_TIMESTAMP_INJECTION 0x00000002
60#define CS_READY_FLAGS_ENABLE_MULTIPEN_INJECTION 0x00000004
61
62/* 2.2.3.3.1.1 RDPINPUT_TOUCH_CONTACT */
63#define CONTACT_DATA_CONTACTRECT_PRESENT 0x0001
64#define CONTACT_DATA_ORIENTATION_PRESENT 0x0002
65#define CONTACT_DATA_PRESSURE_PRESENT 0x0004
66
67typedef enum
68{
69 RDPINPUT_PEN_CONTACT_PENFLAGS_PRESENT = 0x0001,
70 RDPINPUT_PEN_CONTACT_PRESSURE_PRESENT = 0x0002,
71 RDPINPUT_PEN_CONTACT_ROTATION_PRESENT = 0x0004,
72 RDPINPUT_PEN_CONTACT_TILTX_PRESENT = 0x0008,
73 RDPINPUT_PEN_CONTACT_TILTY_PRESENT = 0x0010
74} RDPINPUT_PEN_FIELDS_PRESENT;
75
76/*
77 * Valid combinations of RDPINPUT_CONTACT_FLAGS:
78 *
79 * See [MS-RDPEI] 2.2.3.3.1.1 RDPINPUT_TOUCH_CONTACT and 3.1.1.1 Touch Contact State Transitions
80 *
81 * UP
82 * UP | CANCELED
83 * UPDATE
84 * UPDATE | CANCELED
85 * DOWN | INRANGE | INCONTACT
86 * UPDATE | INRANGE | INCONTACT
87 * UP | INRANGE
88 * UPDATE | INRANGE
89 */
90typedef enum
91{
92 RDPINPUT_CONTACT_FLAG_DOWN = 0x0001,
93 RDPINPUT_CONTACT_FLAG_UPDATE = 0x0002,
94 RDPINPUT_CONTACT_FLAG_UP = 0x0004,
95 RDPINPUT_CONTACT_FLAG_INRANGE = 0x0008,
96 RDPINPUT_CONTACT_FLAG_INCONTACT = 0x0010,
97 RDPINPUT_CONTACT_FLAG_CANCELED = 0x0020
98} RDPINPUT_CONTACT_FLAGS;
99
100typedef enum
101{
102 RDPINPUT_PEN_FLAG_BARREL_PRESSED = 0x0001,
103 RDPINPUT_PEN_FLAG_ERASER_PRESSED = 0x0002,
104 RDPINPUT_PEN_FLAG_INVERTED = 0x0004
105} RDPINPUT_PEN_FLAGS;
106
108typedef struct
109{
110 UINT32 contactId;
111 UINT16 fieldsPresent; /* Mask of CONTACT_DATA_*_PRESENT values */
112 INT32 x;
113 INT32 y;
114 UINT32 contactFlags; /* See RDPINPUT_CONTACT_FLAG* */
115 INT16 contactRectLeft; /* Present if CONTACT_DATA_CONTACTRECT_PRESENT */
116 INT16 contactRectTop; /* Present if CONTACT_DATA_CONTACTRECT_PRESENT */
117 INT16 contactRectRight; /* Present if CONTACT_DATA_CONTACTRECT_PRESENT */
118 INT16 contactRectBottom; /* Present if CONTACT_DATA_CONTACTRECT_PRESENT */
119 UINT32 orientation; /* Present if CONTACT_DATA_ORIENTATION_PRESENT, values in degree, [0-359] */
120 UINT32 pressure; /* Present if CONTACT_DATA_PRESSURE_PRESENT, normalized value [0-1024] */
122
124typedef struct
125{
126 UINT16 contactCount;
127 UINT64 frameOffset;
128 RDPINPUT_CONTACT_DATA* contacts;
130
132typedef struct
133{
134 UINT32 encodeTime;
135 UINT16 frameCount;
136 RDPINPUT_TOUCH_FRAME* frames;
138
139typedef struct
140{
141 UINT8 deviceId;
142 UINT16 fieldsPresent; /* Mask of RDPINPUT_PEN_FIELDS_PRESENT values */
143 INT32 x;
144 INT32 y;
145 UINT32 contactFlags; /* See RDPINPUT_CONTACT_FLAG* */
146 UINT32 penFlags; /* Present if RDPINPUT_PEN_CONTACT_PENFLAGS_PRESENT, values see
147 RDPINPUT_PEN_FLAGS */
148 UINT16 rotation; /* Present if RDPINPUT_PEN_CONTACT_ROTATION_PRESENT, In degree, [0-359] */
149 UINT32
150 pressure; /* Present if RDPINPUT_PEN_CONTACT_PRESSURE_PRESENT, normalized value [0-1024] */
151 INT16 tiltX; /* Present if PEN_CONTACT_TILTX_PRESENT, range [-90, 90] */
152 INT16 tiltY; /* Present if PEN_CONTACT_TILTY_PRESENT, range [-90, 90] */
154
155typedef struct
156{
157 UINT16 contactCount;
158 UINT64 frameOffset;
159 RDPINPUT_PEN_CONTACT* contacts;
161
163typedef struct
164{
165 UINT32 encodeTime;
166 UINT16 frameCount;
167 RDPINPUT_PEN_FRAME* frames;
169
170#ifdef __cplusplus
171}
172#endif
173
174#endif /* FREERDP_CHANNEL_RDPEI_H */
a touch event with some frames
a touch event with some frames
a frame containing contact points