From 3e5f8c6bdb8fefa9bbe604a57a818e7497247205 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 3 Jul 2017 19:45:59 +0200 Subject: [PATCH] Reuse evdev/X11 keymap for wayland --- client/Wayland/wlf_input.c | 2 +- libfreerdp/locale/CMakeLists.txt | 4 ++++ libfreerdp/locale/keyboard.c | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/client/Wayland/wlf_input.c b/client/Wayland/wlf_input.c index 00435ffff..7b43c4ca1 100644 --- a/client/Wayland/wlf_input.c +++ b/client/Wayland/wlf_input.c @@ -92,7 +92,7 @@ BOOL wlf_handle_key(freerdp *instance, UwacKeyEvent *ev) { rdpInput* input = instance->input; DWORD rdp_scancode; - rdp_scancode = (DWORD) ev->raw_key; + rdp_scancode = freerdp_keyboard_get_rdp_scancode_from_x11_keycode(ev->raw_key + 8); if (rdp_scancode == RDP_SCANCODE_UNKNOWN) return TRUE; diff --git a/libfreerdp/locale/CMakeLists.txt b/libfreerdp/locale/CMakeLists.txt index e418e0c9f..1a300f22f 100644 --- a/libfreerdp/locale/CMakeLists.txt +++ b/libfreerdp/locale/CMakeLists.txt @@ -69,4 +69,8 @@ if(WITH_X11) endif() endif() +if(WITH_WAYLAND) + freerdp_definition_add(-DWITH_WAYLAND) +endif() + freerdp_module_add(${${MODULE_PREFIX}_SRCS}) diff --git a/libfreerdp/locale/keyboard.c b/libfreerdp/locale/keyboard.c index dbbf1dd0a..bd467e638 100644 --- a/libfreerdp/locale/keyboard.c +++ b/libfreerdp/locale/keyboard.c @@ -98,7 +98,7 @@ int freerdp_keyboard_init_x11_evdev(DWORD* keyboardLayoutId, DWORD x11_keycode_t DWORD freerdp_keyboard_init(DWORD keyboardLayoutId) { DWORD keycode; -#if defined(__APPLE__) || defined(WITH_X11) +#if defined(__APPLE__) || defined(WITH_X11) || defined(WITH_WAYLAND) int status = -1; #endif @@ -107,7 +107,7 @@ DWORD freerdp_keyboard_init(DWORD keyboardLayoutId) status = freerdp_keyboard_init_apple(&keyboardLayoutId, X11_KEYCODE_TO_VIRTUAL_SCANCODE); #endif -#ifdef WITH_X11 +#if defined(WITH_X11) || defined(WITH_WAYLAND) #ifdef WITH_XKBFILE if (status < 0)