Socket
Socket
Sign inDemoInstall

jspointerlock

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jspointerlock

W3C Pointer Lock Fallback


Version published
Maintainers
1
Install size
544 kB
Created

Readme

Source

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

Keywords

FAQs

Last updated on 04 Feb 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc