Fixed C_VGuiScreen sending reversed pressed/unpressed events to the panel

This commit is contained in:
Peter Covington 2023-08-01 17:46:29 -04:00
parent db0e0fc29e
commit e304b1a90e
No known key found for this signature in database
GPG Key ID: CE9E79A4A4BDE09B

View File

@ -480,13 +480,13 @@ void C_VGuiScreen::ClientThink( void )
if ((m_nButtonReleased & nBit) || m_bLoseThinkNextFrame) // for a button release on loosing focus if ((m_nButtonReleased & nBit) || m_bLoseThinkNextFrame) // for a button release on loosing focus
{ {
g_InputInternal->SetMouseCodeState(nButton, vgui::BUTTON_PRESSED); g_InputInternal->SetMouseCodeState(nButton, vgui::BUTTON_RELEASED);
vgui::ivgui()->PostMessage(focus, new KeyValues("MousePressed", "code", nButton), NULL); vgui::ivgui()->PostMessage(focus, new KeyValues("MouseReleased", "code", nButton), NULL);
} }
else if (m_nButtonPressed & nBit) else if (m_nButtonPressed & nBit)
{ {
g_InputInternal->SetMouseCodeState(nButton, vgui::BUTTON_RELEASED); g_InputInternal->SetMouseCodeState(nButton, vgui::BUTTON_PRESSED);
vgui::ivgui()->PostMessage(focus, new KeyValues("MouseReleased", "code", nButton), NULL); vgui::ivgui()->PostMessage(focus, new KeyValues("MousePressed", "code", nButton), NULL);
} }
} }
#endif // !MAPBASE #endif // !MAPBASE