class
VirtualInput
Handles virtual input that allows you to receive virtual input events that hide the actual physical input, allowing you to easily change the input keys while being transparent to the external code.
Public
Constructors
VirtualInput
Methods
SetConfiguration
Input configuration that determines how physical keys map to virtual buttons.
GetConfiguration
staticGetOrCreateVirtualButton
Creates a new virtual button associated with the name, or returns an existing button if it exists.
staticGetOrCreateVirtualAxis
Creates a new virtual axis associated with the name, or returns an existing axis if it exists.
IsButtonDown
Check is the virtual button just getting pressed.
This state is only active for one frame.
- button
- Virtual button identifier.
- deviceIndex
- Optional device index in case multiple input devices are available.
IsButtonUp
Check is the virtual button just getting released.
This state is only active for one frame.
- button
- Virtual button identifier.
- deviceIndex
- Optional device index in case multiple input devices are available.
IsButtonHeld
Check is the virtual button is being held.
This state is active as long as the button is being held down, possibly for multiple frames.
- button
- Virtual button identifier.
- deviceIndex
- Optional device index in case multiple input devices are available.
GetAxisValue
Returns normalized value for the specified input axis.
Returned value will usually be in [-1.0, 1.0] range, but can be outside the range for devices with unbound axes (for example mouse).
- axis
- Virtual axis identifier.
- deviceIndex
- Optional device index in case multiple input devices are available.
staticInstance
Returns a reference to the module instance.
Module has to have been started up first otherwise an exception will be thrown.
staticInstancePtr
Returns a pointer to the module instance.
Module has to have been started up first otherwise an exception will be thrown.
staticShutDown
Shuts down this module and frees any resources it is using.
staticIsStarted
Query if the module has been started.
Fields
OnButtonDown
Triggered when a virtual button is pressed.
OnButtonUp
Triggered when a virtual button is released.
OnButtonHeld
Triggered every frame when a virtual button is being held down.
Internal
Methods
UpdateInternal
Called once every frame.
Triggers button callbacks.
Protected
Methods
~Module<T>
OnStartUp
Override if you want your module to be notified once it has been constructed and started.
OnShutDown
Override if you want your module to be notified just before it is deleted.
staticInstanceInternal
Returns a singleton instance of this module.