From afd53cfc5eab47fce1ca099a34546fb314fc325a Mon Sep 17 00:00:00 2001 From: Charles Lohr Date: Sun, 3 Apr 2005 01:52:53 +0000 Subject: [PATCH] Add: Support for shifting non-standard letters. Maybe we should have a function for this since it's in two places. --- stepmania/src/ScreenTextEntry.cpp | 32 ++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/stepmania/src/ScreenTextEntry.cpp b/stepmania/src/ScreenTextEntry.cpp index 52f81cc54e..de61c92ce3 100644 --- a/stepmania/src/ScreenTextEntry.cpp +++ b/stepmania/src/ScreenTextEntry.cpp @@ -202,7 +202,37 @@ void ScreenTextEntry::Input( const DeviceInput& DeviceI, const InputEventType ty INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT)) || INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT)); if ( bIsHoldingShift ) - AppendToAnswer( ssprintf( "%c", DeviceI.ToChar() - 32 ) ); + { + + char c = (char)toupper( DeviceI.ToChar() ); + + switch( c ) + { + case '`': c='~'; break; + case '1': c='!'; break; + case '2': c='@'; break; + case '3': c='#'; break; + case '4': c='$'; break; + case '5': c='%'; break; + case '6': c='^'; break; + case '7': c='&'; break; + case '8': c='*'; break; + case '9': c='('; break; + case '0': c=')'; break; + case '-': c='_'; break; + case '=': c='+'; break; + case '[': c='{'; break; + case ']': c='}'; break; + case '\'': c='"'; break; + case '\\': c='|'; break; + case ';': c=':'; break; + case ',': c='<'; break; + case '.': c='>'; break; + case '/': c='?'; break; + } + + AppendToAnswer( ssprintf( "%c", c ) ); + } else AppendToAnswer( ssprintf( "%c", DeviceI.ToChar() ) );