Merge pull request #18056 from fp64/sdl-ctrl-w

Implement Ctrl-W and Ctrl-B on SDL
This commit is contained in:
Henrik Rydgård 2023-09-03 12:01:29 +02:00 committed by GitHub
commit 42741430bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 1 deletions

View file

@ -863,6 +863,28 @@ static void ProcessSDLEvent(SDL_Window *window, const SDL_Event &event, InputSta
g_rebootEmuThread = true;
}
#endif
// Convenience subset of what
// "Enable standard shortcut keys"
// does on Windows.
if(g_Config.bSystemControls) {
bool ctrl = bool(event.key.keysym.mod & KMOD_CTRL);
if (ctrl && (k == SDLK_w))
{
if (Core_IsStepping())
Core_EnableStepping(false);
Core_Stop();
System_PostUIMessage("stop", "");
// NOTE: Unlike Windows version, this
// does not need Core_WaitInactive();
// since SDL does not have a separate
// UI thread.
}
if (ctrl && (k == SDLK_b))
{
System_PostUIMessage("reset", "");
Core_EnableStepping(false);
}
}
break;
}
case SDL_KEYUP: