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

Safe HaskellNone

Game.LambdaHack.Common.Key

Description

Frontend-independent keyboard input operations.

Synopsis

Documentation

data Key Source

Frontend-independent datatype to represent keys.

Constructors

Esc 
Return 
Space 
Tab 
BackTab 
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 !Text

an unknown key, registered to warn the user

Instances

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

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

moveBinding :: (VectorXY -> a) -> (VectorXY -> a) -> [(KM, 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.

data Modifier Source

Our own encoding of modifiers. Incomplete.

Constructors

NoModifier 
Control 

data KM Source

Constructors

KM 

Fields

modifier :: !Modifier
 
key :: !Key
 

Instances

showKM :: KM -> TextSource

Show a key with a modifier, if any.