Disable relative joystick when console is open or window not focused

It shouldn't be possible to move the joystick when the console is open or when the window is not focused.
This commit is contained in:
Robert Müller 2023-01-26 22:06:11 +01:00
parent f25ffd9669
commit 35c863b4d2

View file

@ -212,7 +212,7 @@ void CInput::CJoystick::GetHatValue(int Hat, int (&HatKeys)[2])
bool CInput::CJoystick::Relative(float *pX, float *pY)
{
if(!g_Config.m_InpControllerEnable)
if(!Input()->m_MouseFocus || !Input()->m_InputGrabbed || !g_Config.m_InpControllerEnable)
return false;
const vec2 RawJoystickPos = vec2(GetAxisValue(g_Config.m_InpControllerX), GetAxisValue(g_Config.m_InpControllerY));