mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Reset relative mouse motion on toggle
This commit is contained in:
parent
0393ac0f88
commit
734ed86bd9
|
@ -89,6 +89,8 @@ void CInput::MouseModeRelative()
|
||||||
m_InputGrabbed = 1;
|
m_InputGrabbed = 1;
|
||||||
SDL_SetRelativeMouseMode(SDL_TRUE);
|
SDL_SetRelativeMouseMode(SDL_TRUE);
|
||||||
Graphics()->SetWindowGrab(true);
|
Graphics()->SetWindowGrab(true);
|
||||||
|
// Clear pending relative mouse motion
|
||||||
|
SDL_GetRelativeMouseState(0x0, 0x0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CInput::MouseDoubleClick()
|
int CInput::MouseDoubleClick()
|
||||||
|
@ -334,8 +336,6 @@ int CInput::Update()
|
||||||
MouseModeRelative();
|
MouseModeRelative();
|
||||||
m_MouseFocus = true;
|
m_MouseFocus = true;
|
||||||
IgnoreKeys = true;
|
IgnoreKeys = true;
|
||||||
// We should do this call to reset relative mouse position after alt+tab
|
|
||||||
SDL_GetRelativeMouseState(0x0, 0x0);
|
|
||||||
break;
|
break;
|
||||||
case SDL_WINDOWEVENT_FOCUS_LOST:
|
case SDL_WINDOWEVENT_FOCUS_LOST:
|
||||||
m_MouseFocus = false;
|
m_MouseFocus = false;
|
||||||
|
|
Loading…
Reference in a new issue