Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PointerLock

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

Hierarchy

  • PointerLock

Index

Constructors

constructor

Properties

Static Protected _element

_element: () => HTMLElement

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

Type declaration

    • (): HTMLElement
    • Returns HTMLElement

Static Protected _exit

_exit: () => void

Cached exit call of the clients specific pointer lock API.

Type declaration

    • (): void
    • Returns void

Static Protected _request

_request: (element: HTMLElement) => void

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

Static request

  • request(element: HTMLElement, callback?: () => void): 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: () => void
        • (): void
        • Returns void

    Returns void