-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | GLFW utility functions to use together with monad-task. -- -- GLFW (http://hackage.haskell.org/package/GLFW) is a Haskell -- binding to the GLFW C library for writing OpenGL programs. This -- package provides some utility functions for writing GLFW programs -- using the monad-task library -- (http://hackage.haskell.org/package/GLFW-task). An example is -- provided in the package source to demonstrate its usage. @package GLFW-task @version 0.2.0 -- | GLFW helper functions for use with a TaskT monad transformer -- (from monad-task package). module Graphics.UI.GLFW.Task -- | Event is a unified data type for all GLFW events. data Event KeyEvent :: Key -> KeyButtonState -> Event CharEvent :: Char -> KeyButtonState -> Event MouseButtonEvent :: MouseButton -> KeyButtonState -> Event MousePosEvent :: Position -> Event MouseWheelEvent :: Int -> Event WindowSizeEvent :: Size -> Event WindowCloseEvent :: Event WindowRefreshEvent :: 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, isRelease :: (a, KeyButtonState) -> Maybe a -- | 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. registerTaskCallbacks :: (MonadIO m, MonadTask Event m) => IO (m ()) instance Eq Event instance Show Event