Safe Haskell | None |
---|
This FunGEn module controls the user input (mouse, keyboard, joystick...)
- type InputBinding t s u v = (Key, KeyEvent, InputHandler t s u v)
- type InputHandler t s u v = Modifiers -> Position -> IOGame t s u v ()
- data Key
- data KeyEvent
- data SpecialKey
- data MouseButton
- = LeftButton
- | MiddleButton
- | RightButton
- | WheelUp
- | WheelDown
- | AdditionalButton Int
- data Modifiers = Modifiers {}
- data Position = Position !GLint !GLint
- funBinding :: [InputBinding t s u v] -> Game t s u v -> IO (KeyBinder, StillDownHandler)
Documentation
type InputBinding t s u v = (Key, KeyEvent, InputHandler t s u v)Source
A mapping from an input event to an input handler.
type InputHandler t s u v = Modifiers -> Position -> IOGame t s u v ()Source
A FunGEn input handler (which we use instead of GLUTInput's) is an IOGame (game action) that takes two extra arguments: the current keyboard modifiers state, and the current mouse position. (For a StillDown event, these will be the original state and position from the Press event.)
data Key
A generalized view of keys
data SpecialKey
Special keys
data MouseButton
Mouse buttons, including a wheel
data Modifiers
The state of the keyboard modifiers
data Position
A 2-dimensional position, measured in pixels.
funBinding :: [InputBinding t s u v] -> Game t s u v -> IO (KeyBinder, StillDownHandler)Source