From c628676660325064f5307e081c6d4238afbe646f Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 8 Sep 2006 19:02:11 +0000 Subject: [PATCH] use g_ButtonStates instead of GetPressedButtons; GetPressedButtons returns the last reported input, not the immediate state --- stepmania/src/InputFilter.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/stepmania/src/InputFilter.cpp b/stepmania/src/InputFilter.cpp index 2f113bd2f2..d6a3aa8a09 100644 --- a/stepmania/src/InputFilter.cpp +++ b/stepmania/src/InputFilter.cpp @@ -153,13 +153,12 @@ void InputFilter::ResetDevice( InputDevice device ) LockMut(*queuemutex); RageTimer now; - vector DeviceInputs; - GetPressedButtons( DeviceInputs ); - - FOREACH( DeviceInput, DeviceInputs, di ) + const ButtonStateMap g_ButtonStates( g_ButtonStates ); + FOREACHM_CONST( DeviceInput, ButtonState, g_ButtonStates, b ) { - if( di->device == device ) - ButtonPressed( DeviceInput(device, di->button, -1, now), false ); + const DeviceInput &di = b->first; + if( di.device == device ) + ButtonPressed( DeviceInput(device, di.button, -1, now), false ); } }