diff --git a/stepmania/src/ScreenTextEntry.cpp b/stepmania/src/ScreenTextEntry.cpp index 866c91df2f..891d08cc5c 100644 --- a/stepmania/src/ScreenTextEntry.cpp +++ b/stepmania/src/ScreenTextEntry.cpp @@ -240,9 +240,10 @@ void ScreenTextEntry::BackspaceInAnswer() UpdateAnswerText(); } -void ScreenTextEntry::MenuStart( PlayerNumber pn ) +void ScreenTextEntry::MenuStart( const InputEventPlus &input ) { - End( false ); + if( input.type==IET_FIRST_PRESS ) + End( false ); } void ScreenTextEntry::TweenOffScreen() @@ -292,9 +293,10 @@ void ScreenTextEntry::End( bool bCancelled ) s_sLastAnswer = bCancelled ? RString("") : WStringToRString(m_sAnswer); } -void ScreenTextEntry::MenuBack( PlayerNumber pn ) +void ScreenTextEntry::MenuBack( const InputEventPlus &input ) { - End( true ); + if( input.type == IET_FIRST_PRESS ) + End( true ); } void ScreenTextEntryVisual::Init() @@ -430,8 +432,10 @@ void ScreenTextEntryVisual::MoveY( int iDir ) PositionCursor(); } -void ScreenTextEntryVisual::MenuStart( PlayerNumber pn ) +void ScreenTextEntryVisual::MenuStart( const InputEventPlus &input ) { + if( input.type != IET_FIRST_PRESS ) + return; if( m_iFocusY == KEYBOARD_ROW_SPECIAL ) { switch( m_iFocusX ) diff --git a/stepmania/src/ScreenTextEntry.h b/stepmania/src/ScreenTextEntry.h index 270b8d5b88..0af7e6e4d7 100644 --- a/stepmania/src/ScreenTextEntry.h +++ b/stepmania/src/ScreenTextEntry.h @@ -7,6 +7,7 @@ #include "BitmapText.h" #include "RageSound.h" #include "ThemeMetric.h" +#include "InputEventPlus.h" enum KeyboardRow { @@ -76,8 +77,8 @@ protected: virtual void End( bool bCancelled ); private: - virtual void MenuStart( PlayerNumber pn ); - virtual void MenuBack( PlayerNumber pn ); + virtual void MenuStart( const InputEventPlus &input ); + virtual void MenuBack( const InputEventPlus &input ); void UpdateAnswerText(); @@ -108,12 +109,12 @@ protected: virtual void TextEnteredDirectly(); - virtual void MenuLeft( PlayerNumber pn ) { MoveX(-1); } - virtual void MenuRight( PlayerNumber pn ) { MoveX(+1); } - virtual void MenuUp( PlayerNumber pn ) { MoveY(-1); } - virtual void MenuDown( PlayerNumber pn ) { MoveY(+1); } + virtual void MenuLeft( const InputEventPlus &input ) { if(input.type==IET_FIRST_PRESS) MoveX(-1); } + virtual void MenuRight( const InputEventPlus &input ) { if(input.type==IET_FIRST_PRESS) MoveX(+1); } + virtual void MenuUp( const InputEventPlus &input ) { if(input.type==IET_FIRST_PRESS) MoveY(-1); } + virtual void MenuDown( const InputEventPlus &input ) { if(input.type==IET_FIRST_PRESS) MoveY(+1); } - virtual void MenuStart( PlayerNumber pn ); + virtual void MenuStart( const InputEventPlus &input ); int m_iFocusX; KeyboardRow m_iFocusY;