direction.keyboard.input overview
Table of contents
- utils
- DirectionKeyboardInput (class)
- DirectionKeyboardKeymap (type alias)
- DirectionKeyboardOutput (type alias)
utils
DirectionKeyboardInput (class)
An input class, responsible for handling direction keys and providing simple current direction observable. Supports two the most popular keyboard layouts: WASD and arrows.
Signature
export declare class DirectionKeyboardInput {
constructor(protected readonly keyboard: KeyboardInput, protected readonly keymap: DirectionKeyboardKeymap)
}
startInternal (method)
Called when the input handling should start.
Signature
protected startInternal()
DirectionKeyboardKeymap (type alias)
The type representing desired keymap for DirectionKeyboardInput
Signature
export type DirectionKeyboardKeymap = 'arrows' | 'wasd' | 'wasd+arrows'
DirectionKeyboardOutput (type alias)
The type of DirectionKeyboardInput output value
Signature
export type DirectionKeyboardOutput = { upDown?: boolean; leftRight?: boolean }