InputContextMap
in package
Table of Contents
Properties
- $actions : InputActionMap
- Current actions map Do not modify this property!
- $dispatcher : Dispatcher
- $eventHandlerIdInputKey : int
- The function id of the event handler
- $eventHandlerIdInputMouseButton : int
- $eventHandlerIdInputMouseClick : int
- $nextUpdateActionsMap : InputActionMap|null
- The action map that should be applied on the next update
- $registeredActionMaps : array<string, InputActionMap>
- Array of InputActionMap instances bound to a context name
Methods
- __construct() : mixed
- Constructor
- __destruct() : mixed
- Destructor
- handleKeySignal() : void
- Handles the given key signal to update internal action states
- handleMouseButtonSignal() : void
- Handles the given mouse button signal to update internal action states
- handleMouseClickSignal() : void
- Handles Mouse click signals to update internal action states
- register() : void
- Registers the given action map to the given context
- registerAndActivate() : void
- Registers and activates the given action map to the given context
- reset() : void
- Resets the internal action states
- switchTo() : void
- Switches to the action map bound to the given context
- switchToNext() : void
- Switches to the action map bound to the given context on the next update.
Properties
$actions
Current actions map Do not modify this property!
public
InputActionMap
$actions
$dispatcher
private
Dispatcher
$dispatcher
$eventHandlerIdInputKey
The function id of the event handler
private
int
$eventHandlerIdInputKey
= -1
$eventHandlerIdInputMouseButton
private
int
$eventHandlerIdInputMouseButton
= -1
$eventHandlerIdInputMouseClick
private
int
$eventHandlerIdInputMouseClick
= -1
$nextUpdateActionsMap
The action map that should be applied on the next update
private
InputActionMap|null
$nextUpdateActionsMap
= null
$registeredActionMaps
Array of InputActionMap instances bound to a context name
private
array<string, InputActionMap>
$registeredActionMaps
= []
Methods
__construct()
Constructor
public
__construct(Dispatcher $dispatcher) : mixed
Parameters
- $dispatcher : Dispatcher
__destruct()
Destructor
public
__destruct() : mixed
handleKeySignal()
Handles the given key signal to update internal action states
public
handleKeySignal(KeySignal $signal) : void
Parameters
- $signal : KeySignal
handleMouseButtonSignal()
Handles the given mouse button signal to update internal action states
public
handleMouseButtonSignal(MouseButtonSignal $signal) : void
Parameters
- $signal : MouseButtonSignal
handleMouseClickSignal()
Handles Mouse click signals to update internal action states
public
handleMouseClickSignal(MouseClickSignal $signal) : void
Parameters
- $signal : MouseClickSignal
register()
Registers the given action map to the given context
public
register(string $context, InputActionMap $actionMap) : void
Parameters
- $context : string
- $actionMap : InputActionMap
registerAndActivate()
Registers and activates the given action map to the given context
public
registerAndActivate(string $context, InputActionMap $actionMap) : void
Parameters
- $context : string
- $actionMap : InputActionMap
reset()
Resets the internal action states
public
reset() : void
switchTo()
Switches to the action map bound to the given context
public
switchTo(string $context) : void
Parameters
- $context : string
switchToNext()
Switches to the action map bound to the given context on the next update.
public
switchToNext(string $context) : void
This can be really helpful when you want to switch to a new context but you don't want to reset the current context until the next update, all action are done..
Parameters
- $context : string