Class: Inputs

rune.input.Inputs(optionsopt)

The Inputs class is a subsystem that handles all of Rune's input devices, such as keyboards and gamepads. All access to input devices thus passes through an instance of this class.

Constructor

new Inputs(optionsopt)

Creates a new instance of the Inputs class.
Parameters:
Name Type Attributes Description
options Object <optional>
Input settings.
Source:

Members

(readonly) gamepads :rune.input.Gamepads

A subsystem that handles all connected gamepad devices. A connected device is represented by a Gamepad object, which can be requested via this instance.
Type:
Source:

(readonly) keyboard :rune.input.Keyboard

Represents the keyboard. Use this object to read the current state of keys, such as pressed, released, etc..
Type:
Source:

Methods

createActions(gamepadopt) → {rune.input.Actions}

Creates an automatically updated action collection using this keyboard. Dispose the collection when its owner is removed; it is then unregistered on the next input update. Collections may select different gamepads and keys for separate players. Direct device access remains available.
Parameters:
Name Type Attributes Description
gamepad rune.input.Gamepad <optional>
Player's gamepad. Defaults to slot zero; pass null for keyboard-only input.
Source:
Throws:
If this input subsystem is disposed.
Type
Error
Returns:
The new action collection.
Type
rune.input.Actions

reset() → {undefined}

Resets the state of all input devices.
Source:
Returns:
Type
undefined