30 lines
535 B
Haskell
30 lines
535 B
Haskell
module Util where
|
|
|
|
import Affection
|
|
|
|
import qualified SDL
|
|
import qualified SDL.Internal.Numbered as SDL
|
|
|
|
-- internal imports
|
|
|
|
import Types
|
|
|
|
globalKeyHandle
|
|
:: GameData
|
|
-> KeyboardMessage
|
|
-> Affection ()
|
|
globalKeyHandle gd mesg@(MsgKeyboardEvent time win motion repeat keysym) =
|
|
case mesg of
|
|
MsgKeyboardEvent
|
|
_
|
|
_
|
|
SDL.Pressed
|
|
False
|
|
(SDL.Keysym SDL.ScancodeF11 _ mod) ->
|
|
if mod == SDL.fromNumber 0
|
|
then
|
|
toggleScreen 0
|
|
else
|
|
return ()
|
|
_ -> return ()
|