mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-12 14:00:27 +02:00
Instead of using escape only, allow anything mapped to "Pause" to exit as well.
This commit is contained in:
1 parent
a7a2bb3b28
commit
731a27dd58
2 files changed
+15
-4
No files matched your search
+14
-3
@@ -79,6 +79,10 @@
|
||||
#include "UI/MiscScreens.h"
|
||||
#include "UI/TiltEventProcessor.h"
|
||||
|
||||
#if !defined(MOBILE_DEVICE)
|
||||
#include "Common/KeyMap.h"
|
||||
#endif
|
||||
|
||||
// The new UI framework, for initialization
|
||||
|
||||
static UI::Theme ui_theme;
|
||||
@@ -322,7 +326,7 @@ void NativeInit(int argc, const char *argv[],
|
||||
stateToLoad = argv[i] + strlen("--state=");
|
||||
#if !defined(MOBILE_DEVICE)
|
||||
if (!strncmp(argv[i], "--escape-exit", strlen("--escape-exit")))
|
||||
g_Config.bEscapeExitsEmulator = true;
|
||||
g_Config.bPauseExitsEmulator = true;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -689,8 +693,15 @@ void NativeTouch(const TouchInput &touch) {
|
||||
void NativeKey(const KeyInput &key) {
|
||||
// ILOG("Key code: %i flags: %i", key.keyCode, key.flags);
|
||||
#if !defined(MOBILE_DEVICE)
|
||||
if (g_Config.bEscapeExitsEmulator && key.keyCode == NKCODE_ESCAPE) {
|
||||
System_SendMessage("finish", "");
|
||||
if (g_Config.bPauseExitsEmulator) {
|
||||
static std::vector<int> pspKeys;
|
||||
pspKeys.clear();
|
||||
if (KeyMap::KeyToPspButton(key.deviceId, key.keyCode, &pspKeys)) {
|
||||
if (std::find(pspKeys.begin(), pspKeys.end(), VIRTKEY_PAUSE) != pspKeys.end()) {
|
||||
System_SendMessage("finish", "");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
g_buttonTracker.Process(key);
|
||||
|
||||
Reference in new issue
Block a user