InputContext
Collection of actions which holds related actions and defines how they interact with other contexts/actions.
| Memory category | Instances |
|---|
Member index 5
Description
An InputContext is a collection of actions which holds related
InputActions and defines how they interact with other
contexts and actions. Nested InputContext instances will have no effect and
ordering/priority is managed through Enabled,
Priority, and Sink.
History 10
- 708 Add InputActionsChanged
- 708 Add GetInputActions
- 687 Change Tags of InputContext from [NotBrowsable] to []
- 663 Change Category of Sink from Data to Behavior
- 663 Change Category of Priority from Data to Behavior
- 663 Change Category of Enabled from Data to Behavior
- 661 Add Sink
- 661 Add Priority
- 661 Add Enabled
- 661 Add InputContext
Members 5
Enabled
| Type | Default | |
|---|---|---|
| bool | true | |
Determines if this InputContext is enabled or not. When false, all of
the descendant actions of the context do not receive any signals except
when Enabled is toggled from true to false, in which case a final
"end" signal is triggered if a key is pressed or a two-directional input
is not zero.
| Thread safety | ReadSafe |
|---|---|
| Category | Behavior |
| Loaded/Saved | true |
GetInputActions
| Parameters (0) | ||
|---|---|---|
| No parameters. | ||
| Returns (1) | ||
| Instances | ||
| Security | RobloxScriptSecurity |
|---|---|
| Thread safety | Unsafe |
History 1
- 708 Add GetInputActions
InputActionsChanged
| Parameters (0) | ||
|---|---|---|
| No parameters. | ||
| Security | RobloxScriptSecurity |
|---|---|
| Thread safety | Unsafe |
History 1
Priority
| Type | Default | |
|---|---|---|
| int | 1000 | |
The priority level at which the context should be run (higher priority
InputContext instances run before lower ones).
| Thread safety | ReadSafe |
|---|---|
| Category | Behavior |
| Loaded/Saved | true |
Sink
| Type | Default | |
|---|---|---|
| bool | false | |
When Sink is set to true, inputs will not be processed for connected
InputAction bindings within contexts of lower
Priority. Contexts with the same priority
will receive the input.
For example, if multiple contexts contain an InputAction with a
binding to KeyCode.E and a higher priority context has Sink set
to true, the lower priority contexts will not receive the input signal
for KeyCode.E and will fire no events for it.
| Thread safety | ReadSafe |
|---|---|
| Category | Behavior |
| Loaded/Saved | true |