Skip to content

Commit 5653f8d

Browse files
committed
ImGuiManager: Don't let non-imgui keys through
Stops hotkeys bound to some keys from activating in pause menu.
1 parent bae05a7 commit 5653f8d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/util/imgui_manager.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
#include <chrono>
3535
#include <cmath>
3636
#include <deque>
37-
#include <mutex>
3837
#include <limits>
38+
#include <mutex>
3939
#include <type_traits>
4040
#include <unordered_map>
4141

@@ -1358,15 +1358,15 @@ bool ImGuiManager::ProcessHostKeyEvent(InputBindingKey key, float value)
13581358
return false;
13591359

13601360
const auto iter = s_state.imgui_key_map.find(key.data);
1361-
if (iter == s_state.imgui_key_map.end())
1362-
return false;
1363-
1364-
GPUThread::RunOnThread([imkey = iter->second, pressed = (value != 0.0f)]() {
1365-
if (!s_state.imgui_context)
1366-
return;
1361+
if (iter != s_state.imgui_key_map.end())
1362+
{
1363+
GPUThread::RunOnThread([imkey = iter->second, pressed = (value != 0.0f)]() {
1364+
if (!s_state.imgui_context)
1365+
return;
13671366

1368-
SetImKeyState(s_state.imgui_context->IO, imkey, pressed);
1369-
});
1367+
SetImKeyState(s_state.imgui_context->IO, imkey, pressed);
1368+
});
1369+
}
13701370

13711371
return s_state.imgui_wants_keyboard.load(std::memory_order_acquire);
13721372
}

0 commit comments

Comments
 (0)