fix NumPad keys

This commit is contained in:
Chris Danford
2006-06-10 21:19:35 +00:00
parent 8c4cedf63f
commit 8cdce5cfda
2 changed files with 7 additions and 3 deletions
@@ -36,7 +36,7 @@ void InputHandler::ButtonPressed( DeviceInput di, bool Down )
wchar_t InputHandler::DeviceButtonToChar( DeviceButton button, bool bUseCurrentKeyModifiers )
{
wchar_t c;
wchar_t c = '\0';
switch( button )
{
default:
@@ -53,6 +53,8 @@ wchar_t InputHandler::DeviceButtonToChar( DeviceButton button, bool bUseCurrentK
case KEY_KP_EQUAL: c ='='; break;
}
// Handle some default US keyboard modifiers for derived InputHandlers that
// don't implement DeviceButtonToChar.
if( bUseCurrentKeyModifiers )
{
bool bHoldingShift =
@@ -95,7 +97,7 @@ wchar_t InputHandler::DeviceButtonToChar( DeviceButton button, bool bUseCurrentK
}
return '\0';
return c;
}
RString InputHandler::GetDeviceSpecificInputString( const DeviceInput &di )
@@ -679,7 +679,9 @@ wchar_t InputHandler_DInput::DeviceButtonToChar( DeviceButton button, bool bUseC
ZERO( keys );
if( bUseCurrentKeyModifiers )
GetKeyboardState(keys);
return ScancodeAndKeysToChar( i->ofs, keys );
wchar_t c = ScancodeAndKeysToChar( i->ofs, keys );
if( c )
return c;
}
}