mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
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:
parent
f25ffd9669
commit
35c863b4d2
|
@ -212,7 +212,7 @@ void CInput::CJoystick::GetHatValue(int Hat, int (&HatKeys)[2])
|
||||||
|
|
||||||
bool CInput::CJoystick::Relative(float *pX, float *pY)
|
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;
|
return false;
|
||||||
|
|
||||||
const vec2 RawJoystickPos = vec2(GetAxisValue(g_Config.m_InpControllerX), GetAxisValue(g_Config.m_InpControllerY));
|
const vec2 RawJoystickPos = vec2(GetAxisValue(g_Config.m_InpControllerX), GetAxisValue(g_Config.m_InpControllerY));
|
||||||
|
|
Loading…
Reference in a new issue