FreeRDP
Loading...
Searching...
No Matches
include/freerdp/input.h
1
20#ifndef FREERDP_INPUT_H
21#define FREERDP_INPUT_H
22
23#include <freerdp/api.h>
24#include <freerdp/types.h>
25#include <freerdp/scancode.h>
26
27#include <winpr/crt.h>
28#include <winpr/collections.h>
29
30/* keyboard Flags */
31#define KBD_FLAGS_EXTENDED 0x0100
32#define KBD_FLAGS_EXTENDED1 0x0200
33#define KBD_FLAGS_DOWN \
34 0x4000
35#define KBD_FLAGS_RELEASE \
36 0x8000
38/* Pointer Flags */
39#define PTR_FLAGS_HWHEEL 0x0400
40#define PTR_FLAGS_WHEEL 0x0200
41#define PTR_FLAGS_WHEEL_NEGATIVE 0x0100
42#define PTR_FLAGS_MOVE 0x0800
43#define PTR_FLAGS_DOWN 0x8000
44#define PTR_FLAGS_BUTTON1 0x1000 /* left */
45#define PTR_FLAGS_BUTTON2 0x2000 /* right */
46#define PTR_FLAGS_BUTTON3 0x4000 /* middle */
47#define WheelRotationMask 0x01FF
48
49/* Extended Pointer Flags */
50#define PTR_XFLAGS_DOWN 0x8000
51#define PTR_XFLAGS_BUTTON1 0x0001
52#define PTR_XFLAGS_BUTTON2 0x0002
53
54/* Keyboard Toggle Flags */
55enum KBD_SYNC_FLAGS
56{
57 KBD_SYNC_SCROLL_LOCK = 0x00000001,
58 KBD_SYNC_NUM_LOCK = 0x00000002,
59 KBD_SYNC_CAPS_LOCK = 0x00000004,
60 KBD_SYNC_KANA_LOCK = 0x00000008
61};
62
63#define RDP_CLIENT_INPUT_PDU_HEADER_LENGTH 4
64
65#ifdef __cplusplus
66extern "C"
67{
68#endif
69
70 typedef struct rdp_input rdpInput;
71
72 /* defined inside libfreerdp-core */
73 typedef struct rdp_input_proxy rdpInputProxy;
74
75 /* Input Interface */
76
77 typedef BOOL (*pSynchronizeEvent)(rdpInput* input, UINT32 flags);
78 typedef BOOL (*pKeyboardEvent)(rdpInput* input, UINT16 flags, UINT8 code);
79 typedef BOOL (*pUnicodeKeyboardEvent)(rdpInput* input, UINT16 flags, UINT16 code);
80 typedef BOOL (*pMouseEvent)(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
81 typedef BOOL (*pRelMouseEvent)(rdpInput* input, UINT16 flags, INT16 xDelta, INT16 yDelta);
82 typedef BOOL (*pQoEEvent)(rdpInput* input, UINT32 timestampMS);
83 typedef BOOL (*pExtendedMouseEvent)(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
84 typedef BOOL (*pFocusInEvent)(rdpInput* input, UINT16 toggleStates);
85 typedef BOOL (*pKeyboardPauseEvent)(rdpInput* input);
86
87 struct rdp_input
88 {
89 rdpContext* context; /* 0 */
90 void* param1; /* 1 */
91 UINT32 paddingA[16 - 2]; /* 2 */
92
93 pSynchronizeEvent SynchronizeEvent; /* 16 */
94 pKeyboardEvent KeyboardEvent; /* 17 */
95 pUnicodeKeyboardEvent UnicodeKeyboardEvent; /* 18 */
96 pMouseEvent MouseEvent; /* 19 */
97 pExtendedMouseEvent ExtendedMouseEvent; /* 20 */
98 pFocusInEvent FocusInEvent; /*21 */
99 pKeyboardPauseEvent KeyboardPauseEvent; /* 22 */
100 pRelMouseEvent RelMouseEvent; /* 23 */
101 pQoEEvent QoEEvent; /* 24 */
102
103 UINT32 paddingB[32 - 25]; /* 25 */
104 };
105
106 FREERDP_API BOOL freerdp_input_send_synchronize_event(rdpInput* input, UINT32 flags);
107 FREERDP_API BOOL freerdp_input_send_keyboard_event(rdpInput* input, UINT16 flags, UINT8 code);
108 FREERDP_API BOOL freerdp_input_send_keyboard_event_ex(rdpInput* input, BOOL down, BOOL repeat,
109 UINT32 rdp_scancode);
110 FREERDP_API BOOL freerdp_input_send_keyboard_pause_event(rdpInput* input);
111 FREERDP_API BOOL freerdp_input_send_unicode_keyboard_event(rdpInput* input, UINT16 flags,
112 UINT16 code);
113 FREERDP_API BOOL freerdp_input_send_mouse_event(rdpInput* input, UINT16 flags, UINT16 x,
114 UINT16 y);
115 FREERDP_API BOOL freerdp_input_send_rel_mouse_event(rdpInput* input, UINT16 flags, INT16 xDelta,
116 INT16 yDelta);
117 FREERDP_API BOOL freerdp_input_send_qoe_timestamp(rdpInput* input, UINT32 timestampMS);
118 FREERDP_API BOOL freerdp_input_send_extended_mouse_event(rdpInput* input, UINT16 flags,
119 UINT16 x, UINT16 y);
120 FREERDP_API BOOL freerdp_input_send_focus_in_event(rdpInput* input, UINT16 toggleStates);
121
131 FREERDP_API const char* freerdp_input_keyboard_flags_string(uint32_t flags, char* buffer,
132 size_t len);
133
134#ifdef __cplusplus
135}
136#endif
137
138#endif /* FREERDP_INPUT_H */