** Description changed:

+ [ Impact ]
+ 
+ On Ubuntu 26.04, a Windows client that reports keyboard type 8 (Korean 
keyboard) gets its keyboard input shifted by one key over RDP to a 
FreeRDP-based server such as gnome-remote-desktop Remote Login.
+ Typing "1234567890" produces "134567890-"; the "2" key produces "3", "a" 
produces "s", and so on for every key from the "2" position onward.
+ A Korean keyboard is almost unusable over RDP.
+ 
+ The cause is libwinpr's KBD8T scancode-to-virtual-key table in 
winpr/libwinpr/input/scancode.c.
+ Scancode 0x03 (the physical "2" key) mapped to VK_KEY_3 instead of VK_KEY_2, 
so VK_KEY_2 was missing and every following entry was off by one.
+ The table is used only for keyboard type 8 (WINPR_KBD_TYPE_KOREAN); other 
keyboard types are unaffected.
+ 
+ [ Test Plan ]
+ 
+ GetVirtualKeyCodeFromVirtualScanCode() is exported by libwinpr and returns 
KBD8T[scancode] for keyboard type 8, so the table can be checked directly 
without an RDP session.
+ Scancode 0x03 is the physical "2" key and must map to VK_KEY_2 (0x32).
+ 
+   cat > kbd8t-repro.c <<'EOF'
+   #include <stdio.h>
+   #include <winpr/input.h>
+   int main(void) {
+       DWORD vk = GetVirtualKeyCodeFromVirtualScanCode(0x03, 
WINPR_KBD_TYPE_KOREAN);
+       printf("scancode 0x03 (physical '2') -> VK 0x%02X, expect 0x32\n", vk);
+       return vk == VK_KEY_2 ? 0 : 1;
+   }
+   EOF
+   sudo apt-get install -y build-essential pkg-config libwinpr3-dev
+   gcc kbd8t-repro.c $(pkg-config --cflags --libs winpr3) -o kbd8t-repro
+   ./kbd8t-repro; echo "exit=$?"
+ 
+ Before the fix (3.24.2+dfsg-1ubuntu1.1):
+   scancode 0x03 (physical '2') -> VK 0x33, expect 0x32
+   exit=1
+ 
+ After the fix:
+   scancode 0x03 (physical '2') -> VK 0x32, expect 0x32
+   exit=0
+ 
+ Same as the reported symptom over RDP: with keyboard type 8, typing
+ "1234567890" gave "134567890-" before the fix and "1234567890" after it.
+ 
+ [ Where problems could occur ]
+ 
+ The change is confined to the KBD8T table (and the matching reverse-lookup 
path) in winpr/libwinpr/input/scancode.c, selected only for 
WINPR_KBD_TYPE_KOREAN.
+ Keyboard type 4 (IBM enhanced) and type 7 (Japanese) use separate tables and 
are not touched, so non-Korean keyboards cannot regress.
+ 
+ A regression would show up as a different key on a Korean type-8 keyboard 
being misrouted, if a table entry were mistranscribed.
+ The actual change is a single missing entry: VK_KEY_2 is inserted at the "2" 
scancode and the rest of KBD8T shifts down by one. The large +307/-50 diff is 
almost entirely reformatting, KBD8T and KBD8X re-laid-out to fewer entries per 
line, with the KBD8X values unchanged.
+ 
+ [ Other Info ]
+ 
+ Fixed upstream in FreeRDP 3.25.0.
+ Upstream issue: https://github.com/FreeRDP/FreeRDP/issues/12645
+ Upstream fix:   https://github.com/FreeRDP/FreeRDP/pull/12646
+ Commit:         35d61e59a223e923b7d441ba4a34703900605158
+ 
+ Original Desciption.
+ 
  I am seeing a keyboard input mapping issue when using GNOME Remote
  Desktop Remote Login on Ubuntu 26.04.
  
  Environment:
  - Ubuntu release: 26.04 resolute
  - Package: libfreerdp3-3
  - Installed version: 3.24.2+dfsg-1ubuntu1
  - Remote desktop server: gnome-remote-desktop Remote Login, system mode RDP
  - Client OS: Windows
  - Clients tested:
-   - mstsc.exe
-   - Windows App
+   - mstsc.exe
+   - Windows App
  - Keyboard/input sources tested:
-   - English (US)
-   - Korean
+   - English (US)
+   - Korean
  
  Problem:
  When connecting from Windows to Ubuntu 26.04 GNOME Remote Desktop via RDP, 
keyboard input is shifted by one key for the Korean keyboard type.
  
  Example:
  - Pressed: 1234567890
  - Actual:  134567890-
  
  The same issue occurs with both mstsc.exe and Windows App. Windows local
  keyboard input is normal. Changing GNOME input sources between English
  (US) and Korean does not fix the issue, which suggests this is related
  to keyboard type rather than keyboard layout.
  
  This appears to match the upstream FreeRDP issue:
  https://github.com/FreeRDP/FreeRDP/issues/12645
  
  The upstream fix appears to be:
  https://github.com/FreeRDP/FreeRDP/pull/12646
  
  According to the upstream discussion, the fix is included in FreeRDP
  3.25.0. However, Ubuntu 26.04 currently ships libfreerdp3-3
  3.24.2+dfsg-1ubuntu1.
  
  Current package version:
  $ apt policy libfreerdp3-3
  libfreerdp3-3:
-   Installed: 3.24.2+dfsg-1ubuntu1
-   Candidate: 3.24.2+dfsg-1ubuntu1
+   Installed: 3.24.2+dfsg-1ubuntu1
+   Candidate: 3.24.2+dfsg-1ubuntu1
  
  Expected result:
  Typing 1234567890 should produce 1234567890.
  
  Actual result:
  Typing 1234567890 produces 134567890-.
  
  Request:
  Please consider backporting the upstream FreeRDP fix from PR #12646 to Ubuntu 
26.04's freerdp3 package, or updating freerdp3 to 3.25.0 or later in 
resolute-updates.
  
  ProblemType: Bug
  DistroRelease: Ubuntu 26.04
  Package: libfreerdp3-3 3.24.2+dfsg-1ubuntu1
  ProcVersionSignature: Ubuntu 7.0.0-22.22-generic 7.0.0
  Uname: Linux 7.0.0-22-generic x86_64
  ApportVersion: 2.34.0-0ubuntu2
  Architecture: amd64
  CasperMD5CheckResult: unknown
  CurrentDesktop: ubuntu:GNOME
  Date: Tue Jun  2 16:22:45 2026
  InstallationDate: Installed on 2026-06-01 (1 days ago)
  InstallationMedia: Ubuntu 26.04 "Resolute Raccoon" - Release amd64 
(20260423.1)
  ProcEnviron:
-  LANG=en_US.UTF-8
-  PATH=(custom, no user)
-  SHELL=/bin/bash
-  TERM=xterm-256color
-  XDG_RUNTIME_DIR=<set>
+  LANG=en_US.UTF-8
+  PATH=(custom, no user)
+  SHELL=/bin/bash
+  TERM=xterm-256color
+  XDG_RUNTIME_DIR=<set>
  SourcePackage: freerdp3
  UpgradeStatus: No upgrade log present (probably fresh install)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2154803

Title:
  Korean keyboard type input shifted in GNOME Remote Desktop RDP due to
  FreeRDP #12646, fixed upstream in 3.25.0

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/freerdp3/+bug/2154803/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to