Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Aztecs.Input
Synopsis
- data Key
- = KeyA
- | KeyB
- | KeyC
- | KeyD
- | KeyE
- | KeyF
- | KeyG
- | KeyH
- | KeyI
- | KeyJ
- | KeyK
- | KeyL
- | KeyM
- | KeyN
- | KeyO
- | KeyP
- | KeyQ
- | KeyR
- | KeyS
- | KeyT
- | KeyU
- | KeyV
- | KeyW
- | KeyX
- | KeyY
- | KeyZ
- | Key0
- | Key1
- | Key2
- | Key3
- | Key4
- | Key5
- | Key6
- | Key7
- | Key8
- | Key9
- | KeyF1
- | KeyF2
- | KeyF3
- | KeyF4
- | KeyF5
- | KeyF6
- | KeyF7
- | KeyF8
- | KeyF9
- | KeyF10
- | KeyF11
- | KeyF12
- | KeyEscape
- | KeyEnter
- | KeySpace
- | KeyBackspace
- | KeyTab
- | KeyCapsLock
- | KeyShift
- | KeyCtrl
- | KeyAlt
- | KeyLeft
- | KeyRight
- | KeyUp
- | KeyDown
- | KeyHome
- | KeyEnd
- | KeyPageUp
- | KeyPageDown
- | KeyInsert
- | KeyDelete
- | KeyMinus
- | KeyEquals
- | KeyBracketLeft
- | KeyBracketRight
- | KeyBackslash
- | KeySemicolon
- | KeyComma
- | KeyPeriod
- | KeySlash
- | KeyNumLock
- | KeyNumpad0
- | KeyNumpad1
- | KeyNumpad2
- | KeyNumpad3
- | KeyNumpad4
- | KeyNumpad5
- | KeyNumpad6
- | KeyNumpad7
- | KeyNumpad8
- | KeyNumpad9
- | KeyNumpadDivide
- | KeyNumpadMultiply
- | KeyNumpadMinus
- | KeyNumpadPlus
- | KeyNumpadEnter
- | KeyNumpadPeriod
- | KeySuper
- | KeyMenu
- data InputMotion
- data KeyboardInput = KeyboardInput {
- keyboardEvents :: !(Map Key InputMotion)
- keyboardPressed :: !(Set Key)
- keyboardInput :: KeyboardInput
- isKeyPressed :: Key -> KeyboardInput -> Bool
- wasKeyPressed :: Key -> KeyboardInput -> Bool
- wasKeyReleased :: Key -> KeyboardInput -> Bool
- handleKeyboardEvent :: Key -> InputMotion -> KeyboardInput -> KeyboardInput
- data MouseButton
- data MouseInput = MouseInput {
- mousePosition :: !(Point V2 Int)
- mouseOffset :: !(V2 Int)
- mouseButtons :: !(Map MouseButton InputMotion)
- mouseInput :: MouseInput
- handleMouseMotion :: V2 Int -> MouseInput -> MouseInput
Documentation
Constructors
Instances
data InputMotion Source #
Instances
Generic InputMotion Source # | |
Defined in Aztecs.Input Associated Types type Rep InputMotion :: Type -> Type # | |
Show InputMotion Source # | |
Defined in Aztecs.Input Methods showsPrec :: Int -> InputMotion -> ShowS # show :: InputMotion -> String # showList :: [InputMotion] -> ShowS # | |
NFData InputMotion Source # | |
Defined in Aztecs.Input Methods rnf :: InputMotion -> () # | |
Eq InputMotion Source # | |
Defined in Aztecs.Input | |
type Rep InputMotion Source # | |
data KeyboardInput Source #
Keyboard input component.
Constructors
KeyboardInput | |
Fields
|
Instances
isKeyPressed :: Key -> KeyboardInput -> Bool Source #
True
if this key is currently pressed.
wasKeyPressed :: Key -> KeyboardInput -> Bool Source #
True
if this key was pressed this frame.
wasKeyReleased :: Key -> KeyboardInput -> Bool Source #
True
if this key was released this frame.
handleKeyboardEvent :: Key -> InputMotion -> KeyboardInput -> KeyboardInput Source #
data MouseButton Source #
Constructors
ButtonLeft | |
ButtonMiddle | |
ButtonRight | |
ButtonX1 | |
ButtonX2 | |
ButtonExtra !Int | An unknown mouse button. |
Instances
data MouseInput Source #
Mouse input component.
Constructors
MouseInput | |
Fields
|
Instances
handleMouseMotion :: V2 Int -> MouseInput -> MouseInput Source #