IET_SLOW_REPEAT -> IET_REPEAT
This commit is contained in:
@@ -65,7 +65,7 @@ static Preference<float> g_fInputDebounceTime( "InputDebounceTime", 0 );
|
|||||||
|
|
||||||
InputFilter* INPUTFILTER = NULL; // global and accessable from anywhere in our program
|
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;
|
static const float REPEATS_PER_SEC = 8;
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ void InputFilter::SetRepeatRate( float fDelay, float fFastDelay, float fRepeatRa
|
|||||||
|
|
||||||
void InputFilter::ResetRepeatRate()
|
void InputFilter::ResetRepeatRate()
|
||||||
{
|
{
|
||||||
SetRepeatRate( TIME_BEFORE_SLOW_REPEATS, 0, REPEATS_PER_SEC );
|
SetRepeatRate( TIME_BEFORE_REPEATS, 0, REPEATS_PER_SEC );
|
||||||
}
|
}
|
||||||
|
|
||||||
ButtonState::ButtonState():
|
ButtonState::ButtonState():
|
||||||
@@ -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_SLOW_REPEAT events. */
|
/* Generate IET_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
|
||||||
@@ -252,7 +252,7 @@ void InputFilter::Update( float fDeltaTime )
|
|||||||
InputEventType iet;
|
InputEventType iet;
|
||||||
if( fNewHoldTime > g_fTimeBeforeRepeats )
|
if( fNewHoldTime > g_fTimeBeforeRepeats )
|
||||||
{
|
{
|
||||||
iet = IET_SLOW_REPEAT;
|
iet = IET_REPEAT;
|
||||||
|
|
||||||
float fRepeatTime;
|
float fRepeatTime;
|
||||||
if( fOldHoldTime < g_fTimeBeforeRepeats )
|
if( fOldHoldTime < g_fTimeBeforeRepeats )
|
||||||
|
|||||||
@@ -12,12 +12,13 @@ enum InputEventType
|
|||||||
|
|
||||||
/* The device is auto-repeating. This event is 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_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. */
|
||||||
IET_RELEASE,
|
IET_RELEASE,
|
||||||
};
|
};
|
||||||
|
#define IET_SLOW_REPEAT IET_REPEAT
|
||||||
|
|
||||||
struct InputEvent
|
struct InputEvent
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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 )
|
if(!PREFSMAN->m_bDelayedBack || input.type==IET_REPEAT )
|
||||||
MenuBack( input.MenuI.player) ;
|
MenuBack( input.MenuI.player) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,7 +183,7 @@ void Screen::Input( const InputEventPlus &input )
|
|||||||
switch( input.type )
|
switch( input.type )
|
||||||
{
|
{
|
||||||
case IET_FIRST_PRESS:
|
case IET_FIRST_PRESS:
|
||||||
case IET_SLOW_REPEAT:
|
case IET_REPEAT:
|
||||||
break; /* OK */
|
break; /* OK */
|
||||||
default:
|
default:
|
||||||
return; // don't care
|
return; // don't care
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ void ScreenBookkeeping::Update( float fDelta )
|
|||||||
|
|
||||||
void ScreenBookkeeping::Input( const InputEventPlus &input )
|
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
|
return; // ignore
|
||||||
|
|
||||||
Screen::Input( input ); // default handler
|
Screen::Input( input ); // default handler
|
||||||
|
|||||||
@@ -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 )
|
if( input.type == IET_REPEAT )
|
||||||
{
|
{
|
||||||
if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f )
|
if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f )
|
||||||
fScale *= 10;
|
fScale *= 10;
|
||||||
|
|||||||
@@ -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 )
|
else if( input.type == IET_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 )
|
else if( input.type == IET_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 )
|
else if( input.type == IET_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 )
|
if( input.type == IET_REPEAT )
|
||||||
{
|
{
|
||||||
if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f )
|
if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f )
|
||||||
fDelta *= 10;
|
fDelta *= 10;
|
||||||
@@ -1963,7 +1963,7 @@ void ScreenEdit::InputRecord( const InputEventPlus &input, EditButton EditB )
|
|||||||
m_NoteFieldRecord.Step( iCol, TNS_W1 );
|
m_NoteFieldRecord.Step( iCol, TNS_W1 );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IET_SLOW_REPEAT:
|
case IET_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;
|
||||||
@@ -2059,7 +2059,7 @@ void ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB )
|
|||||||
{
|
{
|
||||||
fOffsetDelta /= 20; /* 1ms */
|
fOffsetDelta /= 20; /* 1ms */
|
||||||
}
|
}
|
||||||
else if( input.type == IET_SLOW_REPEAT )
|
else if( input.type == IET_REPEAT )
|
||||||
{
|
{
|
||||||
if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f )
|
if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f )
|
||||||
fOffsetDelta *= 10;
|
fOffsetDelta *= 10;
|
||||||
|
|||||||
@@ -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.DeviceI.device==DEVICE_KEYBOARD && input.type==IET_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);
|
||||||
|
|||||||
@@ -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 )
|
if( input.type != IET_FIRST_PRESS && input.type != IET_REPEAT )
|
||||||
return; // ignore
|
return; // ignore
|
||||||
if( IsTransitioning() )
|
if( IsTransitioning() )
|
||||||
return; // ignore
|
return; // ignore
|
||||||
|
|||||||
@@ -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 )
|
if( input.type != IET_FIRST_PRESS && input.type != IET_REPEAT )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool bHoldingCtrl =
|
bool bHoldingCtrl =
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ void ScreenNetSelectMusic::Input( const InputEventPlus &input )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( input.type != IET_FIRST_PRESS && input.type != IET_SLOW_REPEAT )
|
if( input.type != IET_FIRST_PRESS && input.type != IET_REPEAT )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool bHoldingCtrl =
|
bool bHoldingCtrl =
|
||||||
|
|||||||
@@ -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 )
|
if( input.type == IET_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. */
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
|
|||||||
if( !m_bAllowOptionsMenu )
|
if( !m_bAllowOptionsMenu )
|
||||||
return; /* not allowed */
|
return; /* not allowed */
|
||||||
|
|
||||||
if( !m_bAllowOptionsMenuRepeat && input.type == IET_SLOW_REPEAT )
|
if( !m_bAllowOptionsMenuRepeat && input.type == IET_REPEAT )
|
||||||
{
|
{
|
||||||
return; /* not allowed yet */
|
return; /* not allowed yet */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ void ScreenSetTime::Update( float fDelta )
|
|||||||
|
|
||||||
void ScreenSetTime::Input( const InputEventPlus &input )
|
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
|
return; // ignore
|
||||||
|
|
||||||
if( IsTransitioning() )
|
if( IsTransitioning() )
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ 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:
|
case IET_REPEAT:
|
||||||
if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f )
|
if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f )
|
||||||
fDelta *= 0;
|
fDelta *= 0;
|
||||||
else
|
else
|
||||||
@@ -207,7 +207,7 @@ 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:
|
case IET_REPEAT:
|
||||||
if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f )
|
if( INPUTFILTER->GetSecsHeld(input.DeviceI) < 1.0f )
|
||||||
fDelta *= 0;
|
fDelta *= 0;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ void ScreenTestInput::Input( const InputEventPlus &input )
|
|||||||
MESSAGEMAN->Broadcast( sMessage );
|
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
|
return; // ignore
|
||||||
|
|
||||||
Screen::Input( input ); // default handler
|
Screen::Input( input ); // default handler
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ void ScreenTestLights::Update( float fDeltaTime )
|
|||||||
|
|
||||||
void ScreenTestLights::Input( const InputEventPlus &input )
|
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
|
return; // ignore
|
||||||
|
|
||||||
Screen::Input( input ); // default handler
|
Screen::Input( input ); // default handler
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ void ScreenTextEntry::Input( const InputEventPlus &input )
|
|||||||
switch( input.type )
|
switch( input.type )
|
||||||
{
|
{
|
||||||
case IET_FIRST_PRESS:
|
case IET_FIRST_PRESS:
|
||||||
case IET_SLOW_REPEAT:
|
case IET_REPEAT:
|
||||||
BackspaceInAnswer();
|
BackspaceInAnswer();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user