Merge pull request #605 from SolidStateDj/add-toggle-fullscreen

Add a toggle fullscreen button
This commit is contained in:
georgemoralis 2024-08-28 06:32:21 +03:00 committed by GitHub
commit e4254ebdaa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 0 deletions

View File

@ -273,6 +273,15 @@ void WindowSDL::onKeyPress(const SDL_Event* event) {
case SDLK_SPACE:
button = OrbisPadButtonDataOffset::ORBIS_PAD_BUTTON_TOUCH_PAD;
break;
case SDLK_F11:
if (event->type == SDL_EVENT_KEY_DOWN) {
{
SDL_WindowFlags flag = SDL_GetWindowFlags(window);
bool is_fullscreen = flag & SDL_WINDOW_FULLSCREEN;
SDL_SetWindowFullscreen(window, !is_fullscreen);
}
}
break;
default:
break;
}