cleanup odd conditional
comments
This commit is contained in:
@@ -123,6 +123,8 @@ static void InitNames()
|
|||||||
g_mapStringToNames[m->second] = m->first;
|
g_mapStringToNames[m->second] = m->first;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Return a reversible representation of a DeviceButton. This is not affected by InputDrivers,
|
||||||
|
* localization or the keyboard language. */
|
||||||
RString DeviceButtonToString( DeviceButton key )
|
RString DeviceButtonToString( DeviceButton key )
|
||||||
{
|
{
|
||||||
InitNames();
|
InitNames();
|
||||||
@@ -148,12 +150,13 @@ RString DeviceButtonToString( DeviceButton key )
|
|||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Return the name of the button, as it probably appears on the device itself, such as a keycap;
|
||||||
|
* eg. "a". */
|
||||||
RString DeviceInputToTranslatedString( DeviceInput di )
|
RString DeviceInputToTranslatedString( DeviceInput di )
|
||||||
{
|
{
|
||||||
/* All printable ASCII except for uppercase alpha characters line up. */
|
wchar_t c = INPUTMAN->DeviceInputToChar(di,false);
|
||||||
if( di.button >= 33 && di.button < 127 &&
|
if( c )
|
||||||
!(di.button >= 'A' && di.button <= 'Z' ) )
|
return WStringToRString( wstring()+c );
|
||||||
return WStringToRString( wstring()+INPUTMAN->DeviceInputToChar(di,false) );
|
|
||||||
|
|
||||||
return DeviceButtonToString( di.button );
|
return DeviceButtonToString( di.button );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user