| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
FRP.Netwire.Input.JavaScript
Contents
- data JSInputState
- data JSInputControl
- type JSInput = State JSInputState
- type JSInputT m = StateT JSInputState m
- 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
- | KeySpace
- | KeyEnter
- | KeyTab
- | KeyEsc
- | KeyBackspace
- | KeyShift
- | KeyControl
- | KeyAlt
- | KeyCapsLock
- | KeyNumLock
- | KeyArrowLeft
- | KeyArrowUp
- | KeyArrowRight
- | KeyArrowDown
- | KeyIns
- | KeyDel
- | KeyHome
- | KeyEnd
- | KeyPgUp
- | KeyPgDown
- | KeyF1
- | KeyF2
- | KeyF3
- | KeyF4
- | KeyF5
- | KeyF6
- | KeyF7
- | KeyF8
- | KeyF9
- | KeyF10
- | KeyF11
- | KeyF12
- | KeyPadDel
- | KeyPadIns
- | KeyPadEnd
- | KeyPadDown
- | KeyPadPgDown
- | KeyPadLeft
- | KeyPadRight
- | KeyPadHome
- | KeyPadUp
- | KeyPadPgUp
- | KeyPadAdd
- | KeyPadSub
- | KeyPadMul
- | KeyPadDiv
- | KeyPadEnter
- | KeyPadDot
- | KeyPad0
- | KeyPad1
- | KeyPad2
- | KeyPad3
- | KeyPad4
- | KeyPad5
- | KeyPad6
- | KeyPad7
- | KeyPad8
- | KeyPad9
- data MouseButton
- mkInputControl :: JSVal -> IO (Maybe JSInputControl)
- initialInputState :: JSInputState
- pollJavaScript :: JSInputState -> JSInputControl -> IO JSInputState
- cursorLocked :: (Monoid e, Monad m) => Wire s e (JSInputT m) a a
- lockCursor :: JSInputControl -> IO ()
- unlockCursor :: JSInputControl -> IO ()
Documentation
data JSInputState Source #
data JSInputControl Source #
type JSInput = State JSInputState Source #
type JSInputT m = StateT JSInputState m Source #
Constructors
mkInputControl :: JSVal -> IO (Maybe JSInputControl) Source #
Create a JSInputControl from a DOM element.
initialInputState :: JSInputState Source #
Use this with pollJavaScript the first time.
pollJavaScript :: JSInputState -> JSInputControl -> IO JSInputState Source #
Update the JSInputState with the new events.
cursorLocked :: (Monoid e, Monad m) => Wire s e (JSInputT m) a a Source #
In JavaScript, you can lock the pointer only after the user releases a
mouse button or a key. This means that cursorMode (with CursorMode'Reset)
and mouseMickies will not actually lock the pointer, but will schedule
the pointer lock request for the next interaction from the user.
In particular, mouseMickies will behave like mouseCursor if the pointer
is not locked.
This wire, which inhibits if the pointer is not locked, is useful if you want to know if you're still waiting for the user to lock the pointer, and if the user manually unlocked it.
lockCursor :: JSInputControl -> IO () Source #
Manually schedule cursor lock.
unlockCursor :: JSInputControl -> IO () Source #
Manually unlock the cursor.
Orphan instances
| MouseButton MouseButton Source # | |
| Key Key Source # | |
| Monad m => MonadMouse MouseButton (JSInputT m) Source # | |
| Monad m => MonadKeyboard Key (JSInputT m) Source # | |