FunGEn-0.4: FUNctional Game ENgine

Safe HaskellNone

Graphics.UI.Fungen.Input

Description

This FunGEn module controls the user input (mouse, keyboard, joystick...)

Synopsis

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

Instances

data KeyEvent Source

Constructors

Press 
StillDown 
Release 

Instances

data MouseButton

Mouse buttons, including a wheel

data Modifiers

The state of the keyboard modifiers

Constructors

Modifiers 

Fields

shift :: KeyState
 
ctrl :: KeyState
 
alt :: KeyState
 

data Position

A 2-dimensional position, measured in pixels.

Constructors

Position !GLint !GLint