LambdaHack-0.5.0.0: A game engine library for roguelike dungeon crawlers

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Client.Key

Description

Frontend-independent keyboard input operations.

Synopsis

Documentation

data Key Source

Frontend-independent datatype to represent keys.

Constructors

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

a keypad key for a character (digits and operators)

Char !Char

a single printable character

LeftButtonPress

left mouse button pressed

MiddleButtonPress

middle mouse button pressed

RightButtonPress

right mouse button pressed

Unknown !Text

an unknown key, registered to warn the user

Instances

handleDir :: Bool -> Bool -> KM -> (Vector -> a) -> a -> a Source

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

moveBinding :: Bool -> Bool -> (Vector -> a) -> (Vector -> a) -> [(KM, a)] Source

Binding of both sets of movement keys.

keyTranslate :: String -> Key Source

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 
Shift 
Control 
Alt 

data KM Source

Constructors

KM 

Fields

key :: !Key
 
modifier :: !Modifier
 
pointer :: !(Maybe Point)
 

Instances

showKM :: KM -> Text Source

Show a key with a modifier, if any.