2011-07-28 08:38:25 +04:00
|
|
|
/**
|
2012-10-09 07:02:04 +04:00
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
2011-07-28 08:38:25 +04:00
|
|
|
* Input Interface API
|
|
|
|
*
|
|
|
|
* Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2012-12-14 09:25:48 +04:00
|
|
|
#ifndef FREERDP_INPUT_H
|
|
|
|
#define FREERDP_INPUT_H
|
2011-07-28 08:38:25 +04:00
|
|
|
|
2011-10-16 08:50:10 +04:00
|
|
|
typedef struct rdp_input rdpInput;
|
|
|
|
|
2012-02-14 02:51:42 +04:00
|
|
|
#include <freerdp/api.h>
|
2011-10-16 08:50:10 +04:00
|
|
|
#include <freerdp/freerdp.h>
|
2012-09-22 22:27:30 +04:00
|
|
|
#include <freerdp/scancode.h>
|
2011-10-16 08:50:10 +04:00
|
|
|
|
2013-01-28 06:07:17 +04:00
|
|
|
#include <winpr/crt.h>
|
|
|
|
#include <winpr/collections.h>
|
|
|
|
|
2011-07-28 08:38:25 +04:00
|
|
|
/* keyboard Flags */
|
|
|
|
#define KBD_FLAGS_EXTENDED 0x0100
|
|
|
|
#define KBD_FLAGS_DOWN 0x4000
|
|
|
|
#define KBD_FLAGS_RELEASE 0x8000
|
|
|
|
|
|
|
|
/* Pointer Flags */
|
|
|
|
#define PTR_FLAGS_WHEEL 0x0200
|
|
|
|
#define PTR_FLAGS_WHEEL_NEGATIVE 0x0100
|
|
|
|
#define PTR_FLAGS_MOVE 0x0800
|
|
|
|
#define PTR_FLAGS_DOWN 0x8000
|
2013-04-08 23:37:56 +04:00
|
|
|
#define PTR_FLAGS_BUTTON1 0x1000 /* left */
|
|
|
|
#define PTR_FLAGS_BUTTON2 0x2000 /* right */
|
|
|
|
#define PTR_FLAGS_BUTTON3 0x4000 /* middle */
|
2011-07-28 08:38:25 +04:00
|
|
|
#define WheelRotationMask 0x01FF
|
|
|
|
|
|
|
|
/* Extended Pointer Flags */
|
|
|
|
#define PTR_XFLAGS_DOWN 0x8000
|
|
|
|
#define PTR_XFLAGS_BUTTON1 0x0001
|
|
|
|
#define PTR_XFLAGS_BUTTON2 0x0002
|
|
|
|
|
|
|
|
/* Keyboard Toggle Flags */
|
|
|
|
#define KBD_SYNC_SCROLL_LOCK 0x00000001
|
|
|
|
#define KBD_SYNC_NUM_LOCK 0x00000002
|
|
|
|
#define KBD_SYNC_CAPS_LOCK 0x00000004
|
|
|
|
#define KBD_SYNC_KANA_LOCK 0x00000008
|
|
|
|
|
|
|
|
#define RDP_CLIENT_INPUT_PDU_HEADER_LENGTH 4
|
|
|
|
|
2013-01-28 06:07:17 +04:00
|
|
|
/* defined inside libfreerdp-core */
|
2013-02-04 20:05:24 +04:00
|
|
|
typedef struct rdp_input_proxy rdpInputProxy;
|
2013-01-28 06:07:17 +04:00
|
|
|
|
|
|
|
/* Input Interface */
|
|
|
|
|
2012-10-09 11:26:39 +04:00
|
|
|
typedef void (*pSynchronizeEvent)(rdpInput* input, UINT32 flags);
|
2012-10-09 11:01:37 +04:00
|
|
|
typedef void (*pKeyboardEvent)(rdpInput* input, UINT16 flags, UINT16 code);
|
|
|
|
typedef void (*pUnicodeKeyboardEvent)(rdpInput* input, UINT16 flags, UINT16 code);
|
|
|
|
typedef void (*pMouseEvent)(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
|
|
|
|
typedef void (*pExtendedMouseEvent)(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
|
2015-01-16 20:40:57 +03:00
|
|
|
typedef void (*pFocusInEvent)(rdpInput* input, UINT16 toggleStates);
|
2014-12-15 19:35:35 +03:00
|
|
|
typedef void (*pKeyboardPauseEvent)(rdpInput* input);
|
2011-07-28 08:38:25 +04:00
|
|
|
|
|
|
|
struct rdp_input
|
|
|
|
{
|
2011-11-20 23:25:59 +04:00
|
|
|
rdpContext* context; /* 0 */
|
|
|
|
void* param1; /* 1 */
|
2012-10-09 11:26:39 +04:00
|
|
|
UINT32 paddingA[16 - 2]; /* 2 */
|
2011-08-23 07:50:41 +04:00
|
|
|
|
2011-11-20 23:25:59 +04:00
|
|
|
pSynchronizeEvent SynchronizeEvent; /* 16 */
|
|
|
|
pKeyboardEvent KeyboardEvent; /* 17 */
|
|
|
|
pUnicodeKeyboardEvent UnicodeKeyboardEvent; /* 18 */
|
|
|
|
pMouseEvent MouseEvent; /* 19 */
|
|
|
|
pExtendedMouseEvent ExtendedMouseEvent; /* 20 */
|
2013-04-15 14:14:09 +04:00
|
|
|
pFocusInEvent FocusInEvent; /*21 */
|
2014-06-05 01:41:17 +04:00
|
|
|
pKeyboardPauseEvent KeyboardPauseEvent; /* 22 */
|
2013-04-15 14:14:09 +04:00
|
|
|
|
2014-06-05 01:41:17 +04:00
|
|
|
UINT32 paddingB[32 - 23]; /* 23 */
|
2013-01-28 06:07:17 +04:00
|
|
|
|
|
|
|
/* Internal */
|
|
|
|
|
|
|
|
BOOL asynchronous;
|
2013-02-04 20:05:24 +04:00
|
|
|
rdpInputProxy* proxy;
|
2013-01-28 06:07:17 +04:00
|
|
|
wMessageQueue* queue;
|
2011-07-28 08:38:25 +04:00
|
|
|
};
|
|
|
|
|
2013-01-22 18:42:01 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-10-09 11:26:39 +04:00
|
|
|
FREERDP_API void freerdp_input_send_synchronize_event(rdpInput* input, UINT32 flags);
|
2012-10-09 11:01:37 +04:00
|
|
|
FREERDP_API void freerdp_input_send_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code);
|
2012-10-09 11:26:39 +04:00
|
|
|
FREERDP_API void freerdp_input_send_keyboard_event_ex(rdpInput* input, BOOL down, UINT32 rdp_scancode);
|
2014-06-05 01:41:17 +04:00
|
|
|
FREERDP_API void freerdp_input_send_keyboard_pause_event(rdpInput* input);
|
2012-10-09 11:01:37 +04:00
|
|
|
FREERDP_API void freerdp_input_send_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code);
|
|
|
|
FREERDP_API void freerdp_input_send_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
|
|
|
|
FREERDP_API void freerdp_input_send_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
|
2015-01-16 20:40:57 +03:00
|
|
|
FREERDP_API void freerdp_input_send_focus_in_event(rdpInput* input, UINT16 toggleStates);
|
2012-02-14 02:51:42 +04:00
|
|
|
|
2013-01-22 18:42:01 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-12-14 09:25:48 +04:00
|
|
|
#endif /* FREERDP_INPUT_H */
|