Extends
- ViewService
Members
# inFullscreen :boolean
Returns true if the app is currently in fullscreen mode
Type:
- boolean
# inPointerLock :boolean
Returns true if the app is currently in pointerlock mode. In pointerlock mode the mouse cursor will not be displayed and mouse movements will not return screen coordinates.
Type:
- boolean
Methods
# addChord(name, down, upopt)
Adds a custom event that will fire when a combination of keys is pressed. The event chordDown is published when the chord is completed, and the event chordUp is published when any key in a pressed chord is released.
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | The name of the chord. |
|
down |
Array.<string> | The keys that comprise the chord. |
|
up |
Array.<string> |
<optional> |
The keys that prevent the chord. |
this.service("InputManager").addChord("cheat", ['q', 't']); // Pressing q and t together will start cheat mode
this.subscribe("input", "cheatDown", () => { console.log("Start cheat mode!"); })
# enterFullscreen()
Attempts to put the app in fullscreen mode.
# exitFullscreen()
Takes the app out of fullscreen mode.
Note: Many browsers provide alternate ways to cancel fullscreen.
# enterPointerLock()
Attempts to put the app in pointerlock mode. In pointerlock mode the mouse cursor will not be displayed and mouse movements will not return screen coordinates.
# exitPointerLock()
Takes the app out of pointerlock mode. In pointerlock mode the mouse cursor will not be displayed and mouse movements will not return screen coordinates.
Note: Many browsers provide alternate ways to cancel pointerlock.