Fixed fastpath/slowpatth pause event.

This commit is contained in:
Armin Novak 2019-05-16 15:14:16 +02:00
parent d96a61d8ca
commit d03d8f1a2d
3 changed files with 24 additions and 12 deletions

View File

@ -31,6 +31,7 @@ typedef struct rdp_input rdpInput;
/* keyboard Flags */
#define KBD_FLAGS_EXTENDED 0x0100
#define KBD_FLAGS_EXTENDED1 0x0200
#define KBD_FLAGS_DOWN 0x4000
#define KBD_FLAGS_RELEASE 0x8000
@ -100,11 +101,14 @@ extern "C" {
FREERDP_API BOOL freerdp_input_send_synchronize_event(rdpInput* input, UINT32 flags);
FREERDP_API BOOL freerdp_input_send_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code);
FREERDP_API BOOL freerdp_input_send_keyboard_event_ex(rdpInput* input, BOOL down, UINT32 rdp_scancode);
FREERDP_API BOOL freerdp_input_send_keyboard_event_ex(rdpInput* input, BOOL down,
UINT32 rdp_scancode);
FREERDP_API BOOL freerdp_input_send_keyboard_pause_event(rdpInput* input);
FREERDP_API BOOL freerdp_input_send_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code);
FREERDP_API BOOL freerdp_input_send_unicode_keyboard_event(rdpInput* input, UINT16 flags,
UINT16 code);
FREERDP_API BOOL freerdp_input_send_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
FREERDP_API BOOL freerdp_input_send_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
FREERDP_API BOOL freerdp_input_send_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x,
UINT16 y);
FREERDP_API BOOL freerdp_input_send_focus_in_event(rdpInput* input, UINT16 toggleStates);
#ifdef __cplusplus

View File

@ -704,6 +704,9 @@ static BOOL fastpath_recv_input_event_scancode(rdpFastPath* fastpath, wStream* s
if ((eventFlags & FASTPATH_INPUT_KBDFLAGS_EXTENDED))
flags |= KBD_FLAGS_EXTENDED;
if ((eventFlags & FASTPATH_INPUT_KBDFLAGS_PREFIX_E1))
flags |= KBD_FLAGS_EXTENDED1;
return IFCALLRESULT(TRUE, input->KeyboardEvent, input, flags, code);
}

View File

@ -172,7 +172,8 @@ static BOOL input_send_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT
{
if (flags & PTR_FLAGS_HWHEEL)
{
WLog_WARN(TAG, "skip mouse event %"PRIu16"x%"PRIu16" flags=0x%04"PRIX16", no horizontal mouse wheel supported",
WLog_WARN(TAG,
"skip mouse event %"PRIu16"x%"PRIu16" flags=0x%04"PRIX16", no horizontal mouse wheel supported",
x, y, flags);
return TRUE;
}
@ -195,7 +196,7 @@ static void input_write_extended_mouse_event(wStream* s, UINT16 flags, UINT16 x,
}
static BOOL input_send_extended_mouse_event(rdpInput* input, UINT16 flags,
UINT16 x, UINT16 y)
UINT16 x, UINT16 y)
{
wStream* s;
rdpRdp* rdp;
@ -205,7 +206,8 @@ static BOOL input_send_extended_mouse_event(rdpInput* input, UINT16 flags,
if (!input->context->settings->HasExtendedMouseEvent)
{
WLog_WARN(TAG, "skip extended mouse event %"PRIu16"x%"PRIu16" flags=0x%04"PRIX16", no extended mouse events supported",
WLog_WARN(TAG,
"skip extended mouse event %"PRIu16"x%"PRIu16" flags=0x%04"PRIX16", no extended mouse events supported",
x, y, flags);
return TRUE;
}
@ -242,7 +244,7 @@ static BOOL input_send_keyboard_pause_event(rdpInput* input)
*/
/* Control down (0x1D) */
if (!input_send_keyboard_event(input, 0,
if (!input_send_keyboard_event(input, KBD_FLAGS_EXTENDED1,
RDP_SCANCODE_CODE(RDP_SCANCODE_LCONTROL)))
return FALSE;
@ -252,7 +254,7 @@ static BOOL input_send_keyboard_pause_event(rdpInput* input)
return FALSE;
/* Control up (0x1D) */
if (!input_send_keyboard_event(input, KBD_FLAGS_RELEASE,
if (!input_send_keyboard_event(input, KBD_FLAGS_RELEASE | KBD_FLAGS_EXTENDED1,
RDP_SCANCODE_CODE(RDP_SCANCODE_LCONTROL)))
return FALSE;
@ -291,6 +293,7 @@ static BOOL input_send_fastpath_keyboard_event(rdpInput* input, UINT16 flags, UI
rdp = input->context->rdp;
eventFlags |= (flags & KBD_FLAGS_RELEASE) ? FASTPATH_INPUT_KBDFLAGS_RELEASE : 0;
eventFlags |= (flags & KBD_FLAGS_EXTENDED) ? FASTPATH_INPUT_KBDFLAGS_EXTENDED : 0;
eventFlags |= (flags & KBD_FLAGS_EXTENDED1) ? FASTPATH_INPUT_KBDFLAGS_PREFIX_E1 : 0;
s = fastpath_input_pdu_init(rdp->fastpath, eventFlags, FASTPATH_INPUT_EVENT_SCANCODE);
if (!s)
@ -327,7 +330,7 @@ static BOOL input_send_fastpath_unicode_keyboard_event(rdpInput* input, UINT16 f
}
static BOOL input_send_fastpath_mouse_event(rdpInput* input, UINT16 flags,
UINT16 x, UINT16 y)
UINT16 x, UINT16 y)
{
wStream* s;
rdpRdp* rdp;
@ -341,7 +344,8 @@ static BOOL input_send_fastpath_mouse_event(rdpInput* input, UINT16 flags,
{
if (flags & PTR_FLAGS_HWHEEL)
{
WLog_WARN(TAG, "skip mouse event %"PRIu16"x%"PRIu16" flags=0x%04"PRIX16", no horizontal mouse wheel supported",
WLog_WARN(TAG,
"skip mouse event %"PRIu16"x%"PRIu16" flags=0x%04"PRIX16", no horizontal mouse wheel supported",
x, y, flags);
return TRUE;
}
@ -357,7 +361,7 @@ static BOOL input_send_fastpath_mouse_event(rdpInput* input, UINT16 flags,
}
static BOOL input_send_fastpath_extended_mouse_event(rdpInput* input, UINT16 flags,
UINT16 x, UINT16 y)
UINT16 x, UINT16 y)
{
wStream* s;
rdpRdp* rdp;
@ -367,7 +371,8 @@ static BOOL input_send_fastpath_extended_mouse_event(rdpInput* input, UINT16 fla
if (!input->context->settings->HasExtendedMouseEvent)
{
WLog_WARN(TAG, "skip extended mouse event %"PRIu16"x%"PRIu16" flags=0x%04"PRIX16", no extended mouse events supported",
WLog_WARN(TAG,
"skip extended mouse event %"PRIu16"x%"PRIu16" flags=0x%04"PRIX16", no extended mouse events supported",
x, y, flags);
return TRUE;
}