JSPM

simple-pointer-lock-api

0.1.0-beta.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q35361F
  • License MIT

Simple API for Pointer Lock in Chrome and Firefox

Package Exports

  • simple-pointer-lock-api

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (simple-pointer-lock-api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

(work in progress)

Simple Pointer Lock API

For Chrome(webkit) and Firefox(Gecko) browsers.

Pointer = require 'simple-pointer-lock-api'

pointer = new Pointer

pointer
.on 'start', =>

    console.log 'start'

.on 'firstMove', =>

    console.log 'firstMove'

.on 'move', (event) =>

    console.log 'move'

    console.log event

.on 'end', =>

    console.log 'end'


document.addEventListener 'click', =>

    pointer.request(document.body)

    # or this will force end:
    # pointer.release()