Class DeviceInputSystem
Hierarchy
- DeviceInputSystem
Implements
Index
Properties
Accessors
Methods
Properties
on Device DisconnectedSearch playground for onDeviceDisconnected
Callback to be triggered when a device is disconnected
Type declaration
-
-
Parameters
-
deviceType: DeviceType
-
deviceSlot: number
Returns void
-
-
on Input ChangedSearch playground for onInputChanged
Callback to be triggered when event driven input is updated
Type declaration
-
-
Parameters
-
deviceType: DeviceType
-
deviceSlot: number
-
inputIndex: number
-
previousState: Nullable<number>
-
currentState: Nullable<number>
Returns void
-
-
Accessors
on Device Connected
-
Returns onDeviceConnected callback property
Returns (deviceType: DeviceType, deviceSlot: number) => void
Callback with function to execute when a device is connected
-
-
Parameters
-
deviceType: DeviceType
-
deviceSlot: number
Returns void
-
-
-
-
Sets callback function when a device is connected and executes against all connected devices
Parameters
-
callback: (deviceType: DeviceType, deviceSlot: number) => void
Function to execute when a device is connected
-
-
Parameters
-
deviceType: DeviceType
-
deviceSlot: number
Returns void
-
-
-
Returns any
Callback with function to execute when a device is connected
-
Methods
disposeSearch playground for dispose
-
Dispose of all the eventlisteners
Returns void
poll InputSearch playground for pollInput
-
Checks for current device input value, given an id and input index. Throws exception if requested device not initialized.
Parameters
-
deviceType: DeviceType
Enum specifiying device type
-
deviceSlot: number
"Slot" or index that device is referenced in
-
inputIndex: number
Id of input to be checked
Returns number
Current value of input
-
Static CreateSearch playground for Create
-
Creates a new DeviceInputSystem instance
Parameters
-
engine: Engine
Engine to pull input element from
Returns DeviceInputSystem
The new instance
-
This class will take all inputs from Keyboard, Pointer, and any Gamepads and provide a polling system that all devices will use. This class assumes that there will only be one pointer device and one keyboard.