Safe Haskell | None |
---|---|
Language | Haskell98 |
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 -> Maybe ()
- isPress :: (a, KeyButtonState) -> Maybe a
- 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 #
isButton :: MouseButton -> MouseButton -> Maybe () Source #
isPress :: (a, KeyButtonState) -> Maybe a Source #
isRelease :: (a, KeyButtonState) -> Maybe a Source #
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.