Пример #1
0
bool DeviceInput::FromString( const RString &s )
{
	char szDevice[32] = "";
	char szButton[32] = "";

	if( 2 != sscanf( s, "%31[^_]_%31[^_]", szDevice, szButton ) )
	{
		device = InputDevice_Invalid;
		return false;
	}

	device = StringToInputDevice( szDevice );
	button = StringToDeviceButton( szButton );
	return true;
}
Пример #2
0
bool DeviceInput::fromString( const CString &s )
{
	char szDevice[32] = "";
	char szButton[32] = "";

	if( 2 != sscanf( s, "%31[^_]_%31[^_]", szDevice, szButton ) )
	{
		device = DEVICE_NONE;
		return false;
	}

	device = StringToInputDevice( szDevice );
	button = StringToDeviceButton( device, szButton );
	return true;
}