diff --git a/src/Events.hs b/src/Events.hs index fc86bf1..c9ec694 100644 --- a/src/Events.hs +++ b/src/Events.hs @@ -31,7 +31,7 @@ handlePayload run state (SDL.KeyboardEvent (SDL.KeyboardEventData _ SDL.Pressed | SDL.keysymKeycode sym == SDL.KeycodeEscape = do _ <- swapMVar run False return () - | SDL.keysymKeycode sym == SDL.KeycodeF12 || SDL.keysymKeycode sym == SDL.KeycodeF = + | SDL.keysymKeycode sym == SDL.KeycodeF8 = modifyMVar_ state $ \st -> do let st2 = st { stPresentationWindow = @@ -47,6 +47,14 @@ handlePayload run state (SDL.KeyboardEvent (SDL.KeyboardEventData _ SDL.Pressed ) (stWindows st2) return st2 + | SDL.keysymKeycode sym == SDL.KeycodeF11 = do + st <- readMVar state + wc <- SDL.getWindowConfig (snd $ head $ stWindows st) + case SDL.windowMode wc of + SDL.Windowed -> + mapM_ (flip SDL.setWindowMode SDL.FullscreenDesktop . snd) (stWindows st) + _ -> + mapM_ (flip SDL.setWindowMode SDL.Windowed . snd) (stWindows st) -- catch all other events handlePayload _ _ _ = return ()