mirror of
https://github.com/EricPlayZ/EGameTools.git
synced 2026-10-10 12:53:04 +08:00
fixed an issue with F10 not getting detected as a key press when switching hotkeys
This commit is contained in:
@@ -17,6 +17,17 @@ extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg
|
||||
|
||||
LRESULT __stdcall hkWindowProc(_In_ HWND hwnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam) {
|
||||
switch (uMsg) {
|
||||
case WM_SYSKEYDOWN:
|
||||
if (ImGui::isAnyHotkeyBtnPressed || !ImGui::timeSinceHotkeyBtnPressed.GetTimePassed() || KeyBindOption::wasAnyKeyPressed)
|
||||
break;
|
||||
|
||||
for (auto& option : KeyBindOption::GetInstances()) {
|
||||
if (wParam == option->GetKeyBind()) {
|
||||
KeyBindOption::wasAnyKeyPressed = true;
|
||||
option->Toggle();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WM_KEYDOWN:
|
||||
if (ImGui::isAnyHotkeyBtnPressed || !ImGui::timeSinceHotkeyBtnPressed.GetTimePassed() || KeyBindOption::wasAnyKeyPressed)
|
||||
break;
|
||||
@@ -28,6 +39,15 @@ LRESULT __stdcall hkWindowProc(_In_ HWND hwnd, _In_ UINT uMsg, _In_ WPARAM wPara
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WM_SYSKEYUP:
|
||||
if (!KeyBindOption::wasAnyKeyPressed)
|
||||
break;
|
||||
|
||||
for (auto& option : KeyBindOption::GetInstances()) {
|
||||
if (wParam == option->GetKeyBind())
|
||||
KeyBindOption::wasAnyKeyPressed = false;
|
||||
}
|
||||
break;
|
||||
case WM_KEYUP:
|
||||
if (!KeyBindOption::wasAnyKeyPressed)
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user