From e304b1a90eb29ec47a40aa6a144acb2759b97ded Mon Sep 17 00:00:00 2001 From: Peter Covington Date: Tue, 1 Aug 2023 17:46:29 -0400 Subject: [PATCH] Fixed C_VGuiScreen sending reversed pressed/unpressed events to the panel --- sp/src/game/client/c_vguiscreen.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sp/src/game/client/c_vguiscreen.cpp b/sp/src/game/client/c_vguiscreen.cpp index 3dc9cfd9..c2c17723 100644 --- a/sp/src/game/client/c_vguiscreen.cpp +++ b/sp/src/game/client/c_vguiscreen.cpp @@ -480,13 +480,13 @@ void C_VGuiScreen::ClientThink( void ) if ((m_nButtonReleased & nBit) || m_bLoseThinkNextFrame) // for a button release on loosing focus { - g_InputInternal->SetMouseCodeState(nButton, vgui::BUTTON_PRESSED); - vgui::ivgui()->PostMessage(focus, new KeyValues("MousePressed", "code", nButton), NULL); + g_InputInternal->SetMouseCodeState(nButton, vgui::BUTTON_RELEASED); + vgui::ivgui()->PostMessage(focus, new KeyValues("MouseReleased", "code", nButton), NULL); } else if (m_nButtonPressed & nBit) { - g_InputInternal->SetMouseCodeState(nButton, vgui::BUTTON_RELEASED); - vgui::ivgui()->PostMessage(focus, new KeyValues("MouseReleased", "code", nButton), NULL); + g_InputInternal->SetMouseCodeState(nButton, vgui::BUTTON_PRESSED); + vgui::ivgui()->PostMessage(focus, new KeyValues("MousePressed", "code", nButton), NULL); } } #endif // !MAPBASE