Input.d overview
Table of contents
- utils
- GamepadButtonIndex (type alias)
- Input (class)
- initialize (static method)
- clear (static method)
- update (static method)
- isPressed (static method)
- isTriggered (static method)
- isRepeated (static method)
- isLongPressed (static method)
- date (static method)
- virtualClick (static method)
- _setupEventHandlers (static method)
- _onKeyDown (static method)
- _shouldPreventDefault (static method)
- _onKeyUp (static method)
- _onLostFocus (static method)
- _pollGamepads (static method)
- _updateGamepadState (static method)
- _updateDirection (static method)
- _signX (static method)
- _signY (static method)
- _makeNumpadDirection (static method)
- _isEscapeCompatible (static method)
- KeyboardButtonIndex (type alias)
utils
GamepadButtonIndex (type alias)
Signature
export declare type GamepadButtonIndex = keyof typeof Input.gamepadMapper
Input (class)
The static class that handles input data from the keyboard and gamepads.
Signature
export declare class Input {
constructor()
}
initialize (static method)
Initializes the input system.
Signature
static initialize(): void
clear (static method)
Clears all the input data.
Signature
static clear(): void
update (static method)
Updates the input data.
Signature
static update(): void
isPressed (static method)
Checks whether a key is currently pressed down.
Signature
static isPressed(keyName: string): boolean
isTriggered (static method)
Checks whether a key is just pressed.
Signature
static isTriggered(keyName: string): boolean
isRepeated (static method)
Checks whether a key is just pressed or a key repeat occurred.
Signature
static isRepeated(keyName: string): boolean
isLongPressed (static method)
Checks whether a key is kept depressed.
Signature
static isLongPressed(keyName: string): boolean
date (static method)
The time of the last input in milliseconds.
Signature
static date(): number
virtualClick (static method)
Signature
static virtualClick(buttonName: string): void
_setupEventHandlers (static method)
Signature
static _setupEventHandlers(): void
_onKeyDown (static method)
Signature
static _onKeyDown(event: KeyboardEvent): void
_shouldPreventDefault (static method)
Signature
static _shouldPreventDefault(keyCode: number): boolean
_onKeyUp (static method)
Signature
static _onKeyUp(event: KeyboardEvent): void
_onLostFocus (static method)
Signature
static _onLostFocus(): void
_pollGamepads (static method)
Signature
static _pollGamepads(): void
_updateGamepadState (static method)
Signature
static _updateGamepadState(gamepad: Gamepad): void
_updateDirection (static method)
Signature
static _updateDirection(): void
_signX (static method)
Signature
static _signX(): number
_signY (static method)
Signature
static _signY(): number
_makeNumpadDirection (static method)
Signature
static _makeNumpadDirection(x: number, y: number): number
_isEscapeCompatible (static method)
Signature
static _isEscapeCompatible(keyName: string): boolean
KeyboardButtonIndex (type alias)
Signature
export declare type KeyboardButtonIndex = keyof typeof Input.keyMapper