Safe Haskell | Safe-Infered |
---|
GLFW helper functions for use with a TaskT
monad transformer (from monad-task package).
- data Event
- onKey :: Event -> Maybe (Key, KeyButtonState)
- onChar :: Event -> Maybe (Char, KeyButtonState)
- onButton :: Event -> Maybe (MouseButton, KeyButtonState)
- onPos :: Event -> Maybe Position
- onWheel :: Event -> Maybe Int
- onSize :: Event -> Maybe Size
- onClose :: Event -> Maybe ()
- onRefresh :: Event -> Maybe ()
- isKey :: Enum a => a -> Key -> Maybe ()
- isChar :: Char -> Char -> Maybe ()
- isButton :: MouseButton -> (MouseButton, KeyButtonState) -> Maybe KeyButtonState
- isPress, isRelease :: (a, KeyButtonState) -> Maybe a
- registerTaskCallbacks :: (MonadIO m, MonadTask Event m) => IO (m ())
Documentation
Event
is a unified data type for all GLFW events.
onButton :: Event -> Maybe (MouseButton, KeyButtonState)Source
isPress, isRelease :: (a, KeyButtonState) -> Maybe aSource
registerTaskCallbacks :: (MonadIO m, MonadTask Event m) => IO (m ())Source
registerTaskCallbacks
sets up all event callbacks, and returns a
waitEvent
equivalent function for task monad,
which must be called repeatedly in order to pump events to other
task co-routines.
These task co-routines should use watch
to select event of interest, and they should be forked prior to
the waitEvent call.