Enable --escape-exit for all relevant platforms. It makes PPSSPP more front-end friendly by letting escape quit the emu.

This commit is contained in:
The Dax 2014-04-26 01:00:45 -04:00
parent 4394d034b3
commit 6bedad2aa5
4 changed files with 18 additions and 9 deletions

View file

@ -72,8 +72,12 @@ public:
bool bTopMost;
std::string sFont;
bool bIgnoreWindowsKey;
#endif
#if !defined(MOBILE_DEVICE)
bool bEscapeExitsEmulator;
#endif
// Core
bool bIgnoreBadMemAccess;
bool bFastMemory;

View file

@ -320,6 +320,10 @@ void NativeInit(int argc, const char *argv[],
fileToLog = argv[i] + strlen("--log=");
if (!strncmp(argv[i], "--state=", strlen("--state=")) && strlen(argv[i]) > strlen("--state="))
stateToLoad = argv[i] + strlen("--state=");
#if !defined(MOBILE_DEVICE)
if (!strncmp(__argv[i], "--escape-exit", strlen("--escape-exit")))
g_Config.bEscapeExitsEmulator = true;
#endif
break;
}
} else {
@ -684,6 +688,11 @@ 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", "");
}
#endif
g_buttonTracker.Process(key);
if (screenManager)
screenManager->key(key);

View file

@ -118,11 +118,6 @@ namespace WindowsRawInput {
return;
}
if (g_Config.bEscapeExitsEmulator && raw->data.keyboard.VKey == VK_ESCAPE) {
PostMessage(MainWindow::GetHWND(), WM_CLOSE, 0, 0);
return;
}
KeyInput key;
key.deviceId = DEVICE_ID_KEYBOARD;

View file

@ -168,7 +168,11 @@ std::string System_GetProperty(SystemProperty prop) {
}
}
void System_SendMessage(const char *command, const char *parameter) {}
void System_SendMessage(const char *command, const char *parameter) {
if (!strcmp(command, "finish")) {
PostMessage(MainWindow::GetHWND(), WM_CLOSE, 0, 0);
}
}
void EnableCrashingOnCrashes()
{
@ -340,9 +344,6 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
if (!strncmp(__argv[i], "--windowed", strlen("--windowed")))
g_Config.bFullScreen = false;
if (!strncmp(__argv[i], "--escapeexitsemu", strlen("--escapeexitsemu")))
g_Config.bEscapeExitsEmulator = true;
}
}
#ifdef _DEBUG