helm-0.3.1: A functionally reactive game engine.

Safe HaskellNone

FRP.Helm.Keyboard

Contents

Description

Contains signals that sample input from the keyboard.

Synopsis

Types

Key State

shift :: SignalGen (Signal Bool)Source

Whether either shift key is pressed.

ctrl :: SignalGen (Signal Bool)Source

Whether either control key is pressed.

enter :: SignalGen (Signal Bool)Source

Whether the enter (a.k.a. return) key is pressed.

space :: SignalGen (Signal Bool)Source

Whether the space key is pressed.

isDown :: Key -> SignalGen (Signal Bool)Source

Whether a key is pressed.

keysDown :: SignalGen (Signal [Key])Source

A list of keys that are currently being pressed.

Directions

arrows :: SignalGen (Signal (Int, Int))Source

A directional tuple combined from the arrow keys. When none of the arrow keys are being pressed this signal samples to (0, 0), otherwise it samples to a direction based on which keys are pressed. For example, pressing the left key results in (-1, 0), the down key (0, 1), up and right (1, -1), etc.

wasd :: SignalGen (Signal (Int, Int))Source

Similar to the arrows signal, but uses the popular WASD movement controls instead.