remove IET_FAST_REPEAT

This commit is contained in:
Glenn Maynard
2006-09-13 02:55:19 +00:00
parent 73dec47116
commit d03db0c4f9
13 changed files with 20 additions and 24 deletions
+1 -1
View File
@@ -235,7 +235,7 @@ void InputFilter::Update( float fDeltaTime )
/* Generate IET_FIRST_PRESS and IET_RELEASE events that were delayed. */ /* Generate IET_FIRST_PRESS and IET_RELEASE events that were delayed. */
CheckButtonChange( bs, di, now ); CheckButtonChange( bs, di, now );
/* Generate IET_FAST_REPEAT and IET_SLOW_REPEAT events. */ /* Generate IET_SLOW_REPEAT events. */
if( !bs.m_bLastReportedHeld ) if( !bs.m_bLastReportedHeld )
{ {
// If the key isn't pressed, and hasn't been pressed for a while (so debouncing // If the key isn't pressed, and hasn't been pressed for a while (so debouncing
+1 -2
View File
@@ -10,10 +10,9 @@ enum InputEventType
/* The device was just pressed. */ /* The device was just pressed. */
IET_FIRST_PRESS, IET_FIRST_PRESS,
/* The device is auto-repeating. These events are guaranteed to be sent only between /* The device is auto-repeating. This event is guaranteed to be sent only between
* IET_FIRST_PRESS and IET_RELEASE pairs. */ * IET_FIRST_PRESS and IET_RELEASE pairs. */
IET_SLOW_REPEAT, IET_SLOW_REPEAT,
IET_FAST_REPEAT,
/* The device is no longer pressed. Exactly one IET_RELEASE event will be sent /* The device is no longer pressed. Exactly one IET_RELEASE event will be sent
* for each IET_FIRST_PRESS. */ * for each IET_FIRST_PRESS. */
+1 -2
View File
@@ -162,7 +162,7 @@ void Screen::MenuSelect( const InputEventPlus &input ) { if(input.type==IET_FIRS
void Screen::MenuBack( const InputEventPlus &input ) void Screen::MenuBack( const InputEventPlus &input )
{ {
if(!PREFSMAN->m_bDelayedBack || input.type==IET_SLOW_REPEAT || input.type==IET_FAST_REPEAT) if(!PREFSMAN->m_bDelayedBack || input.type==IET_SLOW_REPEAT )
MenuBack( input.MenuI.player) ; MenuBack( input.MenuI.player) ;
} }
@@ -184,7 +184,6 @@ void Screen::Input( const InputEventPlus &input )
{ {
case IET_FIRST_PRESS: case IET_FIRST_PRESS:
case IET_SLOW_REPEAT: case IET_SLOW_REPEAT:
case IET_FAST_REPEAT:
break; /* OK */ break; /* OK */
default: default:
return; // don't care return; // don't care
+1 -1
View File
@@ -131,7 +131,7 @@ void ScreenCenterImage::Input( const InputEventPlus &input )
if( input.DeviceI.level < 0 ) if( input.DeviceI.level < 0 )
{ {
if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) if( input.type == IET_SLOW_REPEAT )
{ {
if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f )
fScale *= 10; fScale *= 10;
+5 -6
View File
@@ -1474,7 +1474,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
{ {
fDelta /= 20; // .001 bpm fDelta /= 20; // .001 bpm
} }
else if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) else if( input.type == IET_SLOW_REPEAT )
{ {
if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f )
fDelta *= 10; fDelta *= 10;
@@ -1501,7 +1501,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
{ {
fDelta /= 20; /* 1ms */ fDelta /= 20; /* 1ms */
} }
else if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) else if( input.type == IET_SLOW_REPEAT )
{ {
if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f )
fDelta *= 10; fDelta *= 10;
@@ -1545,7 +1545,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
{ {
fDelta /= 20; /* 1ms */ fDelta /= 20; /* 1ms */
} }
else if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) else if( input.type == IET_SLOW_REPEAT )
{ {
if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f )
fDelta *= 10; fDelta *= 10;
@@ -1571,7 +1571,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
case EDIT_BUTTON_SAMPLE_LENGTH_UP: fDelta = +0.02f; break; case EDIT_BUTTON_SAMPLE_LENGTH_UP: fDelta = +0.02f; break;
} }
if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) if( input.type == IET_SLOW_REPEAT )
{ {
if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f )
fDelta *= 10; fDelta *= 10;
@@ -1964,7 +1964,6 @@ void ScreenEdit::InputRecord( const InputEventPlus &input, EditButton EditB )
} }
break; break;
case IET_SLOW_REPEAT: case IET_SLOW_REPEAT:
case IET_FAST_REPEAT:
case IET_RELEASE: case IET_RELEASE:
// don't add or extend holds here; we do it in Update() // don't add or extend holds here; we do it in Update()
break; break;
@@ -2060,7 +2059,7 @@ void ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB )
{ {
fOffsetDelta /= 20; /* 1ms */ fOffsetDelta /= 20; /* 1ms */
} }
else if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) else if( input.type == IET_SLOW_REPEAT )
{ {
if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f )
fOffsetDelta *= 10; fOffsetDelta *= 10;
+1 -1
View File
@@ -2118,7 +2118,7 @@ void ScreenGameplay::Input( const InputEventPlus &input )
if( input.MenuI.button == MENU_BUTTON_BACK && !BACK_GIVES_UP ) if( input.MenuI.button == MENU_BUTTON_BACK && !BACK_GIVES_UP )
{ {
if( ((!PREFSMAN->m_bDelayedBack && input.type==IET_FIRST_PRESS) || if( ((!PREFSMAN->m_bDelayedBack && input.type==IET_FIRST_PRESS) ||
(input.DeviceI.device==DEVICE_KEYBOARD && (input.type==IET_SLOW_REPEAT||input.type==IET_FAST_REPEAT)) || (input.DeviceI.device==DEVICE_KEYBOARD && input.type==IET_SLOW_REPEAT) ||
(input.DeviceI.device!=DEVICE_KEYBOARD && INPUTFILTER->GetSecsHeld(input.DeviceI) >= 1.0f)) ) (input.DeviceI.device!=DEVICE_KEYBOARD && INPUTFILTER->GetSecsHeld(input.DeviceI) >= 1.0f)) )
{ {
LOG->Trace("Player %i went back", input.MenuI.player+1); LOG->Trace("Player %i went back", input.MenuI.player+1);
+1 -1
View File
@@ -234,7 +234,7 @@ static bool IsAxis( const DeviceInput& DeviceI )
void ScreenMapControllers::Input( const InputEventPlus &input ) void ScreenMapControllers::Input( const InputEventPlus &input )
{ {
if( input.type != IET_FIRST_PRESS && input.type != IET_SLOW_REPEAT && input.type != IET_FAST_REPEAT ) if( input.type != IET_FIRST_PRESS && input.type != IET_SLOW_REPEAT )
return; // ignore return; // ignore
if( IsTransitioning() ) if( IsTransitioning() )
return; // ignore return; // ignore
+1 -1
View File
@@ -92,7 +92,7 @@ void ScreenNetSelectBase::Input( const InputEventPlus &input )
if( m_In.IsTransitioning() || m_Out.IsTransitioning() ) if( m_In.IsTransitioning() || m_Out.IsTransitioning() )
return; return;
if( (input.type != IET_FIRST_PRESS) && (input.type != IET_SLOW_REPEAT) && (input.type != IET_FAST_REPEAT ) ) if( input.type != IET_FIRST_PRESS && input.type != IET_SLOW_REPEAT )
return; return;
bool bHoldingCtrl = bool bHoldingCtrl =
+1 -1
View File
@@ -123,7 +123,7 @@ void ScreenNetSelectMusic::Input( const InputEventPlus &input )
return; return;
} }
if( (input.type != IET_FIRST_PRESS) && (input.type != IET_SLOW_REPEAT) && (input.type != IET_FAST_REPEAT ) ) if( input.type != IET_FIRST_PRESS && input.type != IET_SLOW_REPEAT )
return; return;
bool bHoldingCtrl = bool bHoldingCtrl =
+1 -1
View File
@@ -1217,7 +1217,7 @@ void ScreenOptions::MenuUpDown( const InputEventPlus &input, int iDir )
ASSERT( iDir == -1 || iDir == +1 ); ASSERT( iDir == -1 || iDir == +1 );
PlayerNumber pn = input.MenuI.player; PlayerNumber pn = input.MenuI.player;
if( input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ) if( input.type == IET_SLOW_REPEAT )
{ {
/* If down is pressed, don't allow up to repeat, and vice versa. This prevents /* 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. */ * holding both up and down from toggling repeatedly in-place. */
+1 -2
View File
@@ -301,8 +301,7 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
if( !m_bAllowOptionsMenu ) if( !m_bAllowOptionsMenu )
return; /* not allowed */ return; /* not allowed */
if( !m_bAllowOptionsMenuRepeat && if( !m_bAllowOptionsMenuRepeat && input.type == IET_SLOW_REPEAT )
(input.type == IET_SLOW_REPEAT || input.type == IET_FAST_REPEAT ))
{ {
return; /* not allowed yet */ return; /* not allowed yet */
} }
+5 -4
View File
@@ -183,12 +183,10 @@ bool ScreenSyncOverlay::OverlayInput( const InputEventPlus &input )
{ {
case IET_RELEASE: fDelta *= 0; break; case IET_RELEASE: fDelta *= 0; break;
case IET_SLOW_REPEAT: case IET_SLOW_REPEAT:
case IET_FAST_REPEAT:
if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f ) if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f )
fDelta *= 0; fDelta *= 0;
else else
fDelta *= 10; fDelta *= 10;
fDelta *= 10; break;
} }
if( GAMESTATE->m_pCurSong != NULL ) if( GAMESTATE->m_pCurSong != NULL )
{ {
@@ -209,8 +207,11 @@ bool ScreenSyncOverlay::OverlayInput( const InputEventPlus &input )
switch( input.type ) switch( input.type )
{ {
case IET_RELEASE: fDelta *= 0; break; case IET_RELEASE: fDelta *= 0; break;
case IET_SLOW_REPEAT: fDelta *= 0; break; case IET_SLOW_REPEAT:
case IET_FAST_REPEAT: fDelta *= 10; break; if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f )
fDelta *= 0;
else
fDelta *= 10;
} }
switch( a ) switch( a )
-1
View File
@@ -187,7 +187,6 @@ void ScreenTextEntry::Input( const InputEventPlus &input )
{ {
case IET_FIRST_PRESS: case IET_FIRST_PRESS:
case IET_SLOW_REPEAT: case IET_SLOW_REPEAT:
case IET_FAST_REPEAT:
BackspaceInAnswer(); BackspaceInAnswer();
break; break;
} }