In addition you can use the function GetEnumName to get a name for the RawKey:
The output for RAWKEY_A, RAWKEY_LEFT_CONTROL and RAWKEY_LEFT_SHIFT would be:
Logic::IDeviceHandler* deviceHandler = state->GetDeviceHandler();
for (UInt32 i=RAWKEY_NONE; i<MAX_RAWKEY_CODES; i++)
{
RawKeyCode rawKey = static_cast<RawKeyCode>(i);
if ((deviceHandler->WasRawKeyPressed(rawKey)))
{
Debug::Trace("Key pressed");
Debug::Trace("RawKeyCode is %d", i);
Bool error = false;
String name = GetRawKeyCodeEnum().GetEnumName(rawKey, error);
if (!error) Debug::Trace("RawKeyName is %s", name);
}
}
The output for RAWKEY_A, RAWKEY_LEFT_CONTROL and RAWKEY_LEFT_SHIFT would be:
Key pressed
RawKeyCode is 30
RawKeyName is RAWKEY_A
Key pressed
RawKeyCode is 29
RawKeyName is RAWKEY_LEFT_CONTROL
Key pressed
RawKeyCode is 42
RawKeyName is RAWKEY_LEFT_SHIFT