Win32: Add a command-line option to let the escape button exit the emulator.

This commit is contained in:
The Dax 2014-02-07 16:44:30 -05:00
parent de1c756258
commit 7efaadaf3c
3 changed files with 9 additions and 0 deletions

View File

@ -69,6 +69,7 @@ public:
bool bTopMost;
std::string sFont;
bool bIgnoreWindowsKey;
bool bEscapeExitsEmulator;
#endif
// Core
bool bIgnoreBadMemAccess;

View File

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

View File

@ -297,6 +297,9 @@ 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