diff --git a/stepmania/src/InputFilter.cpp b/stepmania/src/InputFilter.cpp index f043c43837..bc87fc91da 100644 --- a/stepmania/src/InputFilter.cpp +++ b/stepmania/src/InputFilter.cpp @@ -65,7 +65,7 @@ static Preference g_fInputDebounceTime( "InputDebounceTime", 0 ); InputFilter* INPUTFILTER = NULL; // global and accessable from anywhere in our program -static const float TIME_BEFORE_SLOW_REPEATS = 0.375f; +static const float TIME_BEFORE_REPEATS = 0.375f; static const float REPEATS_PER_SEC = 8; @@ -100,7 +100,7 @@ void InputFilter::SetRepeatRate( float fDelay, float fFastDelay, float fRepeatRa void InputFilter::ResetRepeatRate() { - SetRepeatRate( TIME_BEFORE_SLOW_REPEATS, 0, REPEATS_PER_SEC ); + SetRepeatRate( TIME_BEFORE_REPEATS, 0, REPEATS_PER_SEC ); } ButtonState::ButtonState(): @@ -235,7 +235,7 @@ void InputFilter::Update( float fDeltaTime ) /* Generate IET_FIRST_PRESS and IET_RELEASE events that were delayed. */ CheckButtonChange( bs, di, now ); - /* Generate IET_SLOW_REPEAT events. */ + /* Generate IET_REPEAT events. */ if( !bs.m_bLastReportedHeld ) { // If the key isn't pressed, and hasn't been pressed for a while (so debouncing @@ -252,7 +252,7 @@ void InputFilter::Update( float fDeltaTime ) InputEventType iet; if( fNewHoldTime > g_fTimeBeforeRepeats ) { - iet = IET_SLOW_REPEAT; + iet = IET_REPEAT; float fRepeatTime; if( fOldHoldTime < g_fTimeBeforeRepeats ) diff --git a/stepmania/src/InputFilter.h b/stepmania/src/InputFilter.h index ab7575752e..d5d9f29714 100644 --- a/stepmania/src/InputFilter.h +++ b/stepmania/src/InputFilter.h @@ -12,12 +12,13 @@ enum InputEventType /* The device is auto-repeating. This event is guaranteed to be sent only between * IET_FIRST_PRESS and IET_RELEASE pairs. */ - IET_SLOW_REPEAT, + IET_REPEAT, /* The device is no longer pressed. Exactly one IET_RELEASE event will be sent * for each IET_FIRST_PRESS. */ IET_RELEASE, }; +#define IET_SLOW_REPEAT IET_REPEAT struct InputEvent { diff --git a/stepmania/src/Screen.cpp b/stepmania/src/Screen.cpp index a9c97c8617..c9ccf0a989 100644 --- a/stepmania/src/Screen.cpp +++ b/stepmania/src/Screen.cpp @@ -162,7 +162,7 @@ void Screen::MenuSelect( const InputEventPlus &input ) { if(input.type==IET_FIRS void Screen::MenuBack( const InputEventPlus &input ) { - if(!PREFSMAN->m_bDelayedBack || input.type==IET_SLOW_REPEAT ) + if(!PREFSMAN->m_bDelayedBack || input.type==IET_REPEAT ) MenuBack( input.MenuI.player) ; } @@ -183,7 +183,7 @@ void Screen::Input( const InputEventPlus &input ) switch( input.type ) { case IET_FIRST_PRESS: - case IET_SLOW_REPEAT: + case IET_REPEAT: break; /* OK */ default: return; // don't care diff --git a/stepmania/src/ScreenBookkeeping.cpp b/stepmania/src/ScreenBookkeeping.cpp index 59d587d998..ffe4c47736 100644 --- a/stepmania/src/ScreenBookkeeping.cpp +++ b/stepmania/src/ScreenBookkeeping.cpp @@ -55,7 +55,7 @@ void ScreenBookkeeping::Update( float fDelta ) void ScreenBookkeeping::Input( const InputEventPlus &input ) { - if( input.type != IET_FIRST_PRESS && input.type != IET_SLOW_REPEAT ) + if( input.type != IET_FIRST_PRESS && input.type != IET_REPEAT ) return; // ignore Screen::Input( input ); // default handler diff --git a/stepmania/src/ScreenCenterImage.cpp b/stepmania/src/ScreenCenterImage.cpp index 789b882532..2556515587 100644 --- a/stepmania/src/ScreenCenterImage.cpp +++ b/stepmania/src/ScreenCenterImage.cpp @@ -131,7 +131,7 @@ void ScreenCenterImage::Input( const InputEventPlus &input ) if( input.DeviceI.level < 0 ) { - if( input.type == IET_SLOW_REPEAT ) + if( input.type == IET_REPEAT ) { if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) fScale *= 10; diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index d33d0b3674..5d1e73e93a 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -1474,7 +1474,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) { fDelta /= 20; // .001 bpm } - else if( input.type == IET_SLOW_REPEAT ) + else if( input.type == IET_REPEAT ) { if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) fDelta *= 10; @@ -1501,7 +1501,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) { fDelta /= 20; /* 1ms */ } - else if( input.type == IET_SLOW_REPEAT ) + else if( input.type == IET_REPEAT ) { if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) fDelta *= 10; @@ -1545,7 +1545,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) { fDelta /= 20; /* 1ms */ } - else if( input.type == IET_SLOW_REPEAT ) + else if( input.type == IET_REPEAT ) { if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) fDelta *= 10; @@ -1571,7 +1571,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) case EDIT_BUTTON_SAMPLE_LENGTH_UP: fDelta = +0.02f; break; } - if( input.type == IET_SLOW_REPEAT ) + if( input.type == IET_REPEAT ) { if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) fDelta *= 10; @@ -1963,7 +1963,7 @@ void ScreenEdit::InputRecord( const InputEventPlus &input, EditButton EditB ) m_NoteFieldRecord.Step( iCol, TNS_W1 ); } break; - case IET_SLOW_REPEAT: + case IET_REPEAT: case IET_RELEASE: // don't add or extend holds here; we do it in Update() break; @@ -2059,7 +2059,7 @@ void ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB ) { fOffsetDelta /= 20; /* 1ms */ } - else if( input.type == IET_SLOW_REPEAT ) + else if( input.type == IET_REPEAT ) { if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) fOffsetDelta *= 10; diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 77ea0801a6..a7c2479812 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -2118,7 +2118,7 @@ void ScreenGameplay::Input( const InputEventPlus &input ) if( input.MenuI.button == MENU_BUTTON_BACK && !BACK_GIVES_UP ) { if( ((!PREFSMAN->m_bDelayedBack && input.type==IET_FIRST_PRESS) || - (input.DeviceI.device==DEVICE_KEYBOARD && input.type==IET_SLOW_REPEAT) || + (input.DeviceI.device==DEVICE_KEYBOARD && input.type==IET_REPEAT) || (input.DeviceI.device!=DEVICE_KEYBOARD && INPUTFILTER->GetSecsHeld(input.DeviceI) >= 1.0f)) ) { LOG->Trace("Player %i went back", input.MenuI.player+1); diff --git a/stepmania/src/ScreenMapControllers.cpp b/stepmania/src/ScreenMapControllers.cpp index e7902418ad..b27af1122a 100644 --- a/stepmania/src/ScreenMapControllers.cpp +++ b/stepmania/src/ScreenMapControllers.cpp @@ -234,7 +234,7 @@ static bool IsAxis( const DeviceInput& DeviceI ) void ScreenMapControllers::Input( const InputEventPlus &input ) { - if( input.type != IET_FIRST_PRESS && input.type != IET_SLOW_REPEAT ) + if( input.type != IET_FIRST_PRESS && input.type != IET_REPEAT ) return; // ignore if( IsTransitioning() ) return; // ignore diff --git a/stepmania/src/ScreenNetSelectBase.cpp b/stepmania/src/ScreenNetSelectBase.cpp index cec4500af9..90fb7d76e0 100644 --- a/stepmania/src/ScreenNetSelectBase.cpp +++ b/stepmania/src/ScreenNetSelectBase.cpp @@ -92,7 +92,7 @@ void ScreenNetSelectBase::Input( const InputEventPlus &input ) if( m_In.IsTransitioning() || m_Out.IsTransitioning() ) return; - if( input.type != IET_FIRST_PRESS && input.type != IET_SLOW_REPEAT ) + if( input.type != IET_FIRST_PRESS && input.type != IET_REPEAT ) return; bool bHoldingCtrl = diff --git a/stepmania/src/ScreenNetSelectMusic.cpp b/stepmania/src/ScreenNetSelectMusic.cpp index 69333334da..3dd4f6073d 100644 --- a/stepmania/src/ScreenNetSelectMusic.cpp +++ b/stepmania/src/ScreenNetSelectMusic.cpp @@ -123,7 +123,7 @@ void ScreenNetSelectMusic::Input( const InputEventPlus &input ) return; } - if( input.type != IET_FIRST_PRESS && input.type != IET_SLOW_REPEAT ) + if( input.type != IET_FIRST_PRESS && input.type != IET_REPEAT ) return; bool bHoldingCtrl = diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index 3e54de6f4a..e3b7d6e005 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -1217,7 +1217,7 @@ void ScreenOptions::MenuUpDown( const InputEventPlus &input, int iDir ) ASSERT( iDir == -1 || iDir == +1 ); PlayerNumber pn = input.MenuI.player; - if( input.type == IET_SLOW_REPEAT ) + if( input.type == IET_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. */ diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 8a0c2b01a6..ed72d92fa4 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -301,7 +301,7 @@ void ScreenSelectMusic::Input( const InputEventPlus &input ) if( !m_bAllowOptionsMenu ) return; /* not allowed */ - if( !m_bAllowOptionsMenuRepeat && input.type == IET_SLOW_REPEAT ) + if( !m_bAllowOptionsMenuRepeat && input.type == IET_REPEAT ) { return; /* not allowed yet */ } diff --git a/stepmania/src/ScreenSetTime.cpp b/stepmania/src/ScreenSetTime.cpp index f286c02bb8..883a4aa340 100644 --- a/stepmania/src/ScreenSetTime.cpp +++ b/stepmania/src/ScreenSetTime.cpp @@ -105,7 +105,7 @@ void ScreenSetTime::Update( float fDelta ) void ScreenSetTime::Input( const InputEventPlus &input ) { - if( input.type != IET_FIRST_PRESS && input.type != IET_SLOW_REPEAT ) + if( input.type != IET_FIRST_PRESS && input.type != IET_REPEAT ) return; // ignore if( IsTransitioning() ) diff --git a/stepmania/src/ScreenSyncOverlay.cpp b/stepmania/src/ScreenSyncOverlay.cpp index f54e41ba20..8b21aff5aa 100644 --- a/stepmania/src/ScreenSyncOverlay.cpp +++ b/stepmania/src/ScreenSyncOverlay.cpp @@ -182,7 +182,7 @@ bool ScreenSyncOverlay::OverlayInput( const InputEventPlus &input ) switch( input.type ) { case IET_RELEASE: fDelta *= 0; break; - case IET_SLOW_REPEAT: + case IET_REPEAT: if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) fDelta *= 0; else @@ -207,7 +207,7 @@ bool ScreenSyncOverlay::OverlayInput( const InputEventPlus &input ) switch( input.type ) { case IET_RELEASE: fDelta *= 0; break; - case IET_SLOW_REPEAT: + case IET_REPEAT: if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) fDelta *= 0; else diff --git a/stepmania/src/ScreenTestInput.cpp b/stepmania/src/ScreenTestInput.cpp index 3c93041ded..90715a72b0 100644 --- a/stepmania/src/ScreenTestInput.cpp +++ b/stepmania/src/ScreenTestInput.cpp @@ -104,7 +104,7 @@ void ScreenTestInput::Input( const InputEventPlus &input ) MESSAGEMAN->Broadcast( sMessage ); } - if( input.type != IET_FIRST_PRESS && input.type != IET_SLOW_REPEAT ) + if( input.type != IET_FIRST_PRESS && input.type != IET_REPEAT ) return; // ignore Screen::Input( input ); // default handler diff --git a/stepmania/src/ScreenTestLights.cpp b/stepmania/src/ScreenTestLights.cpp index 6cf6762327..2c717d1e63 100644 --- a/stepmania/src/ScreenTestLights.cpp +++ b/stepmania/src/ScreenTestLights.cpp @@ -90,7 +90,7 @@ void ScreenTestLights::Update( float fDeltaTime ) void ScreenTestLights::Input( const InputEventPlus &input ) { - if( input.type != IET_FIRST_PRESS && input.type != IET_SLOW_REPEAT ) + if( input.type != IET_FIRST_PRESS && input.type != IET_REPEAT ) return; // ignore Screen::Input( input ); // default handler diff --git a/stepmania/src/ScreenTextEntry.cpp b/stepmania/src/ScreenTextEntry.cpp index 2467a9da96..866c91df2f 100644 --- a/stepmania/src/ScreenTextEntry.cpp +++ b/stepmania/src/ScreenTextEntry.cpp @@ -186,7 +186,7 @@ void ScreenTextEntry::Input( const InputEventPlus &input ) switch( input.type ) { case IET_FIRST_PRESS: - case IET_SLOW_REPEAT: + case IET_REPEAT: BackspaceInAnswer(); break; }