Merge pull request #2135 from erbth/wfreerdp
Added lock key synchronization to wfreerdp
This commit is contained in:
commit
9ce862edc8
@ -738,6 +738,12 @@ DWORD WINAPI wf_client_thread(LPVOID lpParam)
|
|||||||
rcount = 0;
|
rcount = 0;
|
||||||
wcount = 0;
|
wcount = 0;
|
||||||
|
|
||||||
|
if (freerdp_focus_required(instance))
|
||||||
|
{
|
||||||
|
wf_event_focus_in(wfc);
|
||||||
|
wf_event_focus_in(wfc);
|
||||||
|
}
|
||||||
|
|
||||||
if (!async_transport)
|
if (!async_transport)
|
||||||
{
|
{
|
||||||
if (freerdp_get_fds(instance, rfds, &rcount, wfds, &wcount) != TRUE)
|
if (freerdp_get_fds(instance, rfds, &rcount, wfds, &wcount) != TRUE)
|
||||||
|
@ -132,8 +132,8 @@ LRESULT CALLBACK wf_ll_kbd_proc(int nCode, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
freerdp_input_send_keyboard_event_ex(input, !(p->flags & LLKHF_UP), rdp_scancode);
|
freerdp_input_send_keyboard_event_ex(input, !(p->flags & LLKHF_UP), rdp_scancode);
|
||||||
|
|
||||||
if (p->vkCode == VK_CAPITAL)
|
if (p->vkCode == VK_NUMLOCK || p->vkCode == VK_CAPITAL || p->vkCode == VK_SCROLL || p->vkCode == VK_KANA)
|
||||||
DEBUG_KBD("caps lock is processed on client side too to toggle caps lock indicator");
|
DEBUG_KBD("lock keys are processed on client side too to toggle their indicators");
|
||||||
else
|
else
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
@ -153,6 +153,34 @@ LRESULT CALLBACK wf_ll_kbd_proc(int nCode, WPARAM wParam, LPARAM lParam)
|
|||||||
return CallNextHookEx(NULL, nCode, wParam, lParam);
|
return CallNextHookEx(NULL, nCode, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wf_event_focus_in(wfContext* wfc)
|
||||||
|
{
|
||||||
|
UINT16 syncFlags;
|
||||||
|
rdpInput* input;
|
||||||
|
UINT16 mouseX, mouseY;
|
||||||
|
|
||||||
|
input = wfc->instance->input;
|
||||||
|
|
||||||
|
syncFlags = 0;
|
||||||
|
|
||||||
|
if (GetKeyState(VK_NUMLOCK))
|
||||||
|
syncFlags |= KBD_SYNC_NUM_LOCK;
|
||||||
|
|
||||||
|
if (GetKeyState(VK_CAPITAL))
|
||||||
|
syncFlags |= KBD_SYNC_CAPS_LOCK;
|
||||||
|
|
||||||
|
if (GetKeyState(VK_SCROLL))
|
||||||
|
syncFlags |= KBD_SYNC_SCROLL_LOCK;
|
||||||
|
|
||||||
|
if (GetKeyState(VK_KANA))
|
||||||
|
syncFlags |= KBD_SYNC_KANA_LOCK;
|
||||||
|
|
||||||
|
mouseX = 0;
|
||||||
|
mouseY = 0;
|
||||||
|
|
||||||
|
input->FocusInEvent(input, syncFlags, mouseX, mouseY);
|
||||||
|
}
|
||||||
|
|
||||||
static int wf_event_process_WM_MOUSEWHEEL(wfContext* wfc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
static int wf_event_process_WM_MOUSEWHEEL(wfContext* wfc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
int delta;
|
int delta;
|
||||||
@ -230,6 +258,7 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam
|
|||||||
ptr = GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
ptr = GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
wfc = (wfContext*) ptr;
|
wfc = (wfContext*) ptr;
|
||||||
|
|
||||||
|
|
||||||
if (wfc != NULL)
|
if (wfc != NULL)
|
||||||
{
|
{
|
||||||
input = wfc->instance->input;
|
input = wfc->instance->input;
|
||||||
@ -540,6 +569,7 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam
|
|||||||
if (alt_ctrl_down())
|
if (alt_ctrl_down())
|
||||||
g_flipping_in = TRUE;
|
g_flipping_in = TRUE;
|
||||||
g_focus_hWnd = hWnd;
|
g_focus_hWnd = hWnd;
|
||||||
|
freerdp_set_focus(wfc->instance);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_KILLFOCUS:
|
case WM_KILLFOCUS:
|
||||||
|
@ -254,6 +254,7 @@ FREERDP_API freerdp* freerdp_new(void);
|
|||||||
FREERDP_API void freerdp_free(freerdp* instance);
|
FREERDP_API void freerdp_free(freerdp* instance);
|
||||||
|
|
||||||
FREERDP_API BOOL freerdp_focus_required(freerdp* instance);
|
FREERDP_API BOOL freerdp_focus_required(freerdp* instance);
|
||||||
|
FREERDP_API void freerdp_set_focus(freerdp* instance);
|
||||||
|
|
||||||
FREERDP_API UINT32 freerdp_get_last_error(rdpContext* context);
|
FREERDP_API UINT32 freerdp_get_last_error(rdpContext* context);
|
||||||
FREERDP_API void freerdp_set_last_error(rdpContext* context, UINT32 lastError);
|
FREERDP_API void freerdp_set_last_error(rdpContext* context, UINT32 lastError);
|
||||||
|
@ -358,6 +358,14 @@ FREERDP_API BOOL freerdp_focus_required(freerdp* instance)
|
|||||||
return bRetCode;
|
return bRetCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void freerdp_set_focus(freerdp* instance)
|
||||||
|
{
|
||||||
|
rdpRdp* rdp;
|
||||||
|
|
||||||
|
rdp = instance->context->rdp;
|
||||||
|
rdp->resendFocus = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
void freerdp_get_version(int* major, int* minor, int* revision)
|
void freerdp_get_version(int* major, int* minor, int* revision)
|
||||||
{
|
{
|
||||||
if (major != NULL)
|
if (major != NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user