let OS handle key modifers (fixes number buttons w/ French keyboard)

This commit is contained in:
Chris Danford
2006-06-10 20:33:56 +00:00
parent 3b68311391
commit 8c4cedf63f
13 changed files with 113 additions and 118 deletions
+2 -34
View File
@@ -183,42 +183,10 @@ void ScreenTextEntry::Input( const InputEventPlus &input )
}
else if( input.type == IET_FIRST_PRESS )
{
char c = INPUTMAN->DeviceButtonToChar( input.DeviceI.button );
wchar_t c = INPUTMAN->DeviceButtonToChar(input.DeviceI.button,true);
if( c >= ' ' )
{
bool bIsHoldingShift =
INPUTFILTER->IsBeingPressed( DeviceInput(input.DeviceI.device, KEY_RSHIFT)) ||
INPUTFILTER->IsBeingPressed( DeviceInput(input.DeviceI.device, KEY_LSHIFT));
if( bIsHoldingShift )
{
c = (char)toupper( c );
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;
}
}
TryAppendToAnswer( ssprintf( "%c", c ) );
TryAppendToAnswer( WStringToRString(wstring()+c) );
TextEnteredDirectly();
}