Skip to content

Commit 504a382

Browse files
committed
misc WIP incl landing page summaries, page deletions, binding conflicts
1 parent bccb582 commit 504a382

File tree

9 files changed

+114
-108
lines changed

9 files changed

+114
-108
lines changed
Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +0,0 @@
1-
2-
### Apply binding overrides
3-
4-
You can override aspects of any Binding at run-time non-destructively. Specific properties of [`InputBinding`](../api/UnityEngine.InputSystem.InputBinding.html) have an `override` variant that, if set, will take precedent over the property that they shadow. All `override` properties are of type `String`.
5-
6-
|Property|Override|Description|
7-
|--------|--------|-----------|
8-
|[`path`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_path)|[`overridePath`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_overridePath)|Replaces the [Control path](./Controls.md#control-paths) that determines which Control(s) are referenced in the binding. If [`overridePath`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_overridePath) is set to an empty string, the binding is effectively disabled.<br><br>Example: `"<Gamepad>/leftStick"`|
9-
|[`processors`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_processors)|[`overrideProcessors`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_overrideProcessors)|Replaces the [processors](./Processors.md) applied to the binding.<br><br>Example: `"invert,normalize(min=0,max=10)"`|
10-
|[`interactions`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_interactions)|[`overrideInteractions`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_overrideInteractions)|Replaces the [interactions](./Interactions.md) applied to the binding.<br><br>Example: `"tap(duration=0.5)"`|
11-
12-
>NOTE: The `override` property values will not be saved along with the Actions (for example, when calling [`InputActionAsset.ToJson()`](../api/UnityEngine.InputSystem.InputActionAsset.html#UnityEngine_InputSystem_InputActionAsset_ToJson)). See [Saving and loading rebinds](#saving-and-loading-rebinds) for details about how to persist user rebinds.
13-
14-
To set the various `override` properties, you can use the [`ApplyBindingOverride`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.html#UnityEngine_InputSystem_InputActionRebindingExtensions_ApplyBindingOverride_UnityEngine_InputSystem_InputAction_UnityEngine_InputSystem_InputBinding_) APIs.
15-
16-
```CSharp
17-
// Rebind the "fire" action to the left trigger on the gamepad.
18-
playerInput.actions["fire"].ApplyBindingOverride("<Gamepad>/leftTrigger");
19-
```
20-
21-
In most cases, it is best to locate specific bindings using APIs such as [`GetBindingIndexForControl`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.html#UnityEngine_InputSystem_InputActionRebindingExtensions_GetBindingIndexForControl_) and to then apply the override to that specific binding.
22-
23-
```CSharp
24-
// Find the "Jump" binding for the space key.
25-
var jumpAction = playerInput.actions["Jump"];
26-
var bindingIndex = jumpAction.GetBindingIndexForControl(Keyboard.current.spaceKey);
27-
28-
// And change it to the enter key.
29-
jumpAction.ApplyBindingOverride(bindingIndex, "<Keyboard>/enter");
30-
```

Packages/com.unity.inputsystem/Documentation~/binding-conflicts.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,34 @@
11

22
# Binding conflicts
33

4-
A binding conflict is when an [action](./actions.md) with more than one [control](./controls.md) [bound](./bindings.md) to it recieves values from multiple controls.
4+
A binding conflict is when an [action](./actions.md) with more than one [control](./controls.md) [bound](./bindings.md) to it recieves values from multiple controls.
55

6-
For example, if the left and right triggers of a gamepad are both bound to an "accelerate" action in your game, each trigger could be pressed in to different amounts. This conflict of recieving two different values for the same action is resolved by the Input System.
6+
## Conflict situations
77

8-
## Conflict Resolution
8+
Binding conflict situations can arise in two different ways. Either:
9+
10+
- **Multiple concurrent controls**. Several controls are bound to the same action and more than one is feeding input into the Action at the same time. Example: an Action that is bound to both the left and right trigger on a Gamepad and both triggers are pressed.
911

10-
For [value type actions](./action-and-control-types.md), the Input System continuously monitors all the controls bound to the action, and then chooses the one which is the **most actuated** to be the control driving the action. Most actuated means the largest absolute value is being reported, whether positive or negative in the case of a 1D axis, and regardless of direction in the case of 2D and 3D axes. The value of the most actuated control is reported in callbacks, and triggered whenever the value changes.
12+
Or:
1113

12-
If a different bound control is actuated more, that control becomes the control driving the action. This process is called **conflict resolution**. This is useful if you want to allow different Controls to control an Action in the game, but only take input from one Control at the same time.
14+
- **Multiple input sequences**. The input is part of a sequence of inputs and there are several possible such sequences. Example: one Action is bound to the `B` key and another Action is bound to `Shift-B`.
1315

14-
## Ambiguous situations
16+
## Conflict Resolution
1517

16-
There are two situations where a given input might lead to ambiguity:
18+
For [**value** and **button** type actions](./action-and-control-types.md), the Input System continuously monitors all the controls bound to the action, and then chooses the one which is the **most actuated** to be the control driving the action. Most actuated means the largest absolute value is being reported, whether positive or negative in the case of a 1D axis, and regardless of direction in the case of 2D and 3D axes. The value of the most actuated control is reported in callbacks, and triggered whenever the value changes.
1719

18-
1. Several controls are bound to the same action and more than one is feeding input into the Action at the same time. Example: an Action that is bound to both the left and right trigger on a Gamepad and both triggers are pressed.
19-
2. The input is part of a sequence of inputs and there are several possible such sequences. Example: one Action is bound to the `B` key and another Action is bound to `Shift-B`.
20+
If a different bound control is actuated more, that control becomes the control driving the action. This is useful if you want to allow different Controls to control an Action in the game, but only take input from one Control at the same time.
2021

21-
## Multiple concurrently used controls
22+
[Pass-through type actions](./configure-action-type.md) do not perform conflict resolution, and are intended allow multiple concurrent inputs.
2223

23-
>__Note:__ This section does not apply to [pass-through](./configure-action-type.md) actions, which do not perform conflict resolution, and are intended allow multiple concurrent inputs.
24+
## Multiple concurrent controls
2425

2526
For a **Button** or **Value** [action type](./configure-action-type.md), there can only be one control at any time that is "driving" the action. This control is considered the [`activeControl`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_activeControl).
2627

2728
When an action is bound to multiple controls, the active control at any point is the one with the greatest level of ["actuation"](./control-actuation.md) (the one with the largest value returned from [`EvaluateMagnitude`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_EvaluateMagnitude_)). If a different control exceeds the actuation level of the current active control, it becomes the active control.
2829

2930
For [composite bindings](./composite-bindings.md), magnitudes of the composite as a whole rather than for individual controls are tracked. However, [`activeControl`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_activeControl) will still track individual Controls from the composite.
3031

31-
## Disabling Conflict Resolution
32-
33-
Conflict resolution is always applied to **Button** or **Value** [action types](./configure-action-type.md). However, it can be undesirable in situations when an action is simply used to gather all inputs from bound Controls. For example, if you have a **Button** type action bound to the **A** button on all gamepads, a user holding down **A** on one gamepad means that the **A** button on other gamepads is ignored.
34-
35-
By using the **Pass Through** action type, conflict resolution is bypassed, which means pressing the **A** button on one gamepad will not result in presses on other gamepads being ignored.
36-
3732
## Multiple input sequences (such as keyboard shortcuts)
3833

3934
>__Note__: The mechanism described here only applies to Actions that are part of the same [action map](./action-maps-panel.md) or [action assets](./action-assets.md).
@@ -49,6 +44,15 @@ In our example, this means that a **one-modifier composite** binding to **Shift*
4944

5045
Additionally, the first Binding that results in the Action changing [phase](./set-callbacks-on-actions.md) will consume the input. This results in other Bindings to the same input not being processed. This means in our example, when the **Shift** + **B** binding consumes the **B** input, the Binding to **B** is skipped.
5146

47+
48+
## Disabling Conflict Resolution
49+
50+
Conflict resolution is always applied to **Button** or **Value** [action types](./configure-action-type.md). However, it can be undesirable in situations when an action is simply used to gather all inputs from bound Controls. For example, if you have a **Button** type action bound to the **A** button on all gamepads, a user holding down **A** on one gamepad means that the **A** button on other gamepads is ignored.
51+
52+
By using the **Pass Through** action type, conflict resolution is bypassed, which means pressing the **A** button on one gamepad will not result in presses on other gamepads being ignored.
53+
54+
## API Example
55+
5256
The following example illustrates how this works at the API level.
5357

5458
```CSharp

Packages/com.unity.inputsystem/Documentation~/binding-initial-state-checks.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,5 @@ By default, actions whose [Action Type](./configure-action-type.md) is set to **
1010

1111
However, you can manually enable initial state checks on these types of actions by doing the following:
1212

13-
1. Select the action in the Actions panel of the [Actions Editor window](./actions-editor.md)
14-
2. Enable the **Initial State Check** option in the **Actions Properties** panel.
15-
16-
![Initial State Check](./Images/InitialStateCheck.png)
13+
1. Select the action in the [Actions panel](./actions-panel.md) of the [Actions Editor window](./actions-editor.md)
14+
2. Enable the **Initial State Check** option in the [Actions Properties panel](./action-properties-panel.md) to the right.

Packages/com.unity.inputsystem/Documentation~/binding-overrides.md

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# Bindings
22

3-
(landing page)
3+
![](Images/ConceptsOverview.png)
4+
5+
A **binding** represents a connection between an [Action](actions.md) and one or more [Controls](Controls.md) identified by a [Control path](./control-paths.md).
46

57
| **Topic** | **Description** |
68
| :------------------------------ | :------------------------------- |
7-
| **[Introduction to Bindings](introduction-to-bindings.md)** | Summary |
8-
| **[Add, Duplicate or Delete a Binding](add-duplicate-delete-binding.md)** | Summary |
9-
| **[Pick a control for Binding](pick-control-binding.md)** | Summary |
10-
| **[Composite Bindings](composite-bindings.md)** | Summary |
11-
| **[Binding Overrides](binding-overrides.md)** | Summary |
12-
| **[Set Binding Parameters](set-binding-parameters.md)** | Summary |
13-
| **[Group bindings to control schemes](group-binding-to-control-scheme.md)** | Summary |
14-
| **[Binding resolution](binding-resolution.md)** | Summary |
15-
| **[Restrict bindings to specific devices](restrict-bindings-specific-device.md)** | Summary |
16-
| **[Binding conflicts](binding-conflicts.md)** | Summary |
17-
| **[Initial state checks](binding-initial-state-checks.md)** | Summary |
9+
| **[Introduction to Bindings](introduction-to-bindings.md)** | Learn the basic concepts of bindings. |
10+
| **[Add, Duplicate or Delete a Binding](add-duplicate-delete-binding.md)** | Learn how to add, duplicate or delete bindings. |
11+
| **[Pick a control for Binding](pick-control-binding.md)** | Learn how to choose a specific control that a binding is bound to, such as a specific button or stick on a gamepad, or a specific keyboard key. |
12+
| **[Composite Bindings](composite-bindings.md)** | Bindings made up of multiple simple bindings acting together. |
13+
| **[Group bindings to control schemes](group-binding-to-control-scheme.md)** | Group types of related bindings together according to their control type, so that you can enable or disable groups of bindings |
14+
| **[Binding resolution](binding-resolution.md)** | Learn how the Input Systems resolves binding configurations to currently-connected input devices. |
15+
| **[Restrict bindings to specific devices](restrict-bindings-specific-device.md)** | Specify which specific devices a binding should resolve to. |
16+
| **[Binding conflicts](binding-conflicts.md)** | Learn how the Input System resolves conflicting or ambiguous situations, such as when multiple bindings map to the same action. |
17+
| **[Initial state checks](binding-initial-state-checks.md)** | Learn how the Input System deals with if a control is already pressed when an action is enabled, and how to modify this behavior. |

Packages/com.unity.inputsystem/Documentation~/changing-bindings.md

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)