Skip to content

Commit

Permalink
monkey input more like monkey developers
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Apr 30, 2017
1 parent 176b6f7 commit fe50843
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions src/arch/InputHandler/InputHandler_MonkeyKeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,38 +58,7 @@ static DeviceButton GetRandomKeyboardKey()

void InputHandler_MonkeyKeyboard::Update()
{
if( !PREFSMAN->m_bMonkeyInput )
{
if( m_dbLast != DeviceButton_Invalid )
{
// End the previous key
DeviceInput di = DeviceInput( DEVICE_KEYBOARD, m_dbLast, 0 );
ButtonPressed( di );
m_dbLast = DeviceButton_Invalid;
}
InputHandler::UpdateTimer();
return;
}

float fSecsAgo = m_timerPressButton.Ago();

if( fSecsAgo > 0.5 )
{
if( m_dbLast != DeviceButton_Invalid )
{
// End the previous key
DeviceInput di = DeviceInput( DEVICE_KEYBOARD, m_dbLast, 0 );
ButtonPressed( di );
}

// Choose a new key and send it.
m_dbLast = GetRandomKeyboardKey();
DeviceInput di = DeviceInput( DEVICE_KEYBOARD, m_dbLast, 1 );
ButtonPressed( di );
m_timerPressButton.Touch();
}

InputHandler::UpdateTimer();
static const bool amImoreUsefulNowThatIdoNOTHING = true;
}

/*
Expand Down

0 comments on commit fe50843

Please sign in to comment.