Safe Haskell | None |
---|---|
Language | Haskell2010 |
Frontend-independent keyboard input operations.
- data Key
- = Esc
- | Return
- | Space
- | Tab
- | BackTab
- | BackSpace
- | PgUp
- | PgDn
- | Left
- | Right
- | Up
- | Down
- | End
- | Begin
- | Insert
- | Delete
- | Home
- | KP !Char
- | Char !Char
- | Fun !Int
- | LeftButtonPress
- | MiddleButtonPress
- | RightButtonPress
- | LeftButtonRelease
- | MiddleButtonRelease
- | RightButtonRelease
- | WheelNorth
- | WheelSouth
- | Unknown !String
- | DeadKey
- showKey :: Key -> String
- handleDir :: Bool -> Bool -> KM -> Maybe Vector
- dirAllKey :: Bool -> Bool -> [Key]
- moveBinding :: Bool -> Bool -> (Vector -> a) -> (Vector -> a) -> [(KM, a)]
- mkKM :: String -> KM
- mkChar :: Char -> KM
- mkKP :: Char -> KM
- keyTranslate :: String -> Key
- keyTranslateWeb :: String -> Bool -> Key
- data Modifier
- = NoModifier
- | Shift
- | Control
- | Alt
- data KM = KM {}
- showKM :: KM -> String
- escKM :: KM
- spaceKM :: KM
- safeSpaceKM :: 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
- leftButtonReleaseKM :: KM
- rightButtonReleaseKM :: KM
Documentation
Frontend-independent datatype to represent keys.
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 |
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 |
handleDir :: Bool -> Bool -> 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.
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/keyname-table.h
keyTranslateWeb :: String -> Bool -> Key Source #
Translate key from a Web API string description (https:/developer.mozilla.orgen-USdocsWebAPIKeyboardEvent/key#Key_values) to our internal key type. To be used in web frontends. The argument says whether Shift is pressed.
Our own encoding of modifiers.
safeSpaceKM :: KM Source #
wheelNorthKM :: KM Source #
wheelSouthKM :: KM Source #
backspaceKM :: KM Source #