mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2024-11-23 20:38:07 +01:00
Fix the last frame before not showing overlay
The last frame was sending inputs to the game window, making the game receive a <TAB>.
This commit is contained in:
parent
ca0ef4380a
commit
3c83e08d34
1 changed files with 6 additions and 1 deletions
|
@ -91,6 +91,7 @@ bool IgnoreMsg(UINT uMsg)
|
||||||
LRESULT CALLBACK Windows_Hook::HookWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK Windows_Hook::HookWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
Steam_Overlay* overlay = get_steam_client()->steam_overlay;
|
Steam_Overlay* overlay = get_steam_client()->steam_overlay;
|
||||||
|
bool show = overlay->ShowOverlay();
|
||||||
// Is the event is a key press
|
// Is the event is a key press
|
||||||
if (uMsg == WM_KEYDOWN)
|
if (uMsg == WM_KEYDOWN)
|
||||||
{
|
{
|
||||||
|
@ -99,11 +100,15 @@ LRESULT CALLBACK Windows_Hook::HookWndProc(HWND hWnd, UINT uMsg, WPARAM wParam,
|
||||||
{
|
{
|
||||||
// If Left Shift is pressed
|
// If Left Shift is pressed
|
||||||
if (GetAsyncKeyState(VK_LSHIFT) & (1 << 15))
|
if (GetAsyncKeyState(VK_LSHIFT) & (1 << 15))
|
||||||
|
{
|
||||||
overlay->ShowOverlay(!overlay->ShowOverlay());
|
overlay->ShowOverlay(!overlay->ShowOverlay());
|
||||||
|
if (overlay->ShowOverlay())
|
||||||
|
show = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (overlay->ShowOverlay())
|
if (show)
|
||||||
{
|
{
|
||||||
ImGui_ImplWin32_WndProcHandler(hWnd, uMsg, wParam, lParam);
|
ImGui_ImplWin32_WndProcHandler(hWnd, uMsg, wParam, lParam);
|
||||||
if (IgnoreMsg(uMsg))
|
if (IgnoreMsg(uMsg))
|
||||||
|
|
Loading…
Reference in a new issue