コード例 #1
0
ファイル: KeyMap.cpp プロジェクト: Alwayssnarky/ppsspp
// Note that it's easy to add other defaults if desired.
void RestoreDefault() {
	g_controllerMap.clear();
#if defined(_WIN32)
	SetDefaultKeyMap(DEFAULT_MAPPING_KEYBOARD, true);
	SetDefaultKeyMap(DEFAULT_MAPPING_X360, false);
	SetDefaultKeyMap(DEFAULT_MAPPING_PAD, false);
#elif defined(ANDROID)
	// Autodetect a few common devices
	std::string name = System_GetProperty(SYSPROP_NAME);
	if (IsNvidiaShield(name)) {
		SetDefaultKeyMap(DEFAULT_MAPPING_SHIELD, true);
	} else if (IsOuya(name)) {  // TODO: check!
		SetDefaultKeyMap(DEFAULT_MAPPING_OUYA, true);
	} else if (IsXperiaPlay(name)) {
		SetDefaultKeyMap(DEFAULT_MAPPING_XPERIA_PLAY, true);
	} else {
		SetDefaultKeyMap(DEFAULT_MAPPING_PAD, true);
	}
#elif defined(BLACKBERRY)
	std::string name = System_GetProperty(SYSPROP_NAME);
	if (IsBlackberryQWERTY(name)) {
		SetDefaultKeyMap(DEFAULT_MAPPING_BLACKBERRY_QWERTY, true);
	} else {
		SetDefaultKeyMap(DEFAULT_MAPPING_PAD, true);
	}
#else
	SetDefaultKeyMap(DEFAULT_MAPPING_KEYBOARD, true);
	SetDefaultKeyMap(DEFAULT_MAPPING_PAD, false);
#endif
}
コード例 #2
0
ファイル: KeyMap.cpp プロジェクト: KrisLee/ppsspp
// Note that it's easy to add other defaults if desired.
void RestoreDefault() {
	g_controllerMap.clear();
#if defined(_WIN32)
	SetDefaultKeyMap(DEFAULT_MAPPING_KEYBOARD, true);
	SetDefaultKeyMap(DEFAULT_MAPPING_X360, false);
	SetDefaultKeyMap(DEFAULT_MAPPING_PAD, false);
#elif defined(ANDROID)
	// Autodetect a few common devices
	std::string name = System_GetName();
	if (name == "NVIDIA:SHIELD") {
		SetDefaultKeyMap(DEFAULT_MAPPING_SHIELD, true);
	} else if (name == "OUYA:OUYA Console") {  // TODO: check!
		SetDefaultKeyMap(DEFAULT_MAPPING_OUYA, true);
	} else if (name == "Sony Ericsson:R800i" || name == "Sony Ericsson:zeus") {
		SetDefaultKeyMap(DEFAULT_MAPPING_XPERIA_PLAY, true);
	} else {
		SetDefaultKeyMap(DEFAULT_MAPPING_PAD, true);
	}
#else
	SetDefaultKeyMap(DEFAULT_MAPPING_KEYBOARD, true);
	SetDefaultKeyMap(DEFAULT_MAPPING_PAD, false);
#endif
}