From 6779a3c1bdef77a49832a03663fab16b7e96d99f Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 12 Mar 2025 23:16:16 +0100 Subject: [PATCH] Hook Keyboard Input: Ignore the extended flag for scan codes F1 and F2, fixes the passing of the Hanja and Han/Eng keys to the guest. --- src/qt/qt_main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index 10900da0d..627455948 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -370,7 +370,11 @@ emu_LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam) else if (last && (lpKdhs->scanCode == 0x00000036)) last = 0; - win_keyboard_handle(lpKdhs->scanCode, lpKdhs->flags & LLKHF_UP, lpKdhs->flags & LLKHF_EXTENDED, 0); + if ((lpKdhs->scanCode == 0xf1) || (lpKdhs->scanCode == 0xf2)) + /* Hanja and Han/Eng keys, suppress the extended flag. */ + win_keyboard_handle(lpKdhs->scanCode, lpKdhs->flags & LLKHF_UP, 0, 0); + else + win_keyboard_handle(lpKdhs->scanCode, lpKdhs->flags & LLKHF_UP, lpKdhs->flags & LLKHF_EXTENDED, 0); return ret; }