From 8e35b501a4542d5f2c9c6166d99cddcf439d0a0f Mon Sep 17 00:00:00 2001 From: SlowRiot Date: Tue, 31 Mar 2026 16:33:50 +0100 Subject: [PATCH] fix comments on focus gain / loss --- backends/imgui_impl_emscripten.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backends/imgui_impl_emscripten.cpp b/backends/imgui_impl_emscripten.cpp index 5a203d5e0..e8a9f24bf 100644 --- a/backends/imgui_impl_emscripten.cpp +++ b/backends/imgui_impl_emscripten.cpp @@ -586,7 +586,7 @@ void ImGui_ImplEmscripten_Init() [](int /*event_type*/, EmscriptenFocusEvent const* /*event*/, void* /*data*/) { // event_type == EMSCRIPTEN_EVENT_BLUR ImGuiIO& io{ImGui::GetIO()}; io.AddFocusEvent(false); - io.ClearInputKeys(); // clear pending input keys on focus gain + io.ClearInputKeys(); // clear pending input keys on focus loss return true; // the event was consumed } ); @@ -597,7 +597,7 @@ void ImGui_ImplEmscripten_Init() [](int /*event_type*/, EmscriptenFocusEvent const* /*event*/, void* /*data*/) { // event_type == EMSCRIPTEN_EVENT_FOCUS ImGuiIO& io{ImGui::GetIO()}; io.AddFocusEvent(true); - io.ClearInputKeys(); // clear pending input keys on focus loss - for example if you press tab to cycle to another part of the UI + io.ClearInputKeys(); // clear pending input keys on focus gain - for example if you press tab to cycle back into the browser window return true; // the event was consumed } );