FreeRDP
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 */
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
59 
60 #define RDP_CLIENT_INPUT_PDU_HEADER_LENGTH 4
61 
62 #ifdef __cplusplus
63 extern "C"
64 {
65 #endif
66 
67  typedef struct rdp_input rdpInput;
68 
69  /* defined inside libfreerdp-core */
70  typedef struct rdp_input_proxy rdpInputProxy;
71 
72  /* Input Interface */
73 
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);
83 
84  struct rdp_input
85  {
86  rdpContext* context; /* 0 */
87  void* param1; /* 1 */
88  UINT32 paddingA[16 - 2]; /* 2 */
89 
90  pSynchronizeEvent SynchronizeEvent; /* 16 */
91  pKeyboardEvent KeyboardEvent; /* 17 */
92  pUnicodeKeyboardEvent UnicodeKeyboardEvent; /* 18 */
93  pMouseEvent MouseEvent; /* 19 */
94  pExtendedMouseEvent ExtendedMouseEvent; /* 20 */
95  pFocusInEvent FocusInEvent; /*21 */
96  pKeyboardPauseEvent KeyboardPauseEvent; /* 22 */
97  pRelMouseEvent RelMouseEvent; /* 23 */
98  pQoEEvent QoEEvent; /* 24 */
99 
100  UINT32 paddingB[32 - 25]; /* 25 */
101  };
102 
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,
109  UINT16 code);
110  FREERDP_API BOOL freerdp_input_send_mouse_event(rdpInput* input, UINT16 flags, UINT16 x,
111  UINT16 y);
112  FREERDP_API BOOL freerdp_input_send_rel_mouse_event(rdpInput* input, UINT16 flags, INT16 xDelta,
113  INT16 yDelta);
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,
116  UINT16 x, UINT16 y);
117  FREERDP_API BOOL freerdp_input_send_focus_in_event(rdpInput* input, UINT16 toggleStates);
118 
119 #ifdef __cplusplus
120 }
121 #endif
122 
123 #endif /* FREERDP_INPUT_H */