From 0f341802e1cb164e2fc61ee274d83266e40cff64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 28 Jun 2022 22:26:39 +0200 Subject: [PATCH] Win32: Fix right Shift scancode when using CJK IME Fixes #2050 (cherry picked from commit 6dd526fb1a9c16c3170a0ebd2b5c73e4a2719245) --- CONTRIBUTORS.md | 1 + README.md | 1 + src/win32_window.c | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index dae0b2d9..0c7141b8 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -18,6 +18,7 @@ video tutorials. - Nevyn Bengtsson - Niklas Bergström - Denis Bernard + - BiBi - Doug Binks - blanco - Waris Boonyasiriwat diff --git a/README.md b/README.md index 92704e4e..4abb16c7 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,7 @@ information on what to include when reporting a bug. match event scancode (#1993) - [Win32] Bugfix: Instance-local operations used executable instance (#469,#1296,#1395) - [Win32] Bugfix: The OSMesa library was not unloaded on termination + - [Win32] Bugfix: Right shift emitted `GLFW_KEY_UNKNOWN` when using a CJK IME (#2050) - [Cocoa] Disabled macOS fullscreen when `GLFW_RESIZABLE` is false - [Cocoa] Bugfix: A connected Apple AirPlay would emit a useless error (#1791) - [Cocoa] Bugfix: The EGL and OSMesa libraries were not unloaded on termination diff --git a/src/win32_window.c b/src/win32_window.c index 7a32bf8c..073ceee9 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -756,6 +756,10 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, if (scancode == 0x146) scancode = 0x45; + // HACK: CJK IME sets the extended bit for right Shift + if (scancode == 0x136) + scancode = 0x36; + key = _glfw.win32.keycodes[scancode]; // The Ctrl keys require special handling