| Copyright | (c) 2016-19 Brian W Bush |
|---|---|
| License | MIT |
| Maintainer | Brian W Bush <code@functionally.io> |
| Stability | Production |
| Portability | Portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Network.UI.Kafka.GLUT
Contents
Description
Produce events on a Kafka topic from GLUT callbacks <https://hackage.haskell.org/package/GLUT-2.7.0.10/docs/Graphics-UI-GLUT-Callbacks-Window.html>.
Synopsis
- data GlutCallback
- glutLoop :: TopicConnection -> Sensor -> [GlutCallback] -> IO (ExitAction, LoopAction)
- interpretKeyboardMouse :: Key -> KeyState -> Modifiers -> Position -> Event
- interpretMotion :: Position -> Event
- interpretSpaceball :: SpaceballInput -> Event
- interpretJoystick :: JoystickButtons -> JoystickPosition -> Event
- setCallbacks :: [GlutCallback] -> (Event -> IO ()) -> IO ()
- clearCallbacks :: [GlutCallback] -> IO ()
Event handling.
data GlutCallback Source #
Types of GLUT callbacks. See <https://hackage.haskell.org/package/GLUT-2.7.0.10/docs/Graphics-UI-GLUT-Callbacks-Window.html> for more details.
Constructors
| KeyboardMouse | Key presses and mouse button clicks. |
| Motion | Mouse motion while a button is depressed. |
| PassiveMotion | Mouse motion. |
| Spaceball | Spaceball tracking and button clicks. |
| Joystick | Joystick tracking and button clicks. |
Instances
Arguments
| :: TopicConnection | The Kafka topic name and connection information. |
| -> Sensor | The name of the sensor producing events. |
| -> [GlutCallback] | Which callbacks to enable. |
| -> IO (ExitAction, LoopAction) | Action to create the exit and loop actions. |
Produce events for a Kafka topic from GLUT callbacks <https://hackage.haskell.org/package/GLUT-2.7.0.10/docs/Graphics-UI-GLUT-Callbacks-Window.html>.
Internal.
interpretKeyboardMouse Source #
Arguments
| :: Key | The key. |
| -> KeyState | The state of the key. |
| -> Modifiers | The modifier keys. |
| -> Position | The mouse position. |
| -> Event | The corresponding event. |
Interpret key presses and mouse clickes.
Interpret mouse motion.
Arguments
| :: SpaceballInput | The the spaceball input. |
| -> Event | The corresponding event. |
Interpret a spaceball event.
Arguments
| :: JoystickButtons | The state of joystick buttons. |
| -> JoystickPosition | The joystick position. |
| -> Event | The corresponding event. |
Interpret a joystick event.
Arguments
| :: [GlutCallback] | Which callbacks to enable. |
| -> (Event -> IO ()) | The action for handling GLUT events. |
| -> IO () | Action to create the GLUT callbacks for the channel. |
Set a callback from GLUT callbacks <https://hackage.haskell.org/package/GLUT-2.7.0.10/docs/Graphics-UI-GLUT-Callbacks-Window.html>.
Arguments
| :: [GlutCallback] | Which callbacks to enable. |
| -> IO () | Action to create the GLUT callbacks for the channel. |
Clear callbacks for the specified event types.