netwire-input-javascript-0.0.2: JavaScript instance of netwire-input

Safe HaskellNone
LanguageHaskell2010

FRP.Netwire.Input.JavaScript

Contents

Synopsis

Documentation

mkInputControl :: JSVal -> IO (Maybe JSInputControl) Source #

Create a JSInputControl from a DOM element.

initialInputState :: JSInputState Source #

Use this with pollJavaScript the first time.

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