ImGuiManager: Don't let non-imgui keys through

Stops hotkeys bound to some keys from activating in pause menu.
pull/3589/head
Stenzek 7 days ago
parent bae05a7f67
commit 5653f8dd64
No known key found for this signature in database

@ -34,8 +34,8 @@
#include <chrono>
#include <cmath>
#include <deque>
#include <mutex>
#include <limits>
#include <mutex>
#include <type_traits>
#include <unordered_map>
@ -1358,15 +1358,15 @@ bool ImGuiManager::ProcessHostKeyEvent(InputBindingKey key, float value)
return false;
const auto iter = s_state.imgui_key_map.find(key.data);
if (iter == s_state.imgui_key_map.end())
return false;
GPUThread::RunOnThread([imkey = iter->second, pressed = (value != 0.0f)]() {
if (!s_state.imgui_context)
return;
if (iter != s_state.imgui_key_map.end())
{
GPUThread::RunOnThread([imkey = iter->second, pressed = (value != 0.0f)]() {
if (!s_state.imgui_context)
return;
SetImKeyState(s_state.imgui_context->IO, imkey, pressed);
});
SetImKeyState(s_state.imgui_context->IO, imkey, pressed);
});
}
return s_state.imgui_wants_keyboard.load(std::memory_order_acquire);
}

Loading…
Cancel
Save