From 96168ff9181cb0bbb36ea8003b007b4c00edf98c Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Wed, 12 Jun 2024 16:16:47 +0100 Subject: [PATCH] Fix lookup of extended keys 6257dae74d647a8539e2c9a5e2b31d74ea70fd3f added a mapping of RDP scancodes to X11 keycodes to the XUP interface. The intention is to move this functionality from xorgxrdp to a common lookup in xrdp. The mapping of RDP scancodes for extended keys (e.g. Right-CTRL) is not being done correctly. --- xup/xup.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xup/xup.c b/xup/xup.c index 6c1a00f4..8bada6ba 100644 --- a/xup/xup.c +++ b/xup/xup.c @@ -311,7 +311,15 @@ lib_mod_event(struct mod *mod, int msg, tbus param1, tbus param2, /* 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); + if ((param4 & KBD_FLAG_EXT) != 0) + { + // Extended key - set bit 9 of the scancode for the lookup + param1 = scancode_to_keycode(param3 | 0x100); + } + else + { + param1 = scancode_to_keycode(param3); + } } init_stream(s, 8192);