2014-11-21 00:19:29 +03:00
|
|
|
/**
|
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
|
|
|
* Extended Input channel common definitions
|
|
|
|
*
|
|
|
|
* Copyright 2013 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
|
|
* Copyright 2014 Thincast Technologies Gmbh.
|
|
|
|
* Copyright 2014 David FORT <contact@hardening-consulting.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.
|
|
|
|
*/
|
|
|
|
|
2017-06-06 15:01:41 +03:00
|
|
|
#ifndef FREERDP_CHANNEL_RDPEI_H
|
|
|
|
#define FREERDP_CHANNEL_RDPEI_H
|
2014-11-21 00:19:29 +03:00
|
|
|
|
|
|
|
#include <winpr/wtypes.h>
|
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
#define RDPINPUT_HEADER_LENGTH 6
|
2014-11-21 00:19:29 +03:00
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
#define RDPEI_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::Input"
|
2014-11-21 00:19:29 +03:00
|
|
|
|
|
|
|
/** @brief protocol version */
|
2019-11-06 17:24:51 +03:00
|
|
|
enum
|
|
|
|
{
|
2014-11-21 00:19:29 +03:00
|
|
|
RDPINPUT_PROTOCOL_V10 = 0x00010000,
|
2020-11-11 10:54:46 +03:00
|
|
|
RDPINPUT_PROTOCOL_V101 = 0x00010001,
|
|
|
|
RDPINPUT_PROTOCOL_V200 = 0x00020000,
|
|
|
|
RDPINPUT_PROTOCOL_V300 = 0x00030000
|
2014-11-21 00:19:29 +03:00
|
|
|
};
|
|
|
|
|
2021-05-20 15:11:43 +03:00
|
|
|
/* Server feature flags */
|
|
|
|
#define SC_READY_MULTIPEN_INJECTION_SUPPORTED 0x0001
|
|
|
|
|
2014-11-21 00:19:29 +03:00
|
|
|
/* Client Ready Flags */
|
2020-11-11 10:54:46 +03:00
|
|
|
#define CS_READY_FLAGS_SHOW_TOUCH_VISUALS 0x00000001
|
|
|
|
#define CS_READY_FLAGS_DISABLE_TIMESTAMP_INJECTION 0x00000002
|
|
|
|
#define CS_READY_FLAGS_ENABLE_MULTIPEN_INJECTION 0x00000004
|
2014-11-21 00:19:29 +03:00
|
|
|
|
2021-05-20 15:11:43 +03:00
|
|
|
/* 2.2.3.3.1.1 RDPINPUT_TOUCH_CONTACT */
|
2019-11-06 17:24:51 +03:00
|
|
|
#define CONTACT_DATA_CONTACTRECT_PRESENT 0x0001
|
|
|
|
#define CONTACT_DATA_ORIENTATION_PRESENT 0x0002
|
|
|
|
#define CONTACT_DATA_PRESSURE_PRESENT 0x0004
|
2014-11-21 00:19:29 +03:00
|
|
|
|
2020-11-11 10:54:46 +03:00
|
|
|
typedef enum
|
|
|
|
{
|
2020-11-30 15:40:15 +03:00
|
|
|
RDPINPUT_PEN_CONTACT_PENFLAGS_PRESENT = 0x0001,
|
|
|
|
RDPINPUT_PEN_CONTACT_PRESSURE_PRESENT = 0x0002,
|
|
|
|
RDPINPUT_PEN_CONTACT_ROTATION_PRESENT = 0x0004,
|
|
|
|
RDPINPUT_PEN_CONTACT_TILTX_PRESENT = 0x0008,
|
|
|
|
RDPINPUT_PEN_CONTACT_TILTY_PRESENT = 0x0010
|
2020-11-11 10:54:46 +03:00
|
|
|
} RDPINPUT_PEN_FIELDS_PRESENT;
|
|
|
|
|
2021-05-20 15:11:43 +03:00
|
|
|
/*
|
|
|
|
* Valid combinations of RDPINPUT_CONTACT_FLAGS:
|
|
|
|
*
|
|
|
|
* See [MS-RDPEI] 2.2.3.3.1.1 RDPINPUT_TOUCH_CONTACT and 3.1.1.1 Touch Contact State Transitions
|
|
|
|
*
|
|
|
|
* UP
|
|
|
|
* UP | CANCELED
|
|
|
|
* UPDATE
|
|
|
|
* UPDATE | CANCELED
|
|
|
|
* DOWN | INRANGE | INCONTACT
|
|
|
|
* UPDATE | INRANGE | INCONTACT
|
|
|
|
* UP | INRANGE
|
|
|
|
* UPDATE | INRANGE
|
|
|
|
*/
|
2020-11-11 10:54:46 +03:00
|
|
|
typedef enum
|
|
|
|
{
|
2020-11-30 15:40:15 +03:00
|
|
|
RDPINPUT_CONTACT_FLAG_DOWN = 0x0001,
|
|
|
|
RDPINPUT_CONTACT_FLAG_UPDATE = 0x0002,
|
|
|
|
RDPINPUT_CONTACT_FLAG_UP = 0x0004,
|
|
|
|
RDPINPUT_CONTACT_FLAG_INRANGE = 0x0008,
|
|
|
|
RDPINPUT_CONTACT_FLAG_INCONTACT = 0x0010,
|
|
|
|
RDPINPUT_CONTACT_FLAG_CANCELED = 0x0020
|
2020-11-11 10:54:46 +03:00
|
|
|
} RDPINPUT_CONTACT_FLAGS;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
2020-11-30 15:40:15 +03:00
|
|
|
RDPINPUT_PEN_FLAG_BARREL_PRESSED = 0x0001,
|
|
|
|
RDPINPUT_PEN_FLAG_ERASER_PRESSED = 0x0002,
|
|
|
|
RDPINPUT_PEN_FLAG_INVERTED = 0x0004
|
2020-11-11 10:54:46 +03:00
|
|
|
} RDPINPUT_PEN_FLAGS;
|
2014-11-21 00:19:29 +03:00
|
|
|
|
|
|
|
/** @brief a contact point */
|
|
|
|
struct _RDPINPUT_CONTACT_DATA
|
|
|
|
{
|
|
|
|
UINT32 contactId;
|
2021-05-20 15:11:43 +03:00
|
|
|
UINT16 fieldsPresent; /* Mask of CONTACT_DATA_*_PRESENT values */
|
2014-11-21 00:19:29 +03:00
|
|
|
INT32 x;
|
|
|
|
INT32 y;
|
2021-05-20 15:11:43 +03:00
|
|
|
UINT32 contactFlags; /* See RDPINPUT_CONTACT_FLAG* */
|
|
|
|
INT16 contactRectLeft; /* Present if CONTACT_DATA_CONTACTRECT_PRESENT */
|
|
|
|
INT16 contactRectTop; /* Present if CONTACT_DATA_CONTACTRECT_PRESENT */
|
|
|
|
INT16 contactRectRight; /* Present if CONTACT_DATA_CONTACTRECT_PRESENT */
|
|
|
|
INT16 contactRectBottom; /* Present if CONTACT_DATA_CONTACTRECT_PRESENT */
|
|
|
|
UINT32 orientation; /* Present if CONTACT_DATA_ORIENTATION_PRESENT, values in degree, [0-359] */
|
|
|
|
UINT32 pressure; /* Present if CONTACT_DATA_PRESSURE_PRESENT, normalized value [0-1024] */
|
2014-11-21 00:19:29 +03:00
|
|
|
};
|
|
|
|
typedef struct _RDPINPUT_CONTACT_DATA RDPINPUT_CONTACT_DATA;
|
|
|
|
|
|
|
|
/** @brief a frame containing contact points */
|
|
|
|
struct _RDPINPUT_TOUCH_FRAME
|
|
|
|
{
|
2020-11-11 10:54:46 +03:00
|
|
|
UINT16 contactCount;
|
2014-11-21 00:19:29 +03:00
|
|
|
UINT64 frameOffset;
|
|
|
|
RDPINPUT_CONTACT_DATA* contacts;
|
|
|
|
};
|
|
|
|
typedef struct _RDPINPUT_TOUCH_FRAME RDPINPUT_TOUCH_FRAME;
|
|
|
|
|
|
|
|
/** @brief a touch event with some frames*/
|
|
|
|
struct _RDPINPUT_TOUCH_EVENT
|
|
|
|
{
|
|
|
|
UINT32 encodeTime;
|
|
|
|
UINT16 frameCount;
|
|
|
|
RDPINPUT_TOUCH_FRAME* frames;
|
|
|
|
};
|
|
|
|
typedef struct _RDPINPUT_TOUCH_EVENT RDPINPUT_TOUCH_EVENT;
|
|
|
|
|
2020-11-11 10:54:46 +03:00
|
|
|
struct _RDPINPUT_PEN_CONTACT
|
|
|
|
{
|
|
|
|
UINT8 deviceId;
|
2021-05-20 15:11:43 +03:00
|
|
|
UINT16 fieldsPresent; /* Mask of RDPINPUT_PEN_FIELDS_PRESENT values */
|
2020-11-11 10:54:46 +03:00
|
|
|
INT32 x;
|
|
|
|
INT32 y;
|
2021-05-20 15:11:43 +03:00
|
|
|
UINT32 contactFlags; /* See RDPINPUT_CONTACT_FLAG* */
|
|
|
|
UINT32 penFlags; /* Present if RDPINPUT_PEN_CONTACT_PENFLAGS_PRESENT, values see
|
|
|
|
RDPINPUT_PEN_FLAGS */
|
|
|
|
UINT16 rotation; /* Present if RDPINPUT_PEN_CONTACT_ROTATION_PRESENT, In degree, [0-359] */
|
|
|
|
UINT32
|
|
|
|
pressure; /* Present if RDPINPUT_PEN_CONTACT_PRESSURE_PRESENT, normalized value [0-1024] */
|
|
|
|
INT16 tiltX; /* Present if PEN_CONTACT_TILTX_PRESENT, range [-90, 90] */
|
|
|
|
INT16 tiltY; /* Present if PEN_CONTACT_TILTY_PRESENT, range [-90, 90] */
|
2020-11-11 10:54:46 +03:00
|
|
|
};
|
|
|
|
typedef struct _RDPINPUT_PEN_CONTACT RDPINPUT_PEN_CONTACT;
|
|
|
|
|
|
|
|
struct _RDPINPUT_PEN_FRAME
|
|
|
|
{
|
|
|
|
UINT16 contactCount;
|
|
|
|
UINT64 frameOffset;
|
|
|
|
RDPINPUT_PEN_CONTACT* contacts;
|
|
|
|
};
|
|
|
|
typedef struct _RDPINPUT_PEN_FRAME RDPINPUT_PEN_FRAME;
|
|
|
|
|
|
|
|
/** @brief a touch event with some frames*/
|
|
|
|
struct _RDPINPUT_PEN_EVENT
|
|
|
|
{
|
|
|
|
UINT32 encodeTime;
|
|
|
|
UINT16 frameCount;
|
|
|
|
RDPINPUT_PEN_FRAME* frames;
|
|
|
|
};
|
|
|
|
typedef struct _RDPINPUT_PEN_EVENT RDPINPUT_PEN_EVENT;
|
2017-06-06 15:01:41 +03:00
|
|
|
#endif /* FREERDP_CHANNEL_RDPEI_H */
|