This commit is contained in:
Glenn Maynard
2005-10-13 02:26:17 +00:00
parent f83eb0a2ca
commit 491e97d0ac
@@ -4,8 +4,7 @@
#include "PrefsManager.h" #include "PrefsManager.h"
InputHandler_MonkeyKeyboard::InputHandler_MonkeyKeyboard() : InputHandler_MonkeyKeyboard::InputHandler_MonkeyKeyboard()
m_diLast(DEVICE_KEYBOARD,KEY_SPACE)
{ {
} }
@@ -59,21 +58,18 @@ int GetRandomKeyboadKey()
void InputHandler_MonkeyKeyboard::Update(float fDeltaTime) void InputHandler_MonkeyKeyboard::Update(float fDeltaTime)
{ {
static bool wasRunning = false;
if( !PREFSMAN->m_bMonkeyInput ) if( !PREFSMAN->m_bMonkeyInput )
{ {
if( wasRunning ) if( m_diLast.IsValid() )
{ {
// End the previous key // End the previous key
ButtonPressed(m_diLast, false); ButtonPressed(m_diLast, false);
wasRunning = false; m_diLast.MakeInvalid();
} }
InputHandler::UpdateTimer(); InputHandler::UpdateTimer();
return; return;
} }
wasRunning = true;
float fSecsAgo = m_timerPressButton.Ago(); float fSecsAgo = m_timerPressButton.Ago();
if( fSecsAgo > 0.5 ) if( fSecsAgo > 0.5 )