InputSystem
Extends:
User input (mouse, keyboard, gamepad).
Example:
const system = new InputSystem(document.getElementById('screen-0'));
Constructor Summary
Public Constructor | ||
public |
constructor(canvas: HTMLCanvasElement, triggerEvents: boolean) Constructor. |
Member Summary
Public Members | ||
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
Method Summary
Public Methods | ||
public |
dispose() |
|
public |
onKeyDown(event: *) |
|
public |
onKeyUp(event: *) |
|
public |
onMouseDown(event: *, target: *) |
|
public |
onMouseMove(event: *, target: *) |
|
public |
onMouseUp(event: *, target: *) |
|
public |
|
|
public |
onTouchDown(event: *, target: *) |
|
public |
onTouchMove(event: *, target: *) |
|
public |
onTouchUp(event: *, target: *) |
|
public |
|
|
public |
Scan for changes in browser gamepads list. |
Inherited Summary
From class System | ||
public static get |
|
|
public static get |
systems: * |
|
public static |
dispose() Dispose and remove all registered systems. |
|
public static |
Returns system instance of given type name. |
|
public static |
Register new system instance under given name. |
|
public static |
unregister(typename: string): System Unregister given system. |
|
public |
dispose() Destructor (disposes all internal resources). |
|
public |
Event called after system gets registered. |
|
public |
Event called before system gets unregistered. |
Public Constructors
Public Members
Public Methods
public onKeyDown(event: *) source
Params:
Name | Type | Attribute | Description |
event | * |
public onKeyUp(event: *) source
Params:
Name | Type | Attribute | Description |
event | * |
public onMouseDown(event: *, target: *) source
Params:
Name | Type | Attribute | Description |
event | * | ||
target | * |
public onMouseMove(event: *, target: *) source
Params:
Name | Type | Attribute | Description |
event | * | ||
target | * |
public onMouseUp(event: *, target: *) source
Params:
Name | Type | Attribute | Description |
event | * | ||
target | * |
public onTouchDown(event: *, target: *) source
Params:
Name | Type | Attribute | Description |
event | * | ||
target | * |
public onTouchMove(event: *, target: *) source
Params:
Name | Type | Attribute | Description |
event | * | ||
target | * |
public onTouchUp(event: *, target: *) source
Params:
Name | Type | Attribute | Description |
event | * | ||
target | * |
public onUnregister() source
Event called before system gets unregistered.