* Checks if the system's default quit shortcut was pressed. * @param ev SDL event. * @return Is quitting necessary? */
| 764 | * @return Is quitting necessary? |
| 765 | */ |
| 766 | bool 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. |