1.0.0 • Published 7 years ago

jspointerlock v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

jsPointerLock

NPM Version NPM Downloads License

W3C Pointer Lock Fallback

Specification

Pointer Lock API, W3C

Usage

I suggest you to use jspm as your package manager.

import PointerLock from "jspointerlock";

const pointerLock = new PointerLock(document.body);

pointerLock.on("change", (isLocked) => {
  console.log(`pointer is ${isLocked ? 'locked' : 'not locked'}`);
});

pointerLock.element.addEventListener("click", () => {
  pointerLock.requestPointerLock();
});

Directly in a browser

Please checkout the index-dist.html file for direct usage in a browser.

API

Classes

  • PointerLock
    • Constructor(Element element) extends EventEmitter
    • Members
      • requestPointerLock() => Void
    • Static Members
      • exitPointerLock() => Void
    • Properties
      • element => Element
      • isLocked => Boolean
    • Static Properties
      • isSupported => Boolean
      • pointerLockElement => Element
    • Events
      • change => (Boolean isLocked, Event e)
      • error => (Error err, Event e)
      • unsupported => ()

License

MIT

1.0.0

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago