LambdaHack-0.2.0: A roguelike game engine in early and very active development

Safe HaskellNone

Game.LambdaHack.Key

Description

Frontend-independent keyboard input operations.

Synopsis

Documentation

data Key Source

Frontend-independent datatype to represent keys.

Constructors

Esc 
Return 
Space 
Tab 
PgUp 
PgDn 
Left 
Right 
Up 
Down 
End 
Begin 
Home 
KP !Char

a keypad key for a character (digits and operators)

Char !Char

a single printable character

Unknown !String

an unknown key, registered to warn the user

Instances

handleDir :: X -> Key -> (Vector -> a) -> a -> aSource

Configurable event handler for the direction keys. Used for directed commands such as close door.

moveBinding :: ((X -> Vector) -> a) -> ((X -> Vector) -> a) -> [(Key, (String, a))]Source

Binding of both sets of movement keys.

keyTranslate :: String -> KeySource

Translate key from a GTK string description to our internal key type. To be used, in particular, for the command bindings and macros in the config file.