mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
[client,x11] use FREERDP_REMAP_TABLE
This commit is contained in:
@@ -1202,6 +1202,12 @@ static BOOL xf_pre_connect(freerdp* instance)
|
||||
|
||||
if (!freerdp_settings_get_bool(settings, FreeRDP_AuthenticationOnly))
|
||||
{
|
||||
const char* KeyboardRemappingList = freerdp_settings_get_string(
|
||||
xfc->common.context.settings, FreeRDP_KeyboardRemappingList);
|
||||
|
||||
xfc->remap_table = freerdp_keyboard_remap_string_to_list(KeyboardRemappingList);
|
||||
if (!xfc->remap_table)
|
||||
return FALSE;
|
||||
if (!xf_keyboard_init(xfc))
|
||||
return FALSE;
|
||||
if (!xf_keyboard_action_script_init(xfc))
|
||||
@@ -1492,6 +1498,9 @@ static void xf_post_disconnect(freerdp* instance)
|
||||
else
|
||||
xf_DestroyDummyWindow(xfc, xfc->drawable);
|
||||
|
||||
freerdp_keyboard_remap_free(xfc->remap_table);
|
||||
xfc->remap_table = NULL;
|
||||
|
||||
xf_window_free(xfc);
|
||||
}
|
||||
|
||||
|
||||
@@ -159,8 +159,7 @@ BOOL xf_keyboard_init(xfContext* xfc)
|
||||
|
||||
xf_keyboard_clear(xfc);
|
||||
xfc->KeyboardLayout = freerdp_settings_get_uint32(settings, FreeRDP_KeyboardLayout);
|
||||
xfc->KeyboardLayout = freerdp_keyboard_init_ex(
|
||||
xfc->KeyboardLayout, freerdp_settings_get_string(settings, FreeRDP_KeyboardRemappingList));
|
||||
xfc->KeyboardLayout = freerdp_keyboard_init_ex(xfc->KeyboardLayout, NULL);
|
||||
if (!freerdp_settings_set_uint32(settings, FreeRDP_KeyboardLayout, xfc->KeyboardLayout))
|
||||
return FALSE;
|
||||
|
||||
@@ -243,7 +242,8 @@ void xf_keyboard_send_key(xfContext* xfc, BOOL down, BOOL repeat, const XKeyEven
|
||||
rdpInput* input = xfc->common.context.input;
|
||||
WINPR_ASSERT(input);
|
||||
|
||||
const DWORD rdp_scancode = freerdp_keyboard_get_rdp_scancode_from_x11_keycode(event->keycode);
|
||||
const DWORD sc = freerdp_keyboard_get_rdp_scancode_from_x11_keycode(event->keycode);
|
||||
const DWORD rdp_scancode = freerdp_keyboard_remap_key(xfc->remap_table, sc);
|
||||
if (rdp_scancode == RDP_SCANCODE_PAUSE && !xf_keyboard_key_pressed(xfc, XK_Control_L) &&
|
||||
!xf_keyboard_key_pressed(xfc, XK_Control_R))
|
||||
{
|
||||
|
||||
@@ -53,6 +53,7 @@ typedef struct xf_context xfContext;
|
||||
#include <freerdp/codec/h264.h>
|
||||
#include <freerdp/codec/progressive.h>
|
||||
#include <freerdp/codec/region.h>
|
||||
#include <freerdp/locale/keyboard.h>
|
||||
|
||||
#if !defined(XcursorUInt)
|
||||
typedef unsigned int XcursorUInt;
|
||||
@@ -315,6 +316,7 @@ struct xf_context
|
||||
BOOL xi_event;
|
||||
HANDLE pipethread;
|
||||
wLog* log;
|
||||
FREERDP_REMAP_TABLE* remap_table;
|
||||
};
|
||||
|
||||
BOOL xf_create_window(xfContext* xfc);
|
||||
|
||||
Reference in New Issue
Block a user