MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / isQuitShortcut

Function isQuitShortcut

src/Engine/CrossPlatform.cpp:766–779  ·  view source on GitHub ↗

* Checks if the system's default quit shortcut was pressed. * @param ev SDL event. * @return Is quitting necessary? */

Source from the content-addressed store, hash-verified

764 * @return Is quitting necessary?
765 */
766bool isQuitShortcut(const SDL_Event &ev)
767{
768#ifdef _WIN32
769 // Alt + F4
770 return (ev.type == SDL_KEYDOWN && ev.key.keysym.sym == SDLK_F4 && ev.key.keysym.mod & KMOD_ALT);
771#elif __APPLE__
772 // Command + Q
773 return (ev.type == SDL_KEYDOWN && ev.key.keysym.sym == SDLK_q && ev.key.keysym.mod & KMOD_LMETA);
774#else
775 //TODO add other OSs shortcuts.
776 (void)ev;
777 return false;
778#endif
779}
780
781/**
782 * Gets the last modified date of a file.

Callers 1

runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected