Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PointerLock

Utility class providing simplified access to the clients pointer lock API.

Hierarchy

  • PointerLock

Index

Properties

Static Protected _element

_element: function

Cached element call returning the fullscreen element specific to the clients fullscreen API.

Type declaration

    • (): HTMLElement
    • Returns HTMLElement

Static Protected _exit

_exit: function

Cached exit call of the clients specific pointer lock API.

Type declaration

    • (): void
    • Returns void

Static Protected _request

_request: function

Cached request call of the clients specific pointer API.

Type declaration

    • (element: HTMLElement): void
    • Parameters

      • element: HTMLElement

      Returns void

Methods

Static active

  • active(element?: HTMLElement): boolean
  • Returns whether or not a pointer lock element exists, indicating if pointer lock is active or not.

    Parameters

    • Optional element: HTMLElement

    Returns boolean

Static exit

  • exit(): void
  • Exit pointer lock. The function considers various platform specific pointer lock interfaces, i.e., native, moz, and webkit.

    Returns void

Static Protected queryAndCacheAPI

  • queryAndCacheAPI(): void
  • Query and cache the client specific pointer lock API.

    Returns void

Static request

  • request(element: HTMLElement, callback?: undefined | function): void
  • Requests pointer lock for a given element. If another element is already in pointer lock, it is unlocked first. The function considers various platform specific pointer lock interfaces, i.e., native, moz, and webkit.

    Parameters

    • element: HTMLElement

      Element to toggle pointer lock state of.

    • Optional callback: undefined | function

    Returns void