| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Game.LambdaHack.Client.UI.Key
Contents
Description
Frontend-independent keyboard input operations.
Synopsis
- data Key
- = Esc
- | Return
- | Space
- | Tab
- | BackTab
- | BackSpace
- | PgUp
- | PgDn
- | Left
- | Right
- | Up
- | Down
- | End
- | Begin
- | Insert
- | Delete
- | PrintScreen
- | Home
- | KP Char
- | Char Char
- | Fun Int
- | LeftButtonPress
- | MiddleButtonPress
- | RightButtonPress
- | LeftButtonRelease
- | MiddleButtonRelease
- | RightButtonRelease
- | WheelNorth
- | WheelSouth
- | Unknown String
- | DeadKey
- data Modifier
- = NoModifier
- | ControlShift
- | AltShift
- | Shift
- | Control
- | Alt
- data KM = KM {}
- data KMP = KMP {
- kmpKeyMod :: KM
- kmpPointer :: PointUI
- showKey :: Key -> String
- showKM :: KM -> String
- escKM :: KM
- controlEscKM :: KM
- spaceKM :: KM
- safeSpaceKM :: KM
- undefinedKM :: KM
- returnKM :: KM
- pgupKM :: KM
- pgdnKM :: KM
- wheelNorthKM :: KM
- wheelSouthKM :: KM
- upKM :: KM
- downKM :: KM
- leftKM :: KM
- rightKM :: KM
- homeKM :: KM
- endKM :: KM
- backspaceKM :: KM
- controlP :: KM
- leftButtonReleaseKM :: KM
- middleButtonReleaseKM :: KM
- rightButtonReleaseKM :: KM
- cardinalAllKM :: Bool -> Bool -> [KM]
- dirAllKey :: Bool -> Bool -> [Key]
- handleCardinal :: [KM] -> KM -> Maybe Vector
- handleDir :: [Key] -> KM -> Maybe Vector
- moveBinding :: Bool -> Bool -> (Vector -> a) -> (Vector -> a) -> [(KM, a)]
- mkKM :: String -> KM
- mkChar :: Char -> KM
- keyTranslate :: String -> Key
- keyTranslateWeb :: String -> Bool -> Key
- dirMoveNoModifier :: Bool -> Bool -> [Key]
- dirRunNoModifier :: Bool -> Bool -> [Key]
- dirRunControl :: [Key]
- dirRunShift :: [Key]
- dirKeypadKey :: [Key]
- dirKeypadShiftChar :: [Char]
- dirKeypadShiftKey :: [Key]
- dirLeftHandKey :: [Key]
- dirLeftHandShiftKey :: [Key]
- dirViChar :: [Char]
- dirViKey :: [Key]
- dirViShiftKey :: [Key]
Documentation
Frontend-independent datatype to represent keys.
Constructors
| Esc | |
| Return | |
| Space | |
| Tab | |
| BackTab | |
| BackSpace | |
| PgUp | |
| PgDn | |
| Left | |
| Right | |
| Up | |
| Down | |
| End | |
| Begin | |
| Insert | |
| Delete | |
| PrintScreen | |
| Home | |
| KP Char | a keypad key for a character (digits and operators) |
| Char Char | a single printable character |
| Fun Int | function key |
| LeftButtonPress | left mouse button pressed |
| MiddleButtonPress | middle mouse button pressed |
| RightButtonPress | right mouse button pressed |
| LeftButtonRelease | left mouse button released |
| MiddleButtonRelease | middle mouse button released |
| RightButtonRelease | right mouse button released |
| WheelNorth | mouse wheel rotated north |
| WheelSouth | mouse wheel rotated south |
| Unknown String | an unknown key, registered to warn the user |
| DeadKey |
Instances
Our own encoding of modifiers.
Constructors
| NoModifier | |
| ControlShift | |
| AltShift | |
| Shift | |
| Control | |
| Alt |
Instances
| Generic Modifier Source # | |
| Show Modifier Source # | |
| Binary Modifier Source # | |
| NFData Modifier Source # | |
Defined in Game.LambdaHack.Client.UI.Key | |
| Eq Modifier Source # | |
| Ord Modifier Source # | |
Defined in Game.LambdaHack.Client.UI.Key | |
| type Rep Modifier Source # | |
Defined in Game.LambdaHack.Client.UI.Key type Rep Modifier = D1 ('MetaData "Modifier" "Game.LambdaHack.Client.UI.Key" "LambdaHack-0.11.0.1-inplace" 'False) ((C1 ('MetaCons "NoModifier" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ControlShift" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AltShift" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "Shift" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Control" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Alt" 'PrefixI 'False) (U1 :: Type -> Type)))) | |
Key and modifier.
Instances
| Generic KM Source # | |
| Show KM Source # | |
| Binary KM Source # | |
| NFData KM Source # | |
Defined in Game.LambdaHack.Client.UI.Key | |
| Eq KM Source # | |
| Ord KM Source # | |
| type Rep KM Source # | |
Defined in Game.LambdaHack.Client.UI.Key type Rep KM = D1 ('MetaData "KM" "Game.LambdaHack.Client.UI.Key" "LambdaHack-0.11.0.1-inplace" 'False) (C1 ('MetaCons "KM" 'PrefixI 'True) (S1 ('MetaSel ('Just "modifier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Modifier) :*: S1 ('MetaSel ('Just "key") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Key))) | |
Key, modifier and position of mouse pointer.
Constructors
| KMP | |
Fields
| |
controlEscKM :: KM Source #
safeSpaceKM :: KM Source #
undefinedKM :: KM Source #
wheelNorthKM :: KM Source #
wheelSouthKM :: KM Source #
backspaceKM :: KM Source #
handleDir :: [Key] -> KM -> Maybe Vector 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, vi and laptop.
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.
See https://github.com/twobob/gtk-/blob/master/gdk/keynames.txt
keyTranslateWeb :: String -> Bool -> Key Source #
Translate key from a Web API string description (https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key#Key_values) to our internal key type. To be used in web frontends. The argument says whether Shift is pressed.
dirRunControl :: [Key] Source #
dirRunShift :: [Key] Source #
Internal operations
dirKeypadKey :: [Key] Source #
dirKeypadShiftChar :: [Char] Source #
dirKeypadShiftKey :: [Key] Source #
dirLeftHandKey :: [Key] Source #
dirLeftHandShiftKey :: [Key] Source #
dirViShiftKey :: [Key] Source #