From 6257dae74d647a8539e2c9a5e2b31d74ea70fd3f Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Mon, 22 Apr 2024 14:27:16 +0100 Subject: [PATCH] Send X11 keycode to xorgxrdp For key events, send the X11 keycode (currently based on evdev) to xorgxrdp rather than the Unicode character mapping for the key. This gives us a single source of truth for RDP scancode to X11 keycode mapping. At present xorgxrdp doesn't use the Unicode character, so no change is required at that end for this commit. --- xup/xup.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xup/xup.c b/xup/xup.c index 18ec05ed..6c1a00f4 100644 --- a/xup/xup.c +++ b/xup/xup.c @@ -26,6 +26,7 @@ #include "log.h" #include "trans.h" #include "string_calls.h" +#include "scancode.h" static int send_server_monitor_update(struct mod *v, struct stream *s, @@ -306,6 +307,11 @@ lib_mod_event(struct mod *mod, int msg, tbus param1, tbus param2, mod->shift_state = msg == 15; } } + + /* xup doesn't need the Unicode character mapping in param1. Send + * the X11 scancode instead, so xorgxrdp doesn't have to do this + * work again */ + param1 = scancode_to_keycode(param3); } init_stream(s, 8192);