From 0adaf8a75206bcc3cdba5c4eadd5014a3d696aff Mon Sep 17 00:00:00 2001 From: BeaR Date: Wed, 2 May 2012 13:53:28 +0200 Subject: #913 Fix Input Handling --- src/engine/client/input.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/engine/client/input.cpp') diff --git a/src/engine/client/input.cpp b/src/engine/client/input.cpp index 0b4a44a4..7ff8d6fe 100644 --- a/src/engine/client/input.cpp +++ b/src/engine/client/input.cpp @@ -35,6 +35,7 @@ CInput::CInput() m_InputCurrent = 0; m_InputGrabbed = 0; + m_InputDispatched = false; m_LastRelease = 0; m_ReleaseDelta = -1; @@ -116,10 +117,14 @@ int CInput::Update() /*if(!input_grabbed && Graphics()->WindowActive()) Input()->MouseModeRelative();*/ - // clear and begin count on the other one - m_InputCurrent^=1; - mem_zero(&m_aInputCount[m_InputCurrent], sizeof(m_aInputCount[m_InputCurrent])); - mem_zero(&m_aInputState[m_InputCurrent], sizeof(m_aInputState[m_InputCurrent])); + if(m_InputDispatched) + { + // clear and begin count on the other one + m_InputCurrent^=1; + mem_zero(&m_aInputCount[m_InputCurrent], sizeof(m_aInputCount[m_InputCurrent])); + mem_zero(&m_aInputState[m_InputCurrent], sizeof(m_aInputState[m_InputCurrent])); + m_InputDispatched = false; + } { int i; -- cgit 1.4.1