better default InputHandler::GetDeviceSpecificInputString
This commit is contained in:
@@ -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
|
* (c) 2003-2004 Glenn Maynard
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public:
|
|||||||
virtual void GetDevicesAndDescriptions( vector<InputDevice>& vDevicesOut, vector<CString>& vDescriptionsOut ) = 0;
|
virtual void GetDevicesAndDescriptions( vector<InputDevice>& vDevicesOut, vector<CString>& vDescriptionsOut ) = 0;
|
||||||
|
|
||||||
// Override to return a pretty string that's specific to the controller type.
|
// 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.
|
// Override to find out whether the controller is currently plugged in.
|
||||||
// Not all InputHandlers will support this. Not applicable to all InputHandlers.
|
// Not all InputHandlers will support this. Not applicable to all InputHandlers.
|
||||||
|
|||||||
Reference in New Issue
Block a user