diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-03-09 12:20:46 +0000 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-03-09 12:20:46 +0000 |
commit | ee50719de81145b5859d957da722cf183e0c8c60 (patch) | |
tree | e6806d074aaab10103716e632332e02bb4390159 /src/Game.hs | |
parent | 677f9396a30754c4030707a8d88009516a20758f (diff) | |
download | space-plat-hs-ee50719de81145b5859d957da722cf183e0c8c60.tar.gz space-plat-hs-ee50719de81145b5859d957da722cf183e0c8c60.zip |
Use ALT + Enter to toggle fullscreen
Diffstat (limited to 'src/Game.hs')
-rw-r--r-- | src/Game.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Game.hs b/src/Game.hs index 2f9988d..52ba6a7 100644 --- a/src/Game.hs +++ b/src/Game.hs @@ -134,8 +134,11 @@ gameLoop :: Env -> IO () gameLoop e = do events <- map SDL.eventPayload <$> SDL.pollEvents - -- F11 for fullscreen / windowed - env <- if fromMaybe False $ C.isPressed SDL.KeycodeF11 events then toggleFullscreen e else pure e + -- ALT + Enter for fullscreen / windowed + env <- + if fromMaybe False (C.isPressed SDL.KeycodeReturn events) && C.isModKey C.altMod events + then toggleFullscreen e + else pure e let renderer = env.renderer canvas = env.canvas |