20 #ifndef FREERDP_INPUT_H
21 #define FREERDP_INPUT_H
23 #include <freerdp/api.h>
24 #include <freerdp/types.h>
25 #include <freerdp/scancode.h>
27 #include <winpr/crt.h>
28 #include <winpr/collections.h>
31 #define KBD_FLAGS_EXTENDED 0x0100
32 #define KBD_FLAGS_EXTENDED1 0x0200
33 #define KBD_FLAGS_DOWN \
35 #define KBD_FLAGS_RELEASE \
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
45 #define PTR_FLAGS_BUTTON2 0x2000
46 #define PTR_FLAGS_BUTTON3 0x4000
47 #define WheelRotationMask 0x01FF
50 #define PTR_XFLAGS_DOWN 0x8000
51 #define PTR_XFLAGS_BUTTON1 0x0001
52 #define PTR_XFLAGS_BUTTON2 0x0002
55 #define KBD_SYNC_SCROLL_LOCK 0x00000001
56 #define KBD_SYNC_NUM_LOCK 0x00000002
57 #define KBD_SYNC_CAPS_LOCK 0x00000004
58 #define KBD_SYNC_KANA_LOCK 0x00000008
60 #define RDP_CLIENT_INPUT_PDU_HEADER_LENGTH 4
74 typedef BOOL (*pSynchronizeEvent)(rdpInput* input, UINT32 flags);
75 typedef BOOL (*pKeyboardEvent)(rdpInput* input, UINT16 flags, UINT8 code);
76 typedef BOOL (*pUnicodeKeyboardEvent)(rdpInput* input, UINT16 flags, UINT16 code);
77 typedef BOOL (*pMouseEvent)(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
78 typedef BOOL (*pRelMouseEvent)(rdpInput* input, UINT16 flags, INT16 xDelta, INT16 yDelta);
79 typedef BOOL (*pQoEEvent)(rdpInput* input, UINT32 timestampMS);
80 typedef BOOL (*pExtendedMouseEvent)(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
81 typedef BOOL (*pFocusInEvent)(rdpInput* input, UINT16 toggleStates);
82 typedef BOOL (*pKeyboardPauseEvent)(rdpInput* input);
88 UINT32 paddingA[16 - 2];
90 pSynchronizeEvent SynchronizeEvent;
91 pKeyboardEvent KeyboardEvent;
92 pUnicodeKeyboardEvent UnicodeKeyboardEvent;
93 pMouseEvent MouseEvent;
94 pExtendedMouseEvent ExtendedMouseEvent;
95 pFocusInEvent FocusInEvent;
96 pKeyboardPauseEvent KeyboardPauseEvent;
97 pRelMouseEvent RelMouseEvent;
100 UINT32 paddingB[32 - 25];
103 FREERDP_API BOOL freerdp_input_send_synchronize_event(rdpInput* input, UINT32 flags);
104 FREERDP_API BOOL freerdp_input_send_keyboard_event(rdpInput* input, UINT16 flags, UINT8 code);
105 FREERDP_API BOOL freerdp_input_send_keyboard_event_ex(rdpInput* input, BOOL down, BOOL repeat,
106 UINT32 rdp_scancode);
107 FREERDP_API BOOL freerdp_input_send_keyboard_pause_event(rdpInput* input);
108 FREERDP_API BOOL freerdp_input_send_unicode_keyboard_event(rdpInput* input, UINT16 flags,
110 FREERDP_API BOOL freerdp_input_send_mouse_event(rdpInput* input, UINT16 flags, UINT16 x,
112 FREERDP_API BOOL freerdp_input_send_rel_mouse_event(rdpInput* input, UINT16 flags, INT16 xDelta,
114 FREERDP_API BOOL freerdp_input_send_qoe_timestamp(rdpInput* input, UINT32 timestampMS);
115 FREERDP_API BOOL freerdp_input_send_extended_mouse_event(rdpInput* input, UINT16 flags,
117 FREERDP_API BOOL freerdp_input_send_focus_in_event(rdpInput* input, UINT16 toggleStates);