From 3251fa2e28bd70b6e42db4ed3d7ece2b868f5be8 Mon Sep 17 00:00:00 2001 From: Charles Lohr Date: Thu, 31 Mar 2005 22:47:21 +0000 Subject: [PATCH] Add: ability to let user use the text entry screen old-style. --- stepmania/src/ScreenTextEntry.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/stepmania/src/ScreenTextEntry.cpp b/stepmania/src/ScreenTextEntry.cpp index 64b2eef77e..c3b1fc33dc 100644 --- a/stepmania/src/ScreenTextEntry.cpp +++ b/stepmania/src/ScreenTextEntry.cpp @@ -23,6 +23,7 @@ static const char* g_szKeys[NUM_KEYBOARD_ROWS][KEYS_PER_ROW] = {"","","Space","","","Backsp","","","Cancel","","","Done",""}, }; +static Preference g_bAllowOldKeyboardInput( Options, "AllowOldKeyboardInput", true ); float GetButtonX( int x ) { @@ -188,6 +189,26 @@ void ScreenTextEntry::Input( const DeviceInput& DeviceI, const InputEventType ty if( m_In.IsTransitioning() || m_Out.IsTransitioning() || m_Cancel.IsTransitioning() ) return; + //The user wants to input text traditionally + if ( g_bAllowOldKeyboardInput.Value() && ( type == IET_FIRST_PRESS ) ) + { + if ( DeviceI.button == KEY_BACK ) + { + BackspaceInAnswer(); + } + else if ( DeviceI.ToChar() >= ' ' ) + { + AppendToAnswer( ssprintf( "%c", DeviceI.ToChar() ) ); + + //If the user wishes to select text in traditional way, start should finish text entry + m_iFocusY = KEYBOARD_ROW_SPECIAL; + m_iFocusX = DONE; + + UpdateKeyboardText(); + PositionCursor(); + } + } + Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); }