Skip to content

Commit bb20c83

Browse files
committed
Still 2253
1 parent 3eacb2a commit bb20c83

10 files changed

Lines changed: 77 additions & 53 deletions

Packages/com.unity.inputsystem/Documentation~/control-actuation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ uid: input-system-control-actuation
66

77
Control actuation refers to whether or not a [control](controls.md) is currently being used by the user.
88

9-
A control is considered actuated when it has moved away from its default state in such a way that it affects the value of the control.
9+
A control is considered "actuated" when it has moved away from its default state in such a way that it affects the actual value of the control. Use [`IsActuated`](xref:UnityEngine.InputSystem.InputControlExtensions.IsActuated(UnityEngine.InputSystem.InputControl,System.Single)) to query whether a control is currently actuated.
1010

1111
The recommended workflow is to [bind controls to actions](add-duplicate-delete-binding.md), and then [respond to input at runtime](./respond-to-input.md) by polling or recieving callbacks from those actions. For this reason, it is not typically necessary to directly check whether a control is actuated. Instead, actuation of a control bound to an action causes the action to be performed (according to its [interaction pattern](Interactions.md), if an interaction has been assigned).
1212

@@ -34,7 +34,7 @@ if (Gamepad.current.leftStick.EvaluateMagnitude() > 0.25f)
3434
Debug.Log("Left Stick actuated past 25%");
3535
```
3636

37-
There are two mechanisms within the Input System that most notably make use of control actuation:
37+
These two mechanisms use control actuation:
3838

3939
- [Interactive rebinding](interactive-rebinding.md) (`InputActionRebindingExceptions.RebindOperation`) uses it to select between multiple suitable controls to find the one that is actuated the most.
4040
- [Conflict resolution](binding-conflicts.md) between multiple controls that are bound to the same action uses it to decide which control gets to drive the action.

Packages/com.unity.inputsystem/Documentation~/control-paths.md

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ uid: input-system-control-paths
44

55
# Control paths
66

7-
Control paths represent the way to describe a control or group of controls on a device, when [binding](bindings.md) them to an [action](actions.md).
8-
9-
An example of a control path is `<Gamepad>/leftStick/x`, which refers to the X-axis of the left stick of any gamepad.
7+
The Input System can look up controls using textual paths. [Bindings](bindings.md) on Input [Actions](actions.md) rely on this feature to identify the control(s) they read input from. For example, `<Gamepad>/leftStick/x` means "X control on left stick of gamepad". However, you can also use them for lookup directly on controls and devices, or to let the Input System search for controls among all devices using [`InputSystem.FindControls`](xref:UnityEngine.InputSystem.InputSystem.FindControls(System.String)):
108

119
At runtime, the Input System performs a look-up of all control paths against the currently connected devices to discover which controls match the ones specified in the paths. This process is called [binding resolution](binding-resolution.md).
1210

@@ -36,13 +34,17 @@ The device and control tree is organized hierarchically from generic to specific
3634

3735
## Format
3836

39-
Control paths are strings, which resemble file system paths. Each path consists of one or more components separated by a forward slash:
37+
Control paths resemble file system paths: they contain components separated by a forward slash (`/`):
4038

41-
component/component...
39+
```
40+
component/component...
41+
```
4242

43-
Each component uses a similar syntax made up of multiple fields. Each field is optional, but at least one field must be present. All fields are case-insensitive.
43+
Each component itself contains a set of fields with its own syntax. Each field is individually optional, provided that at least one of the fields is present as either a name or a wildcard:
4444

45-
<layoutName>{usageName}controlName#(displayName)
45+
```structured text
46+
<layoutName>{usageName}#(displayName)controlName
47+
```
4648

4749
The following table explains the use of each field:
4850

@@ -53,16 +55,32 @@ The following table explains the use of each field:
5355
|`controlName`|Requires the control at the current level to have the given name. Takes both "proper" names ([`InputControl.name`](xref:UnityEngine.InputSystem.InputControl)) and aliases ([`InputControl.aliases`](xref:UnityEngine.InputSystem.InputControl)) into account.<br><br>This field can also be a wildcard (`*`) to match any name.|`MyGamepad/buttonSouth`<br><br>`*/{PrimaryAction}` (match `PrimaryAction` usage on Devices with any name)|
5456
|`#(displayName)`|Requires the control at the current level to have the given display name (i.e. [`InputControl.displayName`](xref:UnityEngine.InputSystem.InputControl)). The display name may contain whitespace and symbols.|`<Keyboard>/#(a)` (matches the key that generates the "a" character, if any, according to the current keyboard layout).<br><br>`<Gamepad>/#(Cross)`|
5557

58+
Here are examples of control paths:
59+
60+
```csharp
61+
// Matches all gamepads (also gamepads *based* on the Gamepad layout):
62+
"<Gamepad>"
63+
// Matches the "Submit" control on all devices:
64+
"*/"
65+
// Matches the key that prints the "a" character on the current keyboard layout:
66+
"<Keyboard>/#(a)"
67+
// Matches the X axis of the left stick on a gamepad.
68+
"<Gamepad>/leftStick/x"
69+
// Matches the orientation control of the right-hand XR controller:
70+
"<XRController>/orientation"
71+
// Matches all buttons on a gamepad.
72+
"<Gamepad>/<Button>"
73+
```
74+
5675
### Wildcard characters
5776

5877
If you enter a control path as text, you can use the wildcard asterisk character (`*`) to match multiple controls in the hierarchy specified. For example, you can use `<Touchscreen>/touch*/press` to bind to any finger pressed on the touchscreen, instead of individually binding to `<Touchscreen>/touch0/press`, `<Touchscreen>/touch1/press` and each other numbered touch separately.
5978

6079

6180
## Access from code
6281

63-
You can access the literal path of a given control via its [`InputControl.path`](xref:UnityEngine.InputSystem.InputControl) property.
82+
You can access the literal path of a given control via its [`InputControl.path`](xref:UnityEngine.InputSystem.InputControl.path) property. If you need to, you can manually parse a control path into its components using the [`InputControlPath.Parse(path)`](xref:UnityEngine.InputSystem.InputControlPath.Parse(System.String)) API:
6483

65-
If needed, you can manually parse a control path into its components using the [`InputControlPath.Parse(path)`](xref:UnityEngine.InputSystem.InputControlPath) API.
6684

6785
```CSharp
6886
var parsed = InputControlPath.Parse("<XRController>{LeftHand}/trigger").ToArray();

Packages/com.unity.inputsystem/Documentation~/control-state.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ However, the documentation on this page gives information about the details of h
1414

1515
Each control is connected to a block of memory that is considered the control's "state". You can query the size, format, and location of this block of memory from a control through the [`InputControl.stateBlock`](xref:UnityEngine.InputSystem.InputControl) property.
1616

17-
The state of controls is stored in unmanaged memory that the Input System handles internally. All Devices added to the system share one block of unmanaged memory that contains the state of all the controls on the Devices.
17+
The Input System stores the state of controls in unmanaged memory that it handles internally. All Devices added to the system share one block of unmanaged memory that contains the state of all the controls on the Devices.
1818

1919
A control's state might not be stored in the natural format for that control. For example, the system often represents buttons as bitfields, and axis controls as 8-bit or 16-bit integer values. This format is determined by the combination of platform, hardware, and drivers. Each control knows the format of its storage and how to translate the values as needed. The Input System uses [layouts](layouts.md) to understand this representation.
2020

Packages/com.unity.inputsystem/Documentation~/create-edit-delete-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ However there are many other ways to work with actions which might suit less com
99

1010
## Create Actions using the Action editor
1111

12-
For information on how to create and edit Input Actions in the editor, see the [Input Actions editor](actions-editor.md). This is the recommended workflow if you want to organise all your input actions and bindings in one place, which applies across the whole of your project. This often the case for most types of game or app.
12+
For information on how to create and edit Input Actions in the editor, see the [Input Actions editor](actions-editor.md). This is the recommended workflow if you want to organize all your input actions and bindings in one place, which applies across the whole of your project. This often the case for most types of game or app.
1313

1414
![Action Editor Window](Images/ProjectSettingsInputActionsSimpleShot.png)
1515
*The Input Actions Editor in the Project Settings window*

Packages/com.unity.inputsystem/Documentation~/noisy-controls.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ If a control is marked as noisy:
1717
- When the application loses focus and Devices are [reset](reset-device.md) as a result, the state of noisy control will be preserved as is. This ensures that sensor readings will remain at their last value rather than being reset to default values.
1818

1919
> [!NOTE]
20+
> To query whether a control is noisy, use the [`InputControl.noisy`](xref:UnityEngine.InputSystem.InputControl.noisy) property.
21+
>
2022
> If any control on a device is noisy, the device itself is flagged as noisy.
2123
2224
In addition to the [`input state`](xref:UnityEngine.InputSystem.InputControl) and the [`default state`](xref:UnityEngine.InputSystem.InputControl) that the Input System keeps for all Devices currently present, it also maintains a [`noise mask`](xref:UnityEngine.InputSystem.InputControl) in which only bits for state that is __not__ noise are set. You can use this to efficiently mask out noise in input.
25+
26+
### Noise masks
27+
28+
Parallel to the [`input state`](xref:UnityEngine.InputSystem.InputControl.currentStatePtr) and the [`default state`](xref:UnityEngine.InputSystem.InputControl.defaultStatePtr) that the Input System keeps for all devices currently present, it also maintains a [`noise mask`](xref:UnityEngine.InputSystem.InputControl.noiseMaskPtr) in which only bits for state that is __not__ noise are set. This can be used to very efficiently mask out noise in input.

0 commit comments

Comments
 (0)