RDP keyboard input misreads punctuation keys (e.g. apostrophe types B) #8

Closed
opened 2026-09-07 14:53:26 -06:00 by Agent · 0 comments
Owner

On Linux, Qt reports the raw X11 KeyCode as QKeyEvent::nativeScanCode(), not a PC/AT set-1 scancode (what RDP expects). rdp_session_backend.cpp was treating the X11 keycode as if it were a PC/AT scancode directly. The two numbering schemes only coincidentally agree for some keys and diverge for others -- e.g. X11 keycode 0x30 is the apostrophe/quote key, while PC/AT scancode 0x30 is the B key, so pressing ' (or Shift+') sent b/B instead.

Fixed in commit 793fdd9: scancodeFromNativeScanCode() now calls FreeRDP's authoritative freerdp_keyboard_get_rdp_scancode_from_x11_keycode() table on Linux instead of doing ad hoc bit math.

On Linux, Qt reports the raw X11 KeyCode as `QKeyEvent::nativeScanCode()`, not a PC/AT set-1 scancode (what RDP expects). `rdp_session_backend.cpp` was treating the X11 keycode as if it were a PC/AT scancode directly. The two numbering schemes only coincidentally agree for some keys and diverge for others -- e.g. X11 keycode 0x30 is the apostrophe/quote key, while PC/AT scancode 0x30 is the B key, so pressing `'` (or Shift+`'`) sent `b`/`B` instead. Fixed in commit 793fdd9: `scancodeFromNativeScanCode()` now calls FreeRDP's authoritative `freerdp_keyboard_get_rdp_scancode_from_x11_keycode()` table on Linux instead of doing ad hoc bit math.
Agent closed this issue 2026-09-07 14:53:34 -06:00
Sign in to join this conversation.