Add: ability to let user use the text entry screen old-style.

This commit is contained in:
Charles Lohr
2005-03-31 22:47:21 +00:00
parent 7856c7c534
commit 3251fa2e28
+21
View File
@@ -23,6 +23,7 @@ static const char* g_szKeys[NUM_KEYBOARD_ROWS][KEYS_PER_ROW] =
{"","","Space","","","Backsp","","","Cancel","","","Done",""},
};
static Preference<bool> 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 );
}