From 825d59ec44b738fca8ec12ad94fa337979ac2f78 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 15 Jun 2006 03:33:29 +0000 Subject: [PATCH] RageInput::DeviceInputToChar (not keyboard-specific) --- stepmania/src/RageInput.cpp | 17 +++++++++++++++++ stepmania/src/RageInput.h | 1 + 2 files changed, 18 insertions(+) diff --git a/stepmania/src/RageInput.cpp b/stepmania/src/RageInput.cpp index 2aedec78b4..3845013447 100644 --- a/stepmania/src/RageInput.cpp +++ b/stepmania/src/RageInput.cpp @@ -97,6 +97,23 @@ RString RageInput::GetDeviceSpecificInputString( const DeviceInput &di ) return di.ToString(); } +wchar_t RageInput::DeviceInputToChar( DeviceInput di, bool bUseCurrentKeyModifiers ) +{ + FOREACH( InputHandler*, m_pDevices, i ) + { + vector vDevices; + (*i)->GetDevicesAndDescriptions( vDevices ); + + FOREACH_CONST( InputDeviceInfo, vDevices, idi ) + { + if( idi->id == di.device ) + return (*i)->DeviceButtonToChar(di.button, bUseCurrentKeyModifiers); + } + } + + return '\0'; +} + wchar_t RageInput::DeviceButtonToChar( DeviceButton button, bool bUseCurrentKeyModifiers ) { FOREACH( InputHandler*, m_pDevices, i ) diff --git a/stepmania/src/RageInput.h b/stepmania/src/RageInput.h index 37032cfa18..a845180129 100644 --- a/stepmania/src/RageInput.h +++ b/stepmania/src/RageInput.h @@ -21,6 +21,7 @@ public: void WindowReset(); void AddHandler( InputHandler *pHandler ); RString GetDeviceSpecificInputString( const DeviceInput &di ); + wchar_t DeviceInputToChar( DeviceInput di, bool bUseCurrentKeyModifiers ); wchar_t DeviceButtonToChar( DeviceButton button, bool bUseCurrentKeyModifiers ); InputDeviceState GetInputDeviceState( InputDevice id ); RString GetDisplayDevicesString() const;