From f5f93a12b9d16cd8b6c37de26cd109bbefe3f403 Mon Sep 17 00:00:00 2001 From: FoxRefire <155989196+FoxRefire@users.noreply.github.com> Date: Sat, 22 Aug 2026 20:28:36 +0900 Subject: [PATCH] Fix Japanese keyboard mapping --- src/platform/virtualhid_input.cpp | 2 +- tests/unit/platform/test_virtualhid_input.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/platform/virtualhid_input.cpp b/src/platform/virtualhid_input.cpp index b7aee98299a..9efdfe0e105 100644 --- a/src/platform/virtualhid_input.cpp +++ b/src/platform/virtualhid_input.cpp @@ -311,7 +311,7 @@ namespace platf::virtualhid { event.uses_normalized_key_code = (static_cast(flags) & static_cast(SS_KBE_FLAG_NON_NORMALIZED)) == std::byte {}; event.prefer_native_scan_code = config::input.always_send_scancodes; #else - (void) flags; + event.uses_normalized_key_code = (static_cast(flags) & static_cast(SS_KBE_FLAG_NON_NORMALIZED)) == std::byte {}; #endif return event; } diff --git a/tests/unit/platform/test_virtualhid_input.cpp b/tests/unit/platform/test_virtualhid_input.cpp index cfc0fa71cb0..5ba04ac9cca 100644 --- a/tests/unit/platform/test_virtualhid_input.cpp +++ b/tests/unit/platform/test_virtualhid_input.cpp @@ -629,10 +629,11 @@ TEST_F(VirtualHidDeviceTest, TranslatesMouseAndKeyboardInput) { keyboard_event = context()->keyboard->last_submitted_event(); EXPECT_FALSE(keyboard_event.uses_normalized_key_code); #else - EXPECT_FALSE(keyboard_event.uses_normalized_key_code); + EXPECT_TRUE(keyboard_event.uses_normalized_key_code); EXPECT_FALSE(keyboard_event.prefer_native_scan_code); - platf::virtualhid::keyboard_update(*context(), 0x41, true, 0xFF); + platf::virtualhid::keyboard_update(*context(), 0x41, true, SS_KBE_FLAG_NON_NORMALIZED); keyboard_event = context()->keyboard->last_submitted_event(); + EXPECT_FALSE(keyboard_event.uses_normalized_key_code); #endif EXPECT_FALSE(keyboard_event.pressed);