better default InputHandler::GetDeviceSpecificInputString

This commit is contained in:
Glenn Maynard
2005-12-09 02:04:55 +00:00
parent d4db7a0dd0
commit b683be9023
2 changed files with 14 additions and 1 deletions
@@ -38,6 +38,19 @@ void InputHandler::ButtonPressed( DeviceInput di, bool Down )
}
}
CString InputHandler::GetDeviceSpecificInputString( const DeviceInput &di )
{
if( di.device == DEVICE_KEYBOARD )
{
char c = di.ToChar();
if( c )
return ssprintf( "Key %c", c );
return ssprintf( "Key %s", DeviceButtonToString(di.device, di.button).c_str() );
}
return di.ToString();
}
/*
* (c) 2003-2004 Glenn Maynard
* All rights reserved.
@@ -31,7 +31,7 @@ public:
virtual void GetDevicesAndDescriptions( vector<InputDevice>& vDevicesOut, vector<CString>& vDescriptionsOut ) = 0;
// Override to return a pretty string that's specific to the controller type.
virtual CString GetDeviceSpecificInputString( const DeviceInput &di ) { return di.ToString(); }
virtual CString GetDeviceSpecificInputString( const DeviceInput &di );
// Override to find out whether the controller is currently plugged in.
// Not all InputHandlers will support this. Not applicable to all InputHandlers.