1
0
Fork 0
mirror of https://gitlab.com/Mr_Goldberg/goldberg_emulator.git synced 2024-11-14 10:50:13 +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:
Nemirtingas 2019-08-18 17:49:47 +02:00
parent ca0ef4380a
commit 3c83e08d34

View file

@ -91,6 +91,7 @@ bool IgnoreMsg(UINT uMsg)
LRESULT CALLBACK Windows_Hook::HookWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
Steam_Overlay* overlay = get_steam_client()->steam_overlay;
bool show = overlay->ShowOverlay();
// Is the event is a key press
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 (GetAsyncKeyState(VK_LSHIFT) & (1 << 15))
{
overlay->ShowOverlay(!overlay->ShowOverlay());
if (overlay->ShowOverlay())
show = true;
}
}
}
if (overlay->ShowOverlay())
if (show)
{
ImGui_ImplWin32_WndProcHandler(hWnd, uMsg, wParam, lParam);
if (IgnoreMsg(uMsg))