IET_SLOW_REPEAT -> IET_REPEAT

This commit is contained in:
Glenn Maynard
2006-09-13 02:59:05 +00:00
parent d03db0c4f9
commit c71d8f7425
17 changed files with 28 additions and 27 deletions
+4 -4
View File
@@ -65,7 +65,7 @@ static Preference<float> 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 )
+2 -1
View File
@@ -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
{
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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;
+6 -6
View File
@@ -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;
+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( ((!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);
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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 =
+1 -1
View File
@@ -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 =
+1 -1
View File
@@ -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. */
+1 -1
View File
@@ -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 */
}
+1 -1
View File
@@ -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() )
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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;
}