Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- type Callback m = Int -> (ModifierKeys, KeyState, Key) -> m ()
- callback :: MonadSink rs m => Callback m -> m ReleaseKey
- data Key
- = Key'Unknown
- | Key'Space
- | Key'Apostrophe
- | Key'Comma
- | Key'Minus
- | Key'Period
- | Key'Slash
- | Key'0
- | Key'1
- | Key'2
- | Key'3
- | Key'4
- | Key'5
- | Key'6
- | Key'7
- | Key'8
- | Key'9
- | Key'Semicolon
- | Key'Equal
- | Key'A
- | Key'B
- | Key'C
- | Key'D
- | Key'E
- | Key'F
- | Key'G
- | Key'H
- | Key'I
- | Key'J
- | Key'K
- | Key'L
- | Key'M
- | Key'N
- | Key'O
- | Key'P
- | Key'Q
- | Key'R
- | Key'S
- | Key'T
- | Key'U
- | Key'V
- | Key'W
- | Key'X
- | Key'Y
- | Key'Z
- | Key'LeftBracket
- | Key'Backslash
- | Key'RightBracket
- | Key'GraveAccent
- | Key'World1
- | Key'World2
- | Key'Escape
- | Key'Enter
- | Key'Tab
- | Key'Backspace
- | Key'Insert
- | Key'Delete
- | Key'Right
- | Key'Left
- | Key'Down
- | Key'Up
- | Key'PageUp
- | Key'PageDown
- | Key'Home
- | Key'End
- | Key'CapsLock
- | Key'ScrollLock
- | Key'NumLock
- | Key'PrintScreen
- | Key'Pause
- | Key'F1
- | Key'F2
- | Key'F3
- | Key'F4
- | Key'F5
- | Key'F6
- | Key'F7
- | Key'F8
- | Key'F9
- | Key'F10
- | Key'F11
- | Key'F12
- | Key'F13
- | Key'F14
- | Key'F15
- | Key'F16
- | Key'F17
- | Key'F18
- | Key'F19
- | Key'F20
- | Key'F21
- | Key'F22
- | Key'F23
- | Key'F24
- | Key'F25
- | Key'Pad0
- | Key'Pad1
- | Key'Pad2
- | Key'Pad3
- | Key'Pad4
- | Key'Pad5
- | Key'Pad6
- | Key'Pad7
- | Key'Pad8
- | Key'Pad9
- | Key'PadDecimal
- | Key'PadDivide
- | Key'PadMultiply
- | Key'PadSubtract
- | Key'PadAdd
- | Key'PadEnter
- | Key'PadEqual
- | Key'LeftShift
- | Key'LeftControl
- | Key'LeftAlt
- | Key'LeftSuper
- | Key'RightShift
- | Key'RightControl
- | Key'RightAlt
- | Key'RightSuper
- | Key'Menu
- data KeyState
- data ModifierKeys = ModifierKeys {}
- mkCallback :: UnliftIO m -> Callback m -> KeyCallback
Documentation
Part of the Keyboard Input system.
Instances
Data Key | |
Defined in Graphics.UI.GLFW.Types gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Key -> c Key # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Key # dataTypeOf :: Key -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Key) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Key) # gmapT :: (forall b. Data b => b -> b) -> Key -> Key # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Key -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Key -> r # gmapQ :: (forall d. Data d => d -> u) -> Key -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Key -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Key -> m Key # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Key -> m Key # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Key -> m Key # | |
Bounded Key | |
Enum Key | |
Generic Key | |
Read Key | |
Show Key | |
NFData Key | |
Defined in Graphics.UI.GLFW.Types | |
Eq Key | |
Ord Key | |
type Rep Key | |
Defined in Graphics.UI.GLFW.Types type Rep Key = D1 ('MetaData "Key" "Graphics.UI.GLFW.Types" "GLFW-b-3.3.0.0-6a75b1c7daa663bd53f8b0fb24e39c08db92be5fbadde6af260dfe5b0e0e8abf" 'False) ((((((C1 ('MetaCons "Key'Unknown" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Key'Space" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'Apostrophe" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Key'Comma" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'Minus" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'Period" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'Slash" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "Key'0" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'1" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'2" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'3" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Key'4" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'5" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'6" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'7" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "Key'8" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Key'9" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'Semicolon" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Key'Equal" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'A" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'B" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'C" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "Key'D" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'E" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'F" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'G" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Key'H" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'I" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'J" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'K" 'PrefixI 'False) (U1 :: Type -> Type)))))) :+: ((((C1 ('MetaCons "Key'L" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Key'M" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'N" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Key'O" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'P" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'Q" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'R" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "Key'S" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'T" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'U" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'V" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Key'W" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'X" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'Y" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'Z" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "Key'LeftBracket" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Key'Backslash" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'RightBracket" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Key'GraveAccent" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'World1" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'World2" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'Escape" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "Key'Enter" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'Tab" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'Backspace" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'Insert" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Key'Delete" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'Right" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'Left" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'Down" 'PrefixI 'False) (U1 :: Type -> Type))))))) :+: (((((C1 ('MetaCons "Key'Up" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Key'PageUp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'PageDown" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Key'Home" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'End" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'CapsLock" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'ScrollLock" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "Key'NumLock" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'PrintScreen" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'Pause" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'F1" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Key'F2" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'F3" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'F4" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'F5" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "Key'F6" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Key'F7" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'F8" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Key'F9" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'F10" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'F11" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'F12" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "Key'F13" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'F14" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'F15" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'F16" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Key'F17" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'F18" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'F19" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'F20" 'PrefixI 'False) (U1 :: Type -> Type)))))) :+: ((((C1 ('MetaCons "Key'F21" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Key'F22" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'F23" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Key'F24" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'F25" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'Pad0" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'Pad1" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "Key'Pad2" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'Pad3" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'Pad4" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'Pad5" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Key'Pad6" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'Pad7" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'Pad8" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'Pad9" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: ((((C1 ('MetaCons "Key'PadDecimal" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'PadDivide" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'PadMultiply" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'PadSubtract" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Key'PadAdd" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'PadEnter" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'PadEqual" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'LeftShift" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "Key'LeftControl" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'LeftAlt" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'LeftSuper" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'RightShift" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Key'RightControl" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'RightAlt" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Key'RightSuper" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Key'Menu" 'PrefixI 'False) (U1 :: Type -> Type)))))))) |
The state of an individual key when getKey
is called.
Instances
Data KeyState | |
Defined in Graphics.UI.GLFW.Types gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> KeyState -> c KeyState # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c KeyState # toConstr :: KeyState -> Constr # dataTypeOf :: KeyState -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c KeyState) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KeyState) # gmapT :: (forall b. Data b => b -> b) -> KeyState -> KeyState # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> KeyState -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> KeyState -> r # gmapQ :: (forall d. Data d => d -> u) -> KeyState -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> KeyState -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> KeyState -> m KeyState # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> KeyState -> m KeyState # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> KeyState -> m KeyState # | |
Bounded KeyState | |
Enum KeyState | |
Generic KeyState | |
Read KeyState | |
Show KeyState | |
NFData KeyState | |
Defined in Graphics.UI.GLFW.Types | |
Eq KeyState | |
Ord KeyState | |
Defined in Graphics.UI.GLFW.Types | |
type Rep KeyState | |
Defined in Graphics.UI.GLFW.Types type Rep KeyState = D1 ('MetaData "KeyState" "Graphics.UI.GLFW.Types" "GLFW-b-3.3.0.0-6a75b1c7daa663bd53f8b0fb24e39c08db92be5fbadde6af260dfe5b0e0e8abf" 'False) (C1 ('MetaCons "KeyState'Pressed" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "KeyState'Released" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KeyState'Repeating" 'PrefixI 'False) (U1 :: Type -> Type))) |
data ModifierKeys #
Modifier keys that were pressed as part of another keypress event.
ModifierKeys | |
|
Instances
mkCallback :: UnliftIO m -> Callback m -> KeyCallback Source #