diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index da44e949c0..72dacb1d35 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -955,7 +955,7 @@ bool EmuScreen::UnsyncKey(const KeyInput &key) { if (UI::IsFocusMovementEnabled() || (imguiVisible_ && imguiInited_)) { // Note: Allow some Vkeys through, so we can toggle the imgui for example (since we actually block the control mapper otherwise in imgui mode). // We need to manually implement it here :/ - if (imguiVisible_ && imguiInited_) { + if (imguiVisible_ && imguiInited_ && (key.flags & (KEY_UP | KEY_DOWN))) { InputMapping mapping(key.deviceId, key.keyCode); std::vector pspButtons; bool mappingFound = KeyMap::InputMappingToPspButton(mapping, &pspButtons); diff --git a/ext/imgui/imgui_impl_platform.cpp b/ext/imgui/imgui_impl_platform.cpp index 5fa614497e..a9b9b8f170 100644 --- a/ext/imgui/imgui_impl_platform.cpp +++ b/ext/imgui/imgui_impl_platform.cpp @@ -22,10 +22,10 @@ void ImGui_ImplPlatform_KeyEvent(const KeyInput &key) { default: { ImGuiKey keyCode = KeyCodeToImGui(key.keyCode); - if (keyCode == ImGuiKey_None) { - WARN_LOG(Log::System, "Unmapped ImGui keycode conversion from %d", key.keyCode); - } else { + if (keyCode != ImGuiKey_None) { io.AddKeyEvent(keyCode, true); + } else { + WARN_LOG(Log::System, "KeyDown: Unmapped ImGui keycode conversion from %d", key.keyCode); } break; } @@ -33,10 +33,15 @@ void ImGui_ImplPlatform_KeyEvent(const KeyInput &key) { } if (key.flags & KEY_UP) { ImGuiKey keyCode = KeyCodeToImGui(key.keyCode); - io.AddKeyEvent(keyCode, false); + if (keyCode != ImGuiKey_None) { + io.AddKeyEvent(keyCode, false); + } else { + WARN_LOG(Log::System, "KeyUp: Unmapped ImGui keycode conversion from %d", key.keyCode); + } } if (key.flags & KEY_CHAR) { const int unichar = key.unicodeChar; + if (unichar >= 0x20) { // Insert it! (todo: do it with a string insert) char buf[16];