localize DeviceButton names
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
#include "RageInputDevice.h"
|
#include "RageInputDevice.h"
|
||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
#include "EnumHelper.h"
|
#include "EnumHelper.h"
|
||||||
|
#include "LocalizedString.h"
|
||||||
|
|
||||||
static map<DeviceButton,RString> g_mapNamesToString;
|
static map<DeviceButton,RString> g_mapNamesToString;
|
||||||
static map<RString,DeviceButton> g_mapStringToNames;
|
static map<RString,DeviceButton> g_mapStringToNames;
|
||||||
@@ -146,6 +147,39 @@ RString DeviceButtonToString( DeviceButton key )
|
|||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static LocalizedString HOME ( "DeviceButton", "Home" );
|
||||||
|
static LocalizedString END ( "DeviceButton", "End" );
|
||||||
|
static LocalizedString UP ( "DeviceButton", "Up" );
|
||||||
|
static LocalizedString DOWN ( "DeviceButton", "Down" );
|
||||||
|
static LocalizedString SPACE ( "DeviceButton", "Space" );
|
||||||
|
static LocalizedString SHIFT ( "DeviceButton", "Shift" );
|
||||||
|
static LocalizedString CTRL ( "DeviceButton", "Ctrl" );
|
||||||
|
static LocalizedString ALT ( "DeviceButton", "Alt" );
|
||||||
|
static LocalizedString INSERT ( "DeviceButton", "Insert" );
|
||||||
|
static LocalizedString DELETE ( "DeviceButton", "Delete" );
|
||||||
|
static LocalizedString PGUP ( "DeviceButton", "PgUp" );
|
||||||
|
static LocalizedString PGDN ( "DeviceButton", "PgDn" );
|
||||||
|
|
||||||
|
RString DeviceButtonToLocalizedString( DeviceButton key )
|
||||||
|
{
|
||||||
|
switch( key )
|
||||||
|
{
|
||||||
|
case KEY_HOME: return HOME.GetValue();
|
||||||
|
case KEY_END: return END.GetValue();
|
||||||
|
case KEY_UP: return UP.GetValue();
|
||||||
|
case KEY_DOWN: return DOWN.GetValue();
|
||||||
|
case KEY_SPACE: return SPACE.GetValue();
|
||||||
|
case KEY_LSHIFT: case KEY_RSHIFT: return SHIFT.GetValue();
|
||||||
|
case KEY_LCTRL: case KEY_RCTRL: return CTRL.GetValue();
|
||||||
|
case KEY_LALT: case KEY_RALT: return ALT.GetValue();
|
||||||
|
case KEY_INSERT: return INSERT.GetValue();
|
||||||
|
case KEY_DEL: return DELETE.GetValue();
|
||||||
|
case KEY_PGUP: return PGUP.GetValue();
|
||||||
|
case KEY_PGDN: return PGDN.GetValue();
|
||||||
|
default: return Capitalize( DeviceButtonToString(key) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DeviceButton StringToDeviceButton( const RString& s )
|
DeviceButton StringToDeviceButton( const RString& s )
|
||||||
{
|
{
|
||||||
InitNames();
|
InitNames();
|
||||||
|
|||||||
@@ -276,6 +276,7 @@ enum DeviceButton
|
|||||||
};
|
};
|
||||||
|
|
||||||
RString DeviceButtonToString( DeviceButton i );
|
RString DeviceButtonToString( DeviceButton i );
|
||||||
|
RString DeviceButtonToLocalizedString( DeviceButton i );
|
||||||
DeviceButton StringToDeviceButton( const RString& s );
|
DeviceButton StringToDeviceButton( const RString& s );
|
||||||
|
|
||||||
struct DeviceInput
|
struct DeviceInput
|
||||||
|
|||||||
Reference in New Issue
Block a user