diff --git a/stepmania/src/arch/InputHandler/InputHandler.cpp b/stepmania/src/arch/InputHandler/InputHandler.cpp index 3d7408d958..3585f468cd 100644 --- a/stepmania/src/arch/InputHandler/InputHandler.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler.cpp @@ -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. diff --git a/stepmania/src/arch/InputHandler/InputHandler.h b/stepmania/src/arch/InputHandler/InputHandler.h index e8814a8a07..c4ea4eed9a 100644 --- a/stepmania/src/arch/InputHandler/InputHandler.h +++ b/stepmania/src/arch/InputHandler/InputHandler.h @@ -31,7 +31,7 @@ public: virtual void GetDevicesAndDescriptions( vector& vDevicesOut, vector& 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.