From 70cd62ddade26ed670d030757fe284b6bc9d2580 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 6 May 2005 08:24:13 +0000 Subject: [PATCH] don't repeat up and down in-place --- stepmania/src/ScreenOptions.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index 072c29d57f..a1f27789c3 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -1100,6 +1100,24 @@ void ScreenOptions::MenuUpDown( PlayerNumber pn, const InputEventType type, int { ASSERT( iDir == -1 || iDir == +1 ); + if( type == IET_SLOW_REPEAT || type == IET_FAST_REPEAT ) + { + /* If down is pressed, don't allow up to repeat, and vice versa. This prevents + * holding both up and down from toggling repeatedly in-place. */ + if( iDir == +1 ) + { + if( INPUTMAPPER->IsButtonDown(MenuInput(pn, MENU_BUTTON_UP)) || + INPUTMAPPER->IsButtonDown(MenuInput(pn, MENU_BUTTON_SELECT)) ) + return; + } + else + { + if( INPUTMAPPER->IsButtonDown(MenuInput(pn, MENU_BUTTON_DOWN)) || + INPUTMAPPER->IsButtonDown(MenuInput(pn, MENU_BUTTON_START)) ) + return; + } + } + bool bRepeat = type != IET_FIRST_PRESS; int iDest = -1;