mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Engine: fix imgui regression causing inputs to be stuck
Holding a key while closing the panel will keep the message in the event queue, the next time one of the windows are opened, the message will be spammed. Send a null msg to clear it properly.
This commit is contained in:
parent
bae7df37ae
commit
1fd4c25cd0
@ -62,7 +62,6 @@ LRESULT CGame::ImguiWindowProc(HWND hWnd, UINT& uMsg, WPARAM wParam, LPARAM lPar
|
|||||||
|
|
||||||
if (g_Console.IsActivated() || g_Browser.IsActivated())
|
if (g_Console.IsActivated() || g_Browser.IsActivated())
|
||||||
{//////////////////////////////////////////////////////////////////////////////
|
{//////////////////////////////////////////////////////////////////////////////
|
||||||
g_bBlockInput = true;
|
|
||||||
hr = ImguiSystem()->MessageHandler(hWnd, uMsg, wParam, lParam);
|
hr = ImguiSystem()->MessageHandler(hWnd, uMsg, wParam, lParam);
|
||||||
|
|
||||||
switch (uMsg)
|
switch (uMsg)
|
||||||
@ -79,9 +78,20 @@ LRESULT CGame::ImguiWindowProc(HWND hWnd, UINT& uMsg, WPARAM wParam, LPARAM lPar
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_bBlockInput = true;
|
||||||
}//////////////////////////////////////////////////////////////////////////////
|
}//////////////////////////////////////////////////////////////////////////////
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (g_bBlockInput)
|
||||||
|
{
|
||||||
|
// Dry run with null msg to clear the event queue, we have to do this as
|
||||||
|
// the menu's can be closed while still holding down a key. That key will
|
||||||
|
// remain in the event queue so the next time a window is opened, that
|
||||||
|
// key will be spammed until that particular key msg is sent here again.
|
||||||
|
hr = ImguiSystem()->MessageHandler(hWnd, WM_NULL, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
g_bBlockInput = false;
|
g_bBlockInput = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user