From eda2ad8965daf5f54b26a613ffcf5bcdc3eca772 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Aug 2024 00:00:26 +0200 Subject: [PATCH] Fixed windows cursor while being on top panel --- inputsystem/inputsystem.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/inputsystem/inputsystem.cpp b/inputsystem/inputsystem.cpp index 6fd74a0171..8c065e523f 100644 --- a/inputsystem/inputsystem.cpp +++ b/inputsystem/inputsystem.cpp @@ -5,12 +5,16 @@ //===========================================================================// #include "inputsystem.h" +#include "dbg.h" #include "key_translation.h" #include "inputsystem/ButtonCode.h" #include "inputsystem/AnalogCode.h" #include "tier0/etwprof.h" #include "tier1/convar.h" #include "tier0/icommandline.h" +#include "tier3/tier3.h" +#include "vgui/IInput.h" +#include #if defined( USE_SDL ) #undef M_PI @@ -289,7 +293,6 @@ static LRESULT CALLBACK InputSystemWindowProc( HWND hwnd, UINT uMsg, WPARAM wPar } #endif - //----------------------------------------------------------------------------- // Hooks input listening up to a window //----------------------------------------------------------------------------- @@ -606,6 +609,12 @@ void CInputSystem::PollInputState_Windows() // dispatching messages can cause the FPU control word to change SetupFPUControlWord(); } + + InputState_t &state = m_InputState[ m_bIsPolling ]; + + POINT point; + GetCursorPos(&point); + UpdateMousePositionState(state, point.x, point.y); } #endif @@ -1424,15 +1433,6 @@ LRESULT CInputSystem::WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP #endif // !USE_SDL - case WM_MOUSEMOVE: - { - UpdateMousePositionState( state, (short)LOWORD(lParam), (short)HIWORD(lParam) ); - - int nButtonMask = ButtonMaskFromMouseWParam( wParam ); - UpdateMouseButtonState( nButtonMask ); - } - break; - } #if defined( PLATFORM_WINDOWS_PC ) && !defined( USE_SDL )