libfreerdp-core: fix async input mode for FocusInEvent, KeyboardPauseEvent

This commit is contained in:
Marc-André Moreau 2014-12-15 11:35:35 -05:00
parent 9b28562cc1
commit 736bcf2bd6
4 changed files with 48 additions and 1 deletions

View File

@ -64,11 +64,11 @@ typedef struct rdp_input_proxy rdpInputProxy;
typedef void (*pSynchronizeEvent)(rdpInput* input, UINT32 flags);
typedef void (*pKeyboardEvent)(rdpInput* input, UINT16 flags, UINT16 code);
typedef void (*pKeyboardPauseEvent)(rdpInput* input);
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);
typedef void (*pFocusInEvent)(rdpInput* input, UINT16 toggleStates, UINT16 x, UINT16 y);
typedef void (*pKeyboardPauseEvent)(rdpInput* input);
struct rdp_input
{

View File

@ -231,12 +231,16 @@
#define Input_UnicodeKeyboardEvent 3
#define Input_MouseEvent 4
#define Input_ExtendedMouseEvent 5
#define Input_FocusInEvent 6
#define Input_KeyboardPauseEvent 7
#define FREERDP_INPUT_SYNCHRONIZE_EVENT MakeMessageId(Input, SynchronizeEvent)
#define FREERDP_INPUT_KEYBOARD_EVENT MakeMessageId(Input, KeyboardEvent)
#define FREERDP_INPUT_UNICODE_KEYBOARD_EVENT MakeMessageId(Input, UnicodeKeyboardEvent)
#define FREERDP_INPUT_MOUSE_EVENT MakeMessageId(Input, MouseEvent)
#define FREERDP_INPUT_EXTENDED_MOUSE_EVENT MakeMessageId(Input, ExtendedMouseEvent)
#define FREERDP_INPUT_FOCUS_IN_EVENT MakeMessageId(Input, FocusInEvent)
#define FREERDP_INPUT_KEYBOARD_PAUSE_EVENT MakeMessageId(Input, KeyboardPauseEvent)
/**
* Static Channel Message Queues

View File

@ -2265,6 +2265,20 @@ static void input_message_ExtendedMouseEvent(rdpInput* input, UINT16 flags, UINT
MakeMessageId(Input, ExtendedMouseEvent), (void*) (size_t) flags, (void*) (size_t) pos);
}
static void input_message_FocusInEvent(rdpInput* input, UINT16 toggleStates, UINT16 x, UINT16 y)
{
UINT32 pos = (x << 16) | y;
MessageQueue_Post(input->queue, (void*) input,
MakeMessageId(Input, FocusInEvent), (void*) (size_t) toggleStates, (void*) (size_t) pos);
}
static void input_message_KeyboardPauseEvent(rdpInput* input)
{
MessageQueue_Post(input->queue, (void*) input,
MakeMessageId(Input, KeyboardPauseEvent), NULL, NULL);
}
/* Event Queue */
static int input_message_free_input_class(wMessage* msg, int type)
{
@ -2287,6 +2301,12 @@ static int input_message_free_input_class(wMessage* msg, int type)
case Input_ExtendedMouseEvent:
break;
case Input_FocusInEvent:
break;
case Input_KeyboardPauseEvent:
break;
default:
status = -1;
break;
@ -2339,6 +2359,23 @@ static int input_message_process_input_class(rdpInputProxy* proxy, wMessage* msg
}
break;
case Input_FocusInEvent:
{
UINT32 pos;
UINT16 x, y;
pos = (UINT32) (size_t) msg->lParam;
x = ((pos & 0xFFFF0000) >> 16);
y = (pos & 0x0000FFFF);
IFCALL(proxy->FocusInEvent, msg->context, (UINT16) (size_t) msg->wParam, x, y);
}
break;
case Input_KeyboardPauseEvent:
IFCALL(proxy->KeyboardPauseEvent, msg->context);
break;
default:
status = -1;
break;
@ -2463,12 +2500,16 @@ void input_message_proxy_register(rdpInputProxy* proxy, rdpInput* input)
proxy->UnicodeKeyboardEvent = input->UnicodeKeyboardEvent;
proxy->MouseEvent = input->MouseEvent;
proxy->ExtendedMouseEvent = input->ExtendedMouseEvent;
proxy->FocusInEvent = input->FocusInEvent;
proxy->KeyboardPauseEvent = input->KeyboardPauseEvent;
input->SynchronizeEvent = input_message_SynchronizeEvent;
input->KeyboardEvent = input_message_KeyboardEvent;
input->UnicodeKeyboardEvent = input_message_UnicodeKeyboardEvent;
input->MouseEvent = input_message_MouseEvent;
input->ExtendedMouseEvent = input_message_ExtendedMouseEvent;
input->FocusInEvent = input_message_FocusInEvent;
input->KeyboardPauseEvent = input_message_KeyboardPauseEvent;
}
rdpInputProxy* input_message_proxy_new(rdpInput* input)

View File

@ -150,6 +150,8 @@ struct rdp_input_proxy
pUnicodeKeyboardEvent UnicodeKeyboardEvent;
pMouseEvent MouseEvent;
pExtendedMouseEvent ExtendedMouseEvent;
pFocusInEvent FocusInEvent;
pKeyboardPauseEvent KeyboardPauseEvent;
};
int input_message_queue_process_message(rdpInput* input, wMessage* message);