change switch key binding and add fullscreen key binding
This commit is contained in:
parent
cda7bfd068
commit
546417d15d
1 changed files with 9 additions and 1 deletions
|
@ -31,7 +31,7 @@ handlePayload run state (SDL.KeyboardEvent (SDL.KeyboardEventData _ SDL.Pressed
|
||||||
| SDL.keysymKeycode sym == SDL.KeycodeEscape = do
|
| SDL.keysymKeycode sym == SDL.KeycodeEscape = do
|
||||||
_ <- swapMVar run False
|
_ <- swapMVar run False
|
||||||
return ()
|
return ()
|
||||||
| SDL.keysymKeycode sym == SDL.KeycodeF12 || SDL.keysymKeycode sym == SDL.KeycodeF =
|
| SDL.keysymKeycode sym == SDL.KeycodeF8 =
|
||||||
modifyMVar_ state $ \st -> do
|
modifyMVar_ state $ \st -> do
|
||||||
let st2 = st
|
let st2 = st
|
||||||
{ stPresentationWindow =
|
{ stPresentationWindow =
|
||||||
|
@ -47,6 +47,14 @@ handlePayload run state (SDL.KeyboardEvent (SDL.KeyboardEventData _ SDL.Pressed
|
||||||
)
|
)
|
||||||
(stWindows st2)
|
(stWindows st2)
|
||||||
return 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
|
-- catch all other events
|
||||||
handlePayload _ _ _ = return ()
|
handlePayload _ _ _ = return ()
|
||||||
|
|
Loading…
Reference in a new issue