diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md
index a691fdd3c9..7a1dd94e81 100644
--- a/Packages/com.unity.inputsystem/CHANGELOG.md
+++ b/Packages/com.unity.inputsystem/CHANGELOG.md
@@ -430,7 +430,7 @@ however, it has to be formatted properly to pass verification tests.
- Fixed issue of visual elements being null during editing project-wide actions in project settings which prompted console errors.
- Fixed case ISX-1436 (UI TK Input Action Asset Editor - Error deleting Bindings with DeleteKey on Windows).
- Fixed issue with UI Toolkit based Input Action Editor not restoring it's selected items after Domain Reload.
-- Fixed the [`GetHapticCapabilitiesCommand`](xref:UnityEngine.InputSystem.XR.Haptics.GetHapticCapabilitiesCommand) always failing to execute due to a mismatch in the size in bytes of the payload and the size expected by XR devices. Changed [`HapticCapabilities`](xref:UnityEngine.InputSystem.XR.Haptics.HapticCapabilities) to include all properties returned by the XR input subsystem. This makes Input System match the functionality provided by the [XR](https://docs.unity3d.com/Manual/com.unity.modules.xr.html) module's [`InputDevice.TryGetHapticCapabilities`](https://docs.unity3d.com/ScriptReference/XR.InputDevice.TryGetHapticCapabilities.html) and [`HapticCapabilities`](https://docs.unity3d.com/ScriptReference/XR.HapticCapabilities.html).
+- Fixed the [`GetHapticCapabilitiesCommand`](xref:UnityEngine.InputSystem.XR.Haptics.GetHapticCapabilitiesCommand) always failing to execute due to a mismatch in the size in bytes of the payload and the size expected by XR devices. Changed [`HapticCapabilities`](xref:UnityEngine.InputSystem.XR.Haptics.HapticCapabilities) to include all properties returned by the XR input subsystem. This makes Input System match the functionality provided by the [XR](https://docs.unity3d.com/Manual/com.unity.modules.xr.html) module's [`InputDevice.TryGetHapticCapabilities`](xref:UnityEngine.XR.InputDevice.TryGetHapticCapabilities(UnityEngine.XR.HapticCapabilities&)) and [`HapticCapabilities`](xref:UnityEngine.XR.HapticCapabilities).
- Fixed issue where deleting a binding in the Input Action Editor would usually result in an unexpected item being selected next.
## [1.8.0-pre.1] - 2023-09-04
@@ -1866,7 +1866,8 @@ This release includes a number of Quality-of-Life improvements for a range of co
- **The system no longer supports processing input in __BOTH__ fixed and dynamic updates**. Instead, a choice has to be made whether to process input before each `FixedUpdate()` or before each `Update()`.
* Rationale: the existing code that supported having both updates receive input independently still had several holes and became increasingly complex and brittle. Our solution was based on not actually processing input twice but on channeling input concurrently into both the state of both updates. Together with the fact that specific inputs have to reset (and possibly accumulate) correctly with respect to their update time slices, this became increasingly hard to do right. This, together with the fact that we've come to increasingly question the value of this feature, led us to removing the capability while preserving the ability to determine where input is processed.
- * NOTE: Timeslicing is NOT affected by this. You can still switch to `ProcessEventInFixedUpdates` and get events timesliced to individual `FixedUpdate` periods according to their timestamps.
+ > [!NOTE]
+ > Timeslicing is NOT affected by this. You can still switch to `ProcessEventInFixedUpdates` and get events timesliced to individual `FixedUpdate` periods according to their timestamps.
* `InputSettings.UpdateMode.ProcessEventsInBothFixedAndDynamicUpdate` has been removed.
* `InputSettings.UpdateMode.ProcessEventsInDynamicUpdateOnly` has been renamed to `InputSettings.UpdateMode.ProcessEventsInDynamicUpdate` and is now the default.
* `InputSettings.UpdateMode.ProcessEventsInFixedUpdateOnly` has been renamed to `InputSettings.UpdateMode.ProcessEventsInFixedUpdate`.
@@ -2067,9 +2068,10 @@ This release includes a number of Quality-of-Life improvements for a range of co
## [0.2.6-preview] - 2019-03-20
->NOTE: The UI code for editing actions has largely been rewritten. There may be regressions.
->NOTE: The minimum version requirement for the new input system has been bumped
- to 2019.1
+> [!NOTE]
+> The UI code for editing actions has largely been rewritten. There may be regressions.
+>
+> The minimum version requirement for the new input system has been bumped to 2019.1
### Added
@@ -2147,7 +2149,8 @@ This release includes a number of Quality-of-Life improvements for a range of co
This release contains a number of fairly significant changes. The focus has been on further improving the action system to make it easier to use as well as to make it work more reliably and predictably.
->NOTE: There are some breaking changes. Please see the "Changed" section below.
+> [!NOTE]
+> There are some breaking changes. Please see the "Changed" section below.
### Changed
@@ -2283,10 +2286,11 @@ This release contains a number of fairly significant changes. The focus has been
## [0.1.2-preview] - 2018-12-19
- NOTE: The minimum version requirement for the new input system has been bumped
- to 2018.3. The previous minum requirement of 2018.2 is no longer supported.
- Also, we have dropped support for the .NET 3.5 runtime. The new .NET 4
- runtime is now required to use the new input system.
+> [!NOTE]
+> The minimum version requirement for the new input system has been bumped
+> to 2018.3. The previous minum requirement of 2018.2 is no longer supported.
+> Also, we have dropped support for the .NET 3.5 runtime. The new .NET 4
+> runtime is now required to use the new input system.
We've started working on documentation. The current work-in-progress can be found on [GitHub](https://github.com/Unity-Technologies/InputSystem/blob/develop/Packages/com.unity.inputsystem/Documentation~/InputSystem.md).
diff --git a/Packages/com.unity.inputsystem/Documentation~/ActionAssets.md b/Packages/com.unity.inputsystem/Documentation~/ActionAssets.md
index def2c2e5e5..4aa6c46d8b 100644
--- a/Packages/com.unity.inputsystem/Documentation~/ActionAssets.md
+++ b/Packages/com.unity.inputsystem/Documentation~/ActionAssets.md
@@ -3,27 +3,22 @@ uid: input-system-action-assets
---
# Input Action Assets
-- [Creating Input Action Assets](#creating-input-action-assets)
-- [Editing Input Action Assets](#editing-input-action-assets)
-- [Using Input Action Assets](#using-input-action-assets)
-- [Type-safe C# API Generation](#type-safe-c-api-generation)
+An Input Action Asset is an Asset which contains a set of [Input Actions](xref:input-system-actions) definitions and their associated [Bindings](xref:input-system-action-bindings) and [Control Schemes](xref:input-system-action-bindings#control-schemes). These Assets have the `.inputactions` file extension and are stored in a plain JSON format.
-An Input Action Asset is an Asset which contains a set of [Input Actions](Actions.md) definitions and their associated [Bindings](ActionBindings.md) and [Control Schemes](ActionBindings.md#control-schemes). These Assets have the `.inputactions` file extension and are stored in a plain JSON format.
-
-The input system creates an Action Asset when you set up the [default project-wide actions](ProjectWideActions.md), but you can also create new Action Assets directly in the Project window.
+The input system creates an Action Asset when you set up the [default project-wide actions](xref:project-wide-actions), but you can also create new Action Assets directly in the Project window.
For most common scenarios, you do not need to use more than one Input Action Asset. It is usually simpler to configure your project-wide action definition in the Project Settings window.
## Creating Input Action Assets
-To create an Asset that contains [Input Actions](Actions.md) in Unity, right-click in the __Project__ window or go to __Assets > Create > Input Actions__ from Unity's main menu.
+To create an Asset that contains [Input Actions](xref:input-system-actions) in Unity, right-click in the __Project__ window or go to __Assets > Create > Input Actions__ from Unity's main menu.
## Editing Input Action Assets
To bring up the Action editor, double-click an `.inputactions` Asset in the Project Browser, or select the __Edit Asset__ button in the Inspector for that Asset. You can have more than one editor window open at the same time, but not for the same Asset.
-The Actions Editor which opens is identical to the [Actions Editor in the Project Settings window](ActionsEditor.md).
+The Actions Editor which opens is identical to the [Actions Editor in the Project Settings window](xref:input-system-configuring-input).
## Using Input Action Assets
@@ -90,21 +85,22 @@ public class MyPlayerScript : MonoBehaviour, IGameplayActions
}
```
->__Note__: To regenerate the .cs file, right-click the .inputactions asset in the Project Browser and choose "Reimport".
+> [!NOTE]
+> To regenerate the .cs file, right-click the .inputactions asset in the Project Browser and choose "Reimport".
### Using Action Assets with `PlayerInput`
-The [Player Input](PlayerInput.md) component provides a convenient way to handle input for one or multiple players. You can assign your Action Asset to the Player Input component so that it can then automatically handle activating Action Maps and selecting Control Schemes for you.
+The [Player Input](xref:input-system-player-input) component provides a convenient way to handle input for one or multiple players. You can assign your Action Asset to the Player Input component so that it can then automatically handle activating Action Maps and selecting Control Schemes for you.

### Modifying Input Action Assets at runtime
-There are several ways to modify an Input Action Asset at runtime. Any modifications that you make during Play mode to an Input Action Asset do not persist in the Input Action Asset after you exit Play mode. This means you can test your application in a realistic manner in the Editor without having to worry about inadvertently modifying the asset. For examples on how to modify an Input Action Asset, see the documentation on [Creating Actions in code](Actions.md#creating-actions-in-code) and [Changing Bindings](ActionBindings.md#changing-bindings).
+There are several ways to modify an Input Action Asset at runtime. Any modifications that you make during Play mode to an Input Action Asset do not persist in the Input Action Asset after you exit Play mode. This means you can test your application in a realistic manner in the Editor without having to worry about inadvertently modifying the asset. For examples on how to modify an Input Action Asset, see the documentation on [Creating Actions in code](xref:input-system-actions#creating-actions-in-code) and [Changing Bindings](xref:input-system-action-bindings#changing-bindings).
### The Default Actions Asset
-An asset called `DefaultInputActions.inputactions` containing a default setup of Actions comes with the Input System Package. You can reference this asset directly in your projects like any other Unity asset. However, the asset is also available in code form through the [`DefaultInputActions`](../api/UnityEngine.InputSystem.DefaultInputActions.html) class.
+An asset called `DefaultInputActions.inputactions` containing a default setup of Actions comes with the Input System Package. You can reference this asset directly in your projects like any other Unity asset. However, the asset is also available in code form through the [`DefaultInputActions`](xref:UnityEngine.InputSystem.DefaultInputActions) class.
```CSharp
void Start()
@@ -117,4 +113,5 @@ void Start()
}
```
-> __Note:__ This default actions asset is older than, and entirely separate from the [default project-wide actions](ProjectWideActions.md). It is a legacy asset that remains included in the package for backward compatibility.
+> [!NOTE]
+> This default actions asset is older than, and entirely separate from the [default project-wide actions](xref:project-wide-actions). It is a legacy asset that remains included in the package for backward compatibility.
diff --git a/Packages/com.unity.inputsystem/Documentation~/ActionBindings.md b/Packages/com.unity.inputsystem/Documentation~/ActionBindings.md
index dfbcfe49be..238c04ad29 100644
--- a/Packages/com.unity.inputsystem/Documentation~/ActionBindings.md
+++ b/Packages/com.unity.inputsystem/Documentation~/ActionBindings.md
@@ -3,70 +3,46 @@ uid: input-system-action-bindings
---
# Input Bindings
-* [Composite Bindings](#composite-bindings)
- * [1D Axis](#1d-axis)
- * [2D Vector](#2d-vector)
- * [3D Vector](#3d-vector)
- * [One Modifier](#one-modifier)
- * [Two Modifiers](#two-modifiers)
- * [Writing custom Composites](#writing-custom-composites)
-* [Working with Bindings](#working-with-bindings)
- * [Looking up Bindings](#looking-up-bindings)
- * [Changing Bindings](#changing-bindings)
- * [Applying overrides](#applying-overrides)
- * [Erasing Bindings](#erasing-bindings)
- * [Adding Bindings](#adding-bindings)
- * [Setting parameters](#setting-parameters)
- * [Interactive rebinding](#interactive-rebinding)
- * [Saving and loading rebinds](#saving-and-loading-rebinds)
- * [Restoring original Bindings](#restoring-original-bindings)
- * [Displaying Bindings](#displaying-bindings)
-* [Control schemes](#control-schemes)
-* [Details](#details)
- * [Binding resolution](#binding-resolution)
- * [Binding resolution while Actions are enabled](#binding-resolution-while-actions-are-enabled)
- * [Choosing which Devices to use](#choosing-which-devices-to-use)
- * [Conflicting inputs](#conflicting-inputs)
- * [Initial state check](#initial-state-check)
-
-An [`InputBinding`](../api/UnityEngine.InputSystem.InputBinding.html) represents a connection between an [Action](Actions.md) and one or more [Controls](Controls.md) identified by a [Control path](Controls.md#control-paths). For example, the **right trigger** of a gamepad (a control) might be bound to an an action named "accelerate", so that pulling the right trigger causes a car to accelerate in your game.
-
-You can add multiple bindings to an action, which is generally useful for supporting multiple types of input device. For example, in the default set of actions, the "Move" action has a binding to the left gamepad stick and the WSAD keys, which means input through any of these bindings will perform the action.
+An [`InputBinding`](xref:UnityEngine.InputSystem.InputBinding) represents a connection between an [Action](xref:input-system-actions) and one or more [Controls](xref:input-system-controls) identified by a [Control path](xref:input-system-controls#control-paths). For example, the right trigger of a gamepad (a control) might be bound to an an action named "accelerate", so that pulling the right trigger causes a car to accelerate in your game.
+
+You can add multiple bindings to an action, which is generally useful for supporting multiple types of input device. For example, in the default set of actions, the "Move" action has a binding to the left gamepad stick and the WASD keys, which means input through any of these bindings will perform the action.
You can also bind multiple controls from the same device to an action. For example, both the left and right trigger of a gamepad could be mapped to the same action, so that pulling either trigger has the same result in your game.
-
-_The default "Move" action in the Actions Editor window, displaying the multiple bindings associated with it._
+You can also set up [Composite](#composite-bindings) bindings, which don't bind to the controls themselves, but receive their input from **Part Bindings** and then return a value representing a composition of those inputs. For example, the right trigger on the gamepad can act as a strength multiplier on the value of the left stick.
+## InputBinding API access
-Each Binding has the following properties:
+Each `InputBinding` has the following properties:
|Property|Description|
|--------|-----------|
-|[`path`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_path)|[Control path](Controls.md#control-paths) that identifies the control(s) from which the Action should receive input. Example: `"/leftStick"`|
-|[`overridePath`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_overridePath)|[Control path](Controls.md#control-paths) that overrides `path`. Unlike `path`, `overridePath` is not persistent, so you can use it to non-destructively override the path on a Binding. If it is set to something other than null, it takes effect and overrides `path`. To get the path which is currently in effect (that is, either `path` or `overridePath`), you can query the [`effectivePath`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_effectivePath) property.|
-|[`action`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_action)|The name or ID of the Action that the Binding should trigger. Note that this can be null or empty (for instance, for [composites](#composite-bindings)). Not case-sensitive. Example: `"fire"`|
-|[`groups`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_groups)|A semicolon-separated list of Binding groups that the Binding belongs to. Can be null or empty. Binding groups can be anything, but are mostly used for [Control Schemes](#control-schemes). Not case-sensitive. Example: `"Keyboard&Mouse;Gamepad"`|
-|[`interactions`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_interactions)|A semicolon-separated list of [Interactions](Interactions.md) to apply to input on this Binding. Note that Unity appends Interactions applied to the [Action](Actions.md) itself (if any) to this list. Not case-sensitive. Example: `"slowTap;hold(duration=0.75)"`|
-|[`processors`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_processors)|A semicolon-separated list of [Processors](UsingProcessors.md) to apply to input on this Binding. Note that Unity appends Processors applied to the [Action](Actions.md) itself (if any) to this list. Not case-sensitive. Processors on Bindings apply in addition to Processors on Controls that are providing values. For example, if you put a `stickDeadzone` Processor on a Binding and then bind it to `/leftStick`, you get deadzones applied twice: once from the deadzone Processor sitting on the `leftStick` Control, and once from the Binding. Example: `"invert;axisDeadzone(min=0.1,max=0.95)"`|
-|[`id`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_id)|Unique ID of the Binding. You can use it to identify the Binding when storing Binding overrides in user settings, for example.|
-|[`name`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_name)|Optional name of the Binding. Identifies part names inside [Composites](#composite-bindings). Example: `"Positive"`|
-|[`isComposite`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_isComposite)|Whether the Binding acts as a [Composite](#composite-bindings).|
-|[`isPartOfComposite`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_isPartOfComposite)|Whether the Binding is part of a [Composite](#composite-bindings).|
-
-To query the Bindings to a particular Action, you can use [`InputAction.bindings`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_bindings). To query a flat list of Bindings for all Actions in an Action Map, you can use [`InputActionMap.bindings`](../api/UnityEngine.InputSystem.InputActionMap.html#UnityEngine_InputSystem_InputActionMap_bindings).
+|[`path`](xref:UnityEngine.InputSystem.InputBinding.path)|[Control path](xref:input-system-controls#control-paths) that identifies the control(s) from which the Action should receive input. Example: `"/leftStick"`|
+|[`overridePath`](xref:UnityEngine.InputSystem.InputBinding.overridePath)|[Control path](xref:input-system-controls#control-paths) that overrides `path`. Unlike `path`, `overridePath` is not persistent, so you can use it to non-destructively override the path on a Binding. If it is set to something other than null, it takes effect and overrides `path`. To get the path which is currently in effect (that is, either `path` or `overridePath`), you can query the [`effectivePath`](xref:UnityEngine.InputSystem.InputBinding.effectivePath) property.|
+|[`action`](xref:UnityEngine.InputSystem.InputBinding.action)|The name or ID of the Action that the Binding should trigger. Note that this can be null or empty (for instance, for [composites](#composite-bindings)). Not case-sensitive. Example: `"fire"`|
+|[`groups`](xref:UnityEngine.InputSystem.InputBinding.groups)|A semicolon-separated list of Binding groups that the Binding belongs to. Can be null or empty. Binding groups can be anything, but are mostly used for [Control Schemes](#control-schemes). Not case-sensitive. Example: `"Keyboard&Mouse;Gamepad"`|
+|[`interactions`](xref:UnityEngine.InputSystem.InputBinding.interactions)|A semicolon-separated list of [Interactions](xref:input-system-interactions) to apply to input on this Binding. Note that Unity appends Interactions applied to the [Action](xref:input-system-actions) itself (if any) to this list. Not case-sensitive. Example: `"slowTap;hold(duration=0.75)"`|
+|[`processors`](xref:UnityEngine.InputSystem.InputBinding.processors)|A semicolon-separated list of [Processors](UsingProcessors.md) to apply to input on this Binding. Note that Unity appends Processors applied to the [Action](xref:input-system-actions) itself (if any) to this list. Not case-sensitive. Processors on Bindings apply in addition to Processors on Controls that are providing values. For example, if you put a `stickDeadzone` Processor on a Binding and then bind it to `/leftStick`, you get deadzones applied twice: once from the deadzone Processor sitting on the `leftStick` Control, and once from the Binding. Example: `"invert;axisDeadzone(min=0.1,max=0.95)"`|
+|[`id`](xref:UnityEngine.InputSystem.InputBinding.id)|Unique ID of the Binding. You can use it to identify the Binding when storing Binding overrides in user settings, for example.|
+|[`name`](xref:UnityEngine.InputSystem.InputBinding.name)|Optional name of the Binding. Identifies part names inside [Composites](#composite-bindings). Example: `"Positive"`|
+|[`isComposite`](xref:UnityEngine.InputSystem.InputBinding.isComposite)|Whether the Binding acts as a [Composite](#composite-bindings).|
+|[`isPartOfComposite`](xref:UnityEngine.InputSystem.InputBinding.isPartOfComposite)|Whether the Binding is part of a [Composite](#composite-bindings).|
+
+To query the Bindings for a specific Action, use [`InputAction.bindings`](xref:UnityEngine.InputSystem.InputAction.bindings).
+
+To query a flat list of Bindings for all Actions in an Action Map, use [`InputActionMap.bindings`](xref:UnityEngine.InputSystem.InputActionMap.bindings).
## Composite Bindings
-Sometimes, you might want to have several Controls act in unison to mimic a different type of Control. The most common example of this is using the W, A, S, and D keys on the keyboard to form a 2D vector Control equivalent to mouse deltas or gamepad sticks. Another example is to use two keys to form a 1D axis equivalent to a mouse scroll axis.
+You might want to have several Controls act in unison to mimic a different type of Control. The most common example of this is using the W, A, S, and D keys on the keyboard to form a 2D vector Control equivalent to mouse deltas or gamepad sticks. Another example is to use two keys to form a 1D axis equivalent to a mouse scroll axis.
-This is difficult to implement with normal Bindings. You can bind a [`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html) to an action expecting a `Vector2`, but doing so results in an exception at runtime when the Input System tries to read a `Vector2` from a Control that can deliver only a `float`.
+This is difficult to implement with normal Bindings. You can bind a [`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl) to an action expecting a `Vector2`, but doing so results in an exception at runtime when the Input System tries to read a `Vector2` from a Control that can deliver only a `float`.
Composite Bindings (that is, Bindings that are made up of other Bindings) solve this problem. Composites themselves don't bind directly to Controls; instead, they source values from other Bindings that do, and then synthesize input on the fly from those values.
-To see how to create Composites in the editor UI, see documentation on [editing Composite Bindings](ActionsEditor.md#editing-composite-bindings).
+To see how to create Composites in the editor UI, refer to [Editing Composite Bindings](xref:input-system-configuring-input#editing-composite-bindings).
-To create composites in code, you can use the [`AddCompositeBinding`](../api/UnityEngine.InputSystem.InputActionSetupExtensions.html#UnityEngine_InputSystem_InputActionSetupExtensions_AddCompositeBinding_UnityEngine_InputSystem_InputAction_System_String_System_String_System_String_) syntax.
+To create composites in code, use the [`AddCompositeBinding`](xref:UnityEngine.InputSystem.InputActionSetupExtensions.AddCompositeBinding(UnityEngine.InputSystem.InputAction,System.String,System.String,System.String)) method:
```CSharp
myAction.AddCompositeBinding("Axis")
@@ -74,7 +50,7 @@ myAction.AddCompositeBinding("Axis")
.With("Negative", "/leftTrigger");
```
-Each Composite consists of one Binding that has [`InputBinding.isComposite`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_isComposite) set to true, followed by one or more Bindings that have [`InputBinding.isPartOfComposite`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_isPartOfComposite) set to true. In other words, several consecutive entries in [`InputActionMap.bindings`](../api/UnityEngine.InputSystem.InputActionMap.html#UnityEngine_InputSystem_InputActionMap_bindings) or [`InputAction.bindings`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_bindings) together form a Composite.
+Each Composite consists of one Binding that has [`InputBinding.isComposite`](xref:UnityEngine.InputSystem.InputBinding.isComposite) set to true, followed by one or more Bindings that have [`InputBinding.isPartOfComposite`](xref:UnityEngine.InputSystem.InputBinding.isPartOfComposite) set to true. In other words, several consecutive entries in [`InputActionMap.bindings`](xref:UnityEngine.InputSystem.InputActionMap.bindings) or [`InputAction.bindings`](xref:UnityEngine.InputSystem.InputAction.bindings) together form a Composite.
Note that each composite part can be bound arbitrary many times.
@@ -87,21 +63,30 @@ myAction.AddCompositeBinding("Axis")
.With("Negative", "/leftShoulder");
```
-Composites can have parameters, just like [Interactions](Interactions.md) and [Processors](UsingProcessors.md).
+Composites can have parameters, just like [Interactions](xref:input-system-interactions) and [Processors](UsingProcessors.md).
```CSharp
myAction.AddCompositeBinding("Axis(whichSideWins=1)");
```
-There are currently five Composite types that come with the system out of the box: [1D-Axis](#1d-axis), [2D-Vector](#2d-vector), [3D-Vector](#3d-vector), [One Modifier](#one-modifier) and [Two Modifiers](#two-modifiers). Additionally, you can [add your own](#writing-custom-composites) types of Composites.
+There are currently five Composite types that come with the system out of the box:
+
+- [1D-Axis](#1d-axis): two buttons that pull a 1D axis in the negative and positive direction.
+- [2D-Vector](#2d-vector): represents a 4-way button setup where each button represents a cardinal direction, for example a WASD keyboard input (up-down-left-right controls).
+- [3D-Vector](#3d-vector): represents a 6-way button where two combinations each control one axis of a 3D Vector.
+- [One Modifier](#one-modifier): requires the user to hold down a "modifier" button in addition to another control, for example, "SHIFT+1".
+- [Two Modifiers](#two-modifiers): requires the user to hold down two "modifier" buttons in addition to another control, for example, "SHIFT+CTRL+1".
+
+You can also [add your own](#writing-custom-composites) types of Composites.
+
+### 1D Axis
-### 1D axis
+{width="486" height="133"}
-
+{width="486" height="142"}
-
-A Composite made of two buttons: one that pulls a 1D axis in its negative direction, and another that pulls it in its positive direction. Implemented in the [`AxisComposite`](../api/UnityEngine.InputSystem.Composites.AxisComposite.html) class. The result is a `float`.
+The 1D Axis Composite is made of two buttons: one that pulls a 1D axis in its negative direction, and another that pulls it in its positive direction, using the [`AxisComposite`](xref:UnityEngine.InputSystem.Composites.AxisComposite) class to compute a `float`.
```CSharp
myAction.AddCompositeBinding("1DAxis") // Or just "Axis"
@@ -109,40 +94,41 @@ myAction.AddCompositeBinding("1DAxis") // Or just "Axis"
.With("Negative", "/leftTrigger");
```
-The axis Composite has two part bindings.
+The axis Composite has two Part Bindings:
-|Part|Type|Description|
+|Part Binding|Type|Description|
|----|----|-----------|
-|[`positive`](../api/UnityEngine.InputSystem.Composites.AxisComposite.html#UnityEngine_InputSystem_Composites_AxisComposite_positive)|`Button`|Controls pulling in the positive direction (towards [`maxValue`](../api/UnityEngine.InputSystem.Composites.AxisComposite.html#UnityEngine_InputSystem_Composites_AxisComposite_maxValue)).|
-|[`negative`](../api/UnityEngine.InputSystem.Composites.AxisComposite.html#UnityEngine_InputSystem_Composites_AxisComposite_negative)|`Button`|Controls pulling in the negative direction, (towards [`minValue`](../api/UnityEngine.InputSystem.Composites.AxisComposite.html#UnityEngine_InputSystem_Composites_AxisComposite_minValue)).|
+|[`positive`](xref:UnityEngine.InputSystem.Composites.AxisComposite.positive)|`Button`|Controls pulling in the positive direction (towards [`maxValue`](xref:UnityEngine.InputSystem.Composites.AxisComposite.maxValue)).|
+|[`negative`](xref:UnityEngine.InputSystem.Composites.AxisComposite.negative)|`Button`|Controls pulling in the negative direction, (towards [`minValue`](xref:UnityEngine.InputSystem.Composites.AxisComposite.minValue)).|
You can set the following parameters on an axis Composite:
|Parameter|Description|
|---------|-----------|
-|[`whichSideWins`](../api/UnityEngine.InputSystem.Composites.AxisComposite.html#UnityEngine_InputSystem_Composites_AxisComposite_whichSideWins)|What happens if both [`positive`](../api/UnityEngine.InputSystem.Composites.AxisComposite.html#UnityEngine_InputSystem_Composites_AxisComposite_positive) and [`negative`](../api/UnityEngine.InputSystem.Composites.AxisComposite.html#UnityEngine_InputSystem_Composites_AxisComposite_negative) are actuated. See table below.|
-|[`minValue`](../api/UnityEngine.InputSystem.Composites.AxisComposite.html#UnityEngine_InputSystem_Composites_AxisComposite_minValue)|The value returned if the [`negative`](../api/UnityEngine.InputSystem.Composites.AxisComposite.html#UnityEngine_InputSystem_Composites_AxisComposite_negative) side is actuated. Default is -1.|
-|[`maxValue`](../api/UnityEngine.InputSystem.Composites.AxisComposite.html#UnityEngine_InputSystem_Composites_AxisComposite_maxValue)|The value returned if the [`positive`](../api/UnityEngine.InputSystem.Composites.AxisComposite.html#UnityEngine_InputSystem_Composites_AxisComposite_positive) side is actuated. Default is 1.|
+|[`whichSideWins`](xref:UnityEngine.InputSystem.Composites.AxisComposite.whichSideWins)|What happens if both [`positive`](xref:UnityEngine.InputSystem.Composites.AxisComposite.positive) and [`negative`](xref:UnityEngine.InputSystem.Composites.AxisComposite.negative) are actuated. See table below.|
+|[`minValue`](xref:UnityEngine.InputSystem.Composites.AxisComposite.minValue)|The value returned if the [`negative`](xref:UnityEngine.InputSystem.Composites.AxisComposite.negative) side is actuated. Default is -1.|
+|[`maxValue`](xref:UnityEngine.InputSystem.Composites.AxisComposite.maxValue)|The value returned if the [`positive`](xref:UnityEngine.InputSystem.Composites.AxisComposite.positive) side is actuated. Default is 1.|
If Controls from both the `positive` and the `negative` side are actuated, then the resulting value of the axis Composite depends on the `whichSideWin` parameter setting.
-|[`WhichSideWins`](../api/UnityEngine.InputSystem.Composites.AxisComposite.WhichSideWins.html)|Description|
-|---------------|-----------|
-|(0) `Neither`|Neither side has precedence. The Composite returns the midpoint between `minValue` and `maxValue` as a result. At their default settings, this is 0. This is the default value for this setting.|
-|(1) `Positive`|The positive side has precedence and the Composite returns `maxValue`.|
-|(2) `Negative`|The negative side has precedence and the Composite returns `minValue`.|
+| [`WhichSideWins`](xref:UnityEngine.InputSystem.Composites.AxisComposite.WhichSideWins) | Description |
+| ------------------------------------------------------------ | ------------------------------------------------------------ |
+| (0) `Neither` | Neither side has precedence. The Composite returns the [`midpoint`](xref:UnityEngine.InputSystem.Composites.AxisComposite.midPoint) between `minValue` and `maxValue` as a result. At their default settings, this is 0. This is the default value for this setting. |
+| (1) `Positive` | The positive side has precedence and the Composite returns `maxValue`. |
+| (2) `Negative` | The negative side has precedence and the Composite returns `minValue`. |
->__Note__: There is no support yet for interpolating between the positive and negative over time.
+> [!NOTE]
+> There is no support yet for interpolating between the positive and negative over time.
-### 2D vector
+### 2D Vector
-
+{width="486" height="199"}
-
+{width="486" height="178"}
-A Composite that represents a 4-way button setup like the D-pad on gamepads. Each button represents a cardinal direction. Implemented in the [`Vector2Composite`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.html) class. The result is a `Vector2`.
+A 2D Vector Composite represents a 4-way button setup like the D-pad on gamepads, where each button represents a cardinal direction. This type of Composite binding uses the [`Vector2Composite`](xref:UnityEngine.InputSystem.Composites.Vector2Composite) class to compute a `Vector2`.
-This Composite is most useful for representing up-down-left-right controls, such as WASD keyboard input.
+This is very useful for representing up-down-left-right controls, such as WASD keyboard input.
```CSharp
myAction.AddCompositeBinding("2DVector") // Or "Dpad"
@@ -159,30 +145,33 @@ myAction.AddCompositeBinding("2DVector(mode=2)")
.With("Right", "/leftStick/right");
```
-The 2D vector Composite has four part Bindings.
+The 2D Vector Composite has four Part Bindings.
-|Part|Type|Description|
+|Part Binding|Type|Description|
|----|----|-----------|
-|[`up`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.html#UnityEngine_InputSystem_Composites_Vector2Composite_up)|`Button`|Controls representing `(0,1)` (+Y).|
-|[`down`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.html#UnityEngine_InputSystem_Composites_Vector2Composite_down)|`Button`|Controls representing `(0,-1)` (-Y).|
-|[`left`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.html#UnityEngine_InputSystem_Composites_Vector2Composite_left)|`Button`|Controls representing `(-1,0)` (-X).|
-|[`right`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.html#UnityEngine_InputSystem_Composites_Vector2Composite_right)|`Button`|Controls representing `(1,0)` (+X).|
+|[`up`](xref:UnityEngine.InputSystem.Composites.Vector2Composite.up)|`Button`|Controls representing `(0,1)` (+Y).|
+|[`down`](xref:UnityEngine.InputSystem.Composites.Vector2Composite.down)|`Button`|Controls representing `(0,-1)` (-Y).|
+|[`left`](xref:UnityEngine.InputSystem.Composites.Vector2Composite.left)|`Button`|Controls representing `(-1,0)` (-X).|
+|[`right`](xref:UnityEngine.InputSystem.Composites.Vector2Composite.right)|`Button`|Controls representing `(1,0)` (+X).|
-In addition, you can set the following parameters on a 2D vector Composite:
+In addition, you can set this parameter on a 2D Vector Composite:
|Parameter|Description|
|---------|-----------|
-|[`mode`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.html#UnityEngine_InputSystem_Composites_Vector2Composite_mode)|Whether to treat the inputs as digital or as analog controls. If this is set to [`Mode.DigitalNormalized`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.Mode.html#UnityEngine_InputSystem_Composites_Vector2Composite_Mode_DigitalNormalized), inputs are treated as buttons (off if below [`defaultButtonPressPoint`](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_defaultButtonPressPoint) and on if equal to or greater). Each input is 0 or 1 depending on whether the button is pressed or not. The vector resulting from the up/down/left/right parts is normalized. The result is a diamond-shaped 2D input range. If this is set to [`Mode.Digital`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.Mode.html#UnityEngine_InputSystem_Composites_Vector2Composite_Mode_Digital), the behavior is essentially the same as [`Mode.DigitalNormalized`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.Mode.html#UnityEngine_InputSystem_Composites_Vector2Composite_Mode_DigitalNormalized) except that the resulting vector is not normalized. Finally, if this is set to [`Mode.Analog`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.Mode.html#UnityEngine_InputSystem_Composites_Vector2Composite_Mode_Analog), inputs are treated as analog (i.e. full floating-point values) and, other than [`down`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.html#UnityEngine_InputSystem_Composites_Vector2Composite_down) and [`left`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.html#UnityEngine_InputSystem_Composites_Vector2Composite_left) being inverted, values will be passed through as is. The default is [`Mode.DigitalNormalized`](../api/UnityEngine.InputSystem.Composites.Vector2Composite.Mode.html#UnityEngine_InputSystem_Composites_Vector2Composite_Mode_DigitalNormalized).|
+|[`mode`](xref:UnityEngine.InputSystem.Composites.Vector2Composite.mode)|Whether to treat the inputs as digital or as analog controls. If this is set to [`Mode.DigitalNormalized`](xref:UnityEngine.InputSystem.Composites.Vector2Composite.Mode.DigitalNormalized), inputs are treated as buttons (off if below [`defaultButtonPressPoint`](xref:UnityEngine.InputSystem.InputSettings.defaultButtonPressPoint) and on if equal to or greater). Each input is 0 or 1 depending on whether the button is pressed or not. The vector resulting from the up/down/left/right parts is normalized. The result is a diamond-shaped 2D input range. If this is set to [`Mode.Digital`](xref:UnityEngine.InputSystem.Composites.Vector2Composite.Mode.Digital), the behavior is essentially the same as [`Mode.DigitalNormalized`](xref:UnityEngine.InputSystem.Composites.Vector2Composite.Mode.DigitalNormalized) except that the resulting vector is not normalized. Finally, if this is set to [`Mode.Analog`](xref:UnityEngine.InputSystem.Composites.Vector2Composite.Mode.Analog), inputs are treated as analog (i.e. full floating-point values) and, other than [`down`](xref:UnityEngine.InputSystem.Composites.Vector2Composite.down) and [`left`](xref:UnityEngine.InputSystem.Composites.Vector2Composite.left) being inverted, values will be passed through as is. The default is [`Mode.DigitalNormalized`](xref:UnityEngine.InputSystem.Composites.Vector2Composite.Mode.DigitalNormalized).|
->__Note__: There is no support yet for interpolating between the up/down/left/right over time.
+> [!NOTE]
+> There is no support yet for interpolating between the up/down/left/right over time.
-### 3D vector
+### 3D Vector
-
-
+{width="486" height="150"}
-A Composite that represents a 6-way button where two combinations each control one axis of a 3D vector. Implemented in the [`Vector3Composite`](../api/UnityEngine.InputSystem.Composites.Vector3Composite.html) class. The result is a `Vector3`.
+{width="486" height="259"
+}
+
+A 3D Vector Composite that represents a 6-way button where two combinations each control one axis of a 3D Vector. This type of Composite binding uses the the [`Vector3Composite`](xref:UnityEngine.InputSystem.Composites.Vector3Composite) class to compute a `Vector3`.
```CSharp
myAction.AddCompositeBinding("3DVector")
@@ -199,32 +188,33 @@ myAction.AddCompositeBinding("3DVector(mode=2)")
.With("Right", "/leftStick/right");
```
-The 3D vector Composite has four part Bindings.
+The 3D Vector Composite has four Part Bindings.
-|Part|Type|Description|
+|Part Binding|Type|Description|
|----|----|-----------|
-|[`up`](../api/UnityEngine.InputSystem.Composites.Vector3Composite.html#UnityEngine_InputSystem_Composites_Vector3Composite_up)|`Button`|Controls representing `(0,1,0)` (+Y).|
-|[`down`](../api/UnityEngine.InputSystem.Composites.Vector3Composite.html#UnityEngine_InputSystem_Composites_Vector3Composite_down)|`Button`|Controls representing `(0,-1,0)` (-Y).|
-|[`left`](../api/UnityEngine.InputSystem.Composites.Vector3Composite.html#UnityEngine_InputSystem_Composites_Vector3Composite_left)|`Button`|Controls representing `(-1,0,0)` (-X).|
-|[`right`](../api/UnityEngine.InputSystem.Composites.Vector3Composite.html#UnityEngine_InputSystem_Composites_Vector3Composite_right)|`Button`|Controls representing `(1,0,0)` (+X).|
-|[`forward`](../api/UnityEngine.InputSystem.Composites.Vector3Composite.html#UnityEngine_InputSystem_Composites_Vector3Composite_forward)|`Button`|Controls representing `(0,0,1)` (+Z).|
-|[`backward`](../api/UnityEngine.InputSystem.Composites.Vector3Composite.html#UnityEngine_InputSystem_Composites_Vector3Composite_backward)|`Button`|Controls representing `(0,0,-1)` (-Z).|
+|[`up`](xref:UnityEngine.InputSystem.Composites.Vector3Composite.up)|`Button`|Controls representing `(0,1,0)` (+Y).|
+|[`down`](xref:UnityEngine.InputSystem.Composites.Vector3Composite.down)|`Button`|Controls representing `(0,-1,0)` (-Y).|
+|[`left`](xref:UnityEngine.InputSystem.Composites.Vector3Composite.left)|`Button`|Controls representing `(-1,0,0)` (-X).|
+|[`right`](xref:UnityEngine.InputSystem.Composites.Vector3Composite.right)|`Button`|Controls representing `(1,0,0)` (+X).|
+|[`forward`](xref:UnityEngine.InputSystem.Composites.Vector3Composite.forward)|`Button`|Controls representing `(0,0,1)` (+Z).|
+|[`backward`](xref:UnityEngine.InputSystem.Composites.Vector3Composite.backward)|`Button`|Controls representing `(0,0,-1)` (-Z).|
In addition, you can set the following parameters on a 3D vector Composite:
|Parameter|Description|
|---------|-----------|
-|[`mode`](../api/UnityEngine.InputSystem.Composites.Vector3Composite.html#UnityEngine_InputSystem_Composites_Vector3Composite_mode)|Whether to treat the inputs as digital or as analog controls. If this is set to [`Mode.DigitalNormalized`](../api/UnityEngine.InputSystem.Composites.Vector3Composite.Mode.html#UnityEngine_InputSystem_Composites_Vector3Composite_Mode_DigitalNormalized), inputs are treated as buttons (off if below [`defaultButtonPressPoint`](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_defaultButtonPressPoint) and on if equal to or greater). Each input is 0 or 1 depending on whether the button is pressed or not. The vector resulting from the up/down/left/right/forward/backward parts is normalized. If this is set to [`Mode.Digital`](../api/UnityEngine.InputSystem.Composites.Vector3Composite.Mode.html#UnityEngine_InputSystem_Composites_Vector3Composite_Mode_Digital), the behavior is essentially the same as [`Mode.DigitalNormalized`](../api/UnityEngine.InputSystem.Composites.Vector3Composite.Mode.html#UnityEngine_InputSystem_Composites_Vector3Composite_Mode_DigitalNormalized) except that the resulting vector is not normalized. Finally, if this is set to [`Mode.Analog`](../api/UnityEngine.InputSystem.Composites.Vector3Composite.Mode.html#UnityEngine_InputSystem_Composites_Vector3Composite_Mode_Analog), inputs are treated as analog (that is, full floating-point values) and, other than [`down`](../api/UnityEngine.InputSystem.Composites.Vector3Composite.html#UnityEngine_InputSystem_Composites_Vector3Composite_down), [`left`](../api/UnityEngine.InputSystem.Composites.Vector3Composite.html#UnityEngine_InputSystem_Composites_Vector3Composite_left), and [`backward`](../api/UnityEngine.InputSystem.Composites.Vector3Composite.html#UnityEngine_InputSystem_Composites_Vector3Composite_backward) being inverted, values will be passed through as they are. The default is [`Analog`](../api/UnityEngine.InputSystem.Composites.Vector3Composite.Mode.html#UnityEngine_InputSystem_Composites_Vector3Composite_Mode_Analog).|
+|[`mode`](xref:UnityEngine.InputSystem.Composites.Vector3Composite.mode)|Whether to treat the inputs as digital or as analog controls. If this is set to [`Mode.DigitalNormalized`](xref:UnityEngine.InputSystem.Composites.Vector3Composite.Mode.DigitalNormalized), inputs are treated as buttons (off if below [`defaultButtonPressPoint`](xref:UnityEngine.InputSystem.InputSettings.defaultButtonPressPoint) and on if equal to or greater). Each input is 0 or 1 depending on whether the button is pressed or not. The vector resulting from the up/down/left/right/forward/backward parts is normalized. If this is set to [`Mode.Digital`](xref:UnityEngine.InputSystem.Composites.Vector3Composite.Mode.Digital), the behavior is essentially the same as [`Mode.DigitalNormalized`](xref:UnityEngine.InputSystem.Composites.Vector3Composite.Mode.DigitalNormalized) except that the resulting vector is not normalized. Finally, if this is set to [`Mode.Analog`](xref:UnityEngine.InputSystem.Composites.Vector3Composite.Mode.Analog), inputs are treated as analog (that is, full floating-point values) and, other than [`down`](xref:UnityEngine.InputSystem.Composites.Vector3Composite.down), [`left`](xref:UnityEngine.InputSystem.Composites.Vector3Composite.left), and [`backward`](xref:UnityEngine.InputSystem.Composites.Vector3Composite.backward) being inverted, values will be passed through as they are. The default is [`Analog`](xref:UnityEngine.InputSystem.Composites.Vector3Composite.Mode.Analog).|
### One Modifier
-
-
+{width="486" height="129"}
+
+{width="486" height="147"}
-A Composite that requires the user to hold down a "modifier" button in addition to another control from which the actual value of the Binding is determined. This can be used, for example, for Bindings such as "SHIFT+1". Implemented in the [`OneModifierComposite`](../api/UnityEngine.InputSystem.Composites.OneModifierComposite.html) class. The buttons can be on any Device, and can be toggle buttons or full-range buttons such as gamepad triggers.
+A One Modifier Composite requires the user to hold down a "modifier" button in addition to another control from which the actual value of the Binding is determined. This can be used, for example, for Bindings such as "SHIFT+1". This type of Composite binding uses the [`OneModifierComposite`](xref:UnityEngine.InputSystem.Composites.OneModifierComposite) class. The buttons can be on any Device, and can be toggle buttons or full-range buttons such as gamepad triggers.
-The result is a value of the same type as the controls bound to the [`binding`](../api/UnityEngine.InputSystem.Composites.OneModifierComposite.html#UnityEngine_InputSystem_Composites_OneModifierComposite_binding) part.
+The result is a value of the same type as the controls bound to the [`binding`](xref:UnityEngine.InputSystem.Composites.OneModifierComposite.binding) part.
```CSharp
// Add binding for "CTRL+1".
@@ -239,24 +229,25 @@ myAction.AddCompositeBinding("OneModifier")
.With("Modifier", "/alt");
```
-The button with one modifier Composite has two part Bindings.
+The button with One Modifier Composite has two Part Bindings.
|Part|Type|Description|
|----|----|-----------|
-|[`modifier`](../api/UnityEngine.InputSystem.Composites.OneModifierComposite.html#UnityEngine_InputSystem_Composites_OneModifierComposite_modifier)|`Button`|Modifier that has to be held for `binding` to come through. If the user holds any of the buttons bound to the `modifier` at the same time as the button that triggers the action, the Composite assumes the value of the `modifier` Binding. If the user does not press any button bound to the `modifier`, the Composite remains at default value.|
-|[`binding`](../api/UnityEngine.InputSystem.Composites.OneModifierComposite.html#UnityEngine_InputSystem_Composites_OneModifierComposite_binding)|Any|The control(s) whose value the Composite assumes while the user holds down the `modifier` button.|
+|[`modifier`](xref:UnityEngine.InputSystem.Composites.OneModifierComposite.modifier)|`Button`|Modifier that has to be held for `binding` to come through. If the user holds any of the buttons bound to the `modifier` at the same time as the button that triggers the action, the Composite assumes the value of the `modifier` Binding. If the user does not press any button bound to the `modifier`, the Composite remains at default value.|
+|[`binding`](xref:UnityEngine.InputSystem.Composites.OneModifierComposite.binding)|Any|The control(s) whose value the Composite assumes while the user holds down the `modifier` button.|
This Composite has no parameters.
### Two Modifiers
-
-
+{width="486" height="119"}
-A Composite that requires the user to hold down two "modifier" buttons in addition to another control from which the actual value of the Binding is determined. This can be used, for example, for Bindings such as "SHIFT+CTRL+1". Implemented in the [`TwoModifiersComposite`](../api/UnityEngine.InputSystem.Composites.TwoModifiersComposite.html) class. The buttons can be on any Device, and can be toggle buttons or full-range buttons such as gamepad triggers.
+{width="486" height="149"}
-The result is a value of the same type as the controls bound to the [`binding`](../api/UnityEngine.InputSystem.Composites.TwoModifiersComposite.html#UnityEngine_InputSystem_Composites_TwoModifiersComposite_binding) part.
+A Two Modifiers Composite requires the user to hold down two "modifier" buttons in addition to another control from which the actual value of the Binding is determined. This can be used, for example, for Bindings such as "SHIFT+CTRL+1". This type of Composite binding uses the [`TwoModifiersComposite`](xref:UnityEngine.InputSystem.Composites.TwoModifiersComposite) class. The buttons can be on any Device, and can be toggle buttons or full-range buttons such as gamepad triggers.
+
+The result is a value of the same type as the controls bound to the [`binding`](xref:UnityEngine.InputSystem.Composites.TwoModifiersComposite.binding) part.
```CSharp
myAction.AddCompositeBinding("TwoModifiers")
@@ -267,13 +258,13 @@ myAction.AddCompositeBinding("TwoModifiers")
.With("Modifier2", "/rightShift");
```
-The button with two modifiers Composite has three part Bindings.
+The button with Two Modifiers Composite has three Part Bindings.
|Part|Type|Description|
|----|----|-----------|
-|[`modifier1`](../api/UnityEngine.InputSystem.Composites.TwoModifiersComposite.html#UnityEngine_InputSystem_Composites_TwoModifiersComposite_modifier1)|`Button`|The first modifier the user must hold alongside `modifier2`, for `binding` to come through. If the user does not press any button bound to the `modifier1`, the Composite remains at default value.|
-|[`modifier2`](../api/UnityEngine.InputSystem.Composites.TwoModifiersComposite.html#UnityEngine_InputSystem_Composites_TwoModifiersComposite_modifier2)|`Button`|The second modifier the user must hold alongside `modifier1`, for `binding` to come through. If the user does not press any button bound to the `modifier2`, the Composite remains at default value.|
-|[`binding`](../api/UnityEngine.InputSystem.Composites.TwoModifiersComposite.html#UnityEngine_InputSystem_Composites_TwoModifiersComposite_binding)|Any|The control(s) whose value the Composite assumes while the user presses both `modifier1` and `modifier2` at the same time.|
+|[`modifier1`](xref:UnityEngine.InputSystem.Composites.TwoModifiersComposite.modifier1)|`Button`|The first modifier the user must hold alongside `modifier2`, for `binding` to come through. If the user does not press any button bound to the `modifier1`, the Composite remains at default value.|
+|[`modifier2`](xref:UnityEngine.InputSystem.Composites.TwoModifiersComposite.modifier2)|`Button`|The second modifier the user must hold alongside `modifier1`, for `binding` to come through. If the user does not press any button bound to the `modifier2`, the Composite remains at default value.|
+|[`binding`](xref:UnityEngine.InputSystem.Composites.TwoModifiersComposite.binding)|Any|The control(s) whose value the Composite assumes while the user presses both `modifier1` and `modifier2` at the same time.|
This Composite has no parameters.
@@ -281,9 +272,10 @@ This Composite has no parameters.
You can define new types of Composites, and register them with the API. Unity treats these the same as predefined types, which the Input System internally defines and registers in the same way.
-To define a new type of Composite, create a class based on [`InputBindingComposite`](../api/UnityEngine.InputSystem.InputBindingComposite-1.html).
+To define a new type of Composite, create a class based on [`InputBindingComposite`](xref:UnityEngine.InputSystem.InputBindingComposite`1).
-> __IMPORTANT__: Composites must be __stateless__. This means that you cannot store local state that changes depending on the input being processed. For __stateful__ processing on Bindings, see [interactions](./Interactions.md#writing-custom-interactions).
+> [!IMPORTANT]
+> Composites must be __stateless__. This means that you cannot store local state that changes depending on the input being processed. For __stateful__ processing on Bindings, see [interactions](xref:input-system-interactions#writing-custom-interactions).
```CSharp
// Use InputBindingComposite as a base class for a composite that returns
@@ -361,7 +353,7 @@ The Composite should now appear in the editor UI when you add a Binding, and you
.With("secondpart", "/buttonNorth");
```
-To define a custom parameter editor for the Composite, you can derive from [`InputParameterEditor`](../api/UnityEngine.InputSystem.Editor.InputParameterEditor-1.html).
+To define a custom parameter editor for the Composite, you can derive from [`InputParameterEditor`](xref:UnityEngine.InputSystem.Editor.InputParameterEditor`1).
```CSharp
#if UNITY_EDITOR
@@ -378,23 +370,23 @@ public class CustomParameterEditor : InputParameterEditor
## Working with Bindings
-## Looking up Bindings
+### Looking up Bindings
-You can retrieve the bindings of an action using its [`InputAction.bindings`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_bindings) property which returns a read-only array of [`InputBinding`](../api/UnityEngine.InputSystem.InputBinding.html) structs.
+You can retrieve the bindings of an action using its [`InputAction.bindings`](xref:UnityEngine.InputSystem.InputAction.bindings) property which returns a read-only array of [`InputBinding`](xref:UnityEngine.InputSystem.InputBinding) structs.
```CSharp
// Get bindings of "fire" action.
var fireBindings = playerInput.actions["fire"].bindings;
```
-Also, all the bindings for all actions in an [`InputActionMap`](../api/UnityEngine.InputSystem.InputActionMap.html) are made available through the [`InputActionMap.bindings`](../api/UnityEngine.InputSystem.InputActionMap.html#UnityEngine_InputSystem_InputActionMap_bindings) property. The bindings are associated with actions through an [action ID](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_id) or [action name](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_name) stored in the [`InputBinding.action`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_action) property.
+Also, all the bindings for all actions in an [`InputActionMap`](xref:UnityEngine.InputSystem.InputActionMap) are made available through the [`InputActionMap.bindings`](xref:UnityEngine.InputSystem.InputActionMap.bindings) property. The bindings are associated with actions through an [action ID](xref:UnityEngine.InputSystem.InputAction.id) or [action name](xref:UnityEngine.InputSystem.InputAction.name) stored in the [`InputBinding.action`](xref:UnityEngine.InputSystem.InputBinding.action) property.
```CSharp
// Get all bindings in "gameplay" action map.
var gameplayBindings = playerInput.actions.FindActionMap("gameplay").bindings;
```
-You can also look up specific the indices of specific bindings in [`InputAction.bindings`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_bindings) using the [`InputActionRebindingExtensions.GetBindingIndex`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.html#UnityEngine_InputSystem_InputActionRebindingExtensions_GetBindingIndex_UnityEngine_InputSystem_InputAction_UnityEngine_InputSystem_InputBinding_) method.
+You can also look up specific the indices of specific bindings in [`InputAction.bindings`](xref:UnityEngine.InputSystem.InputAction.bindings) using the [`InputActionRebindingExtensions.GetBindingIndex`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.GetBindingIndex(UnityEngine.InputSystem.InputAction,UnityEngine.InputSystem.InputBinding)) method.
```CSharp
// Find the binding in the "Keyboard" control scheme.
@@ -405,7 +397,7 @@ You can also look up specific the indices of specific bindings in [`InputAction.
new InputBinding { path = "/space" });
```
-Finally, you can look up the binding that corresponds to a specific control through [`GetBindingIndexForControl`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.html#UnityEngine_InputSystem_InputActionRebindingExtensions_GetBindingIndexForControl_). This way, you can, for example, map a control found in the [`controls`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_controls) array of an [`InputAction`](../api/UnityEngine.InputSystem.InputAction.html) back to an [`InputBinding`](../api/UnityEngine.InputSystem.InputBinding.html).
+Finally, you can look up the binding that corresponds to a specific control through [`GetBindingIndexForControl`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.GetBindingIndexForControl*). This way, you can, for example, map a control found in the [`controls`](xref:UnityEngine.InputSystem.InputAction.controls) array of an [`InputAction`](xref:UnityEngine.InputSystem.InputAction) back to an [`InputBinding`](xref:UnityEngine.InputSystem.InputBinding).
```CSharp
// Find the binding that binds LMB to "fire". If there is no such binding,
@@ -416,9 +408,9 @@ Finally, you can look up the binding that corresponds to a specific control thro
Debug.Log("Fire is not bound to LMB of the current mouse.");
```
-## Changing Bindings
+### Changing Bindings
-In general, you can change existing bindings via the [`InputActionSetupExtensions.ChangeBinding`](../api/UnityEngine.InputSystem.InputActionSetupExtensions.html#UnityEngine_InputSystem_InputActionSetupExtensions_ChangeBinding_UnityEngine_InputSystem_InputAction_System_Int32_) method. This returns an accessor that can be used to modify the properties of the targeted [`InputBinding`](../api/UnityEngine.InputSystem.InputBinding.html). Note that most of the write operations of the accessor are destructive. For non-destructive changes to bindings, see [Applying Overrides](#applying-overrides).
+In general, you can change existing bindings via the [`InputActionSetupExtensions.ChangeBinding`](xref:UnityEngine.InputSystem.InputActionSetupExtensions.ChangeBinding(UnityEngine.InputSystem.InputAction,System.Int32)) method. This returns an accessor that can be used to modify the properties of the targeted [`InputBinding`](xref:UnityEngine.InputSystem.InputBinding). Note that most of the write operations of the accessor are destructive. For non-destructive changes to bindings, see [Applying Overrides](#applying-overrides).
```CSharp
// Get write access to the second binding of the 'fire' action.
@@ -430,7 +422,7 @@ var accessor = playerInput.actions['fire'].ChangeBinding(1);
accessor = playerInput.actions.FindActionMap("gameplay").ChangeBinding(2);
```
-You can use the resulting accessor to modify properties through methods such as [`WithPath`](../api/UnityEngine.InputSystem.InputActionSetupExtensions.BindingSyntax.html#UnityEngine_InputSystem_InputActionSetupExtensions_BindingSyntax_WithPath_) or [`WithProcessors`](../api/UnityEngine.InputSystem.InputActionSetupExtensions.BindingSyntax.html#UnityEngine_InputSystem_InputActionSetupExtensions_BindingSyntax_WithProcessors_).
+You can use the resulting accessor to modify properties through methods such as [`WithPath`](xref:UnityEngine.InputSystem.InputActionSetupExtensions.BindingSyntax.WithPath*) or [`WithProcessors`](xref:UnityEngine.InputSystem.InputActionSetupExtensions.BindingSyntax.WithProcessors*).
```CSharp
playerInput.actions["fire"].ChangeBinding(1)
@@ -438,7 +430,7 @@ playerInput.actions["fire"].ChangeBinding(1)
.WithPath("/space");
```
-You can also use the accessor to iterate through bindings using [`PreviousBinding`](../api/UnityEngine.InputSystem.InputActionSetupExtensions.BindingSyntax.html#UnityEngine_InputSystem_InputActionSetupExtensions_BindingSyntax_PreviousBinding_) and [`NextBinding`](../api/UnityEngine.InputSystem.InputActionSetupExtensions.BindingSyntax.html#UnityEngine_InputSystem_InputActionSetupExtensions_BindingSyntax_NextBinding_).
+You can also use the accessor to iterate through bindings using [`PreviousBinding`](xref:UnityEngine.InputSystem.InputActionSetupExtensions.BindingSyntax.PreviousBinding*) and [`NextBinding`](xref:UnityEngine.InputSystem.InputActionSetupExtensions.BindingSyntax.NextBinding*).
```CSharp
// Move accessor to previous binding.
@@ -448,7 +440,7 @@ accessor = accessor.PreviousBinding();
accessor = accessor.NextBinding();
```
-If the given binding is a [composite](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_isComposite), you can address it by its name rather than by index.
+If the given binding is a [composite](xref:UnityEngine.InputSystem.InputBinding.isComposite), you can address it by its name rather than by index.
```CSharp
// Change the 2DVector composite of the "move" action.
@@ -459,27 +451,27 @@ playerInput.actions["move"].ChangeCompositeBinding("2DVector")
playerInput.actions["move"].ChangeBinding("WASD")
```
-### Applying overrides
+#### Applying overrides
-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`.
+You can override aspects of any Binding at run-time non-destructively. Specific properties of [`InputBinding`](xref:UnityEngine.InputSystem.InputBinding) have an `override` variant that, if set, will take precedent over the property that they shadow. All `override` properties are of type `String`.
|Property|Override|Description|
|--------|--------|-----------|
-|[`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. Example: `"/leftStick"`|
-|[`processors`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_processors)|[`overrideProcessors`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_overrideProcessors)|Replaces the [processors](./UsingProcessors.md) applied to the binding. Example: `"invert,normalize(min=0,max=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. Example: `"tap(duration=0.5)"`|
+|[`path`](xref:UnityEngine.InputSystem.InputBinding.path)|[`overridePath`](xref:UnityEngine.InputSystem.InputBinding.overridePath)|Replaces the [Control path](xref:input-system-controls#control-paths) that determines which Control(s) are referenced in the binding. If [`overridePath`](xref:UnityEngine.InputSystem.InputBinding.overridePath) is set to an empty string, the binding is effectively disabled. Example: `"/leftStick"`|
+|[`processors`](xref:UnityEngine.InputSystem.InputBinding.processors)|[`overrideProcessors`](xref:UnityEngine.InputSystem.InputBinding.overrideProcessors)|Replaces the [processors](./UsingProcessors.md) applied to the binding. Example: `"invert,normalize(min=0,max=10)"`|
+|[`interactions`](xref:UnityEngine.InputSystem.InputBinding.interactions)|[`overrideInteractions`](xref:UnityEngine.InputSystem.InputBinding.overrideInteractions)|Replaces the [interactions](xref:input-system-interactions) applied to the binding. Example: `"tap(duration=0.5)"`|
> [!NOTE]
-> The `override` property values are not saved with the Actions, for example, when calling [`InputActionAsset.ToJson()`](../api/UnityEngine.InputSystem.InputActionAsset.html#UnityEngine_InputSystem_InputActionAsset_ToJson)). Refer to [Saving and loading rebinds](#saving-and-loading-rebinds) for details about how to persist user rebinds.
+> The `override` property values are not saved with the Actions, for example, when calling [`InputActionAsset.ToJson()`](xref:UnityEngine.InputSystem.InputActionAsset.ToJson)). Refer to [Saving and loading rebinds](#saving-and-loading-rebinds) for details about how to persist user rebinds.
-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.
+To set the various `override` properties, you can use the [`ApplyBindingOverride`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.ApplyBindingOverride(UnityEngine.InputSystem.InputAction,UnityEngine.InputSystem.InputBinding)) APIs.
```CSharp
// Rebind the "fire" action to the left trigger on the gamepad.
playerInput.actions["fire"].ApplyBindingOverride("/leftTrigger");
```
-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.
+In most cases, it is best to locate specific bindings using APIs such as [`GetBindingIndexForControl`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.GetBindingIndexForControl*) and to then apply the override to that specific binding.
```CSharp
// Find the "Jump" binding for the space key.
@@ -490,9 +482,9 @@ var bindingIndex = jumpAction.GetBindingIndexForControl(Keyboard.current.spaceKe
jumpAction.ApplyBindingOverride(bindingIndex, "/enter");
```
-### Erasing Bindings
+#### Erasing Bindings
-You can erase a binding by calling [`Erase`](../api/UnityEngine.InputSystem.InputActionSetupExtensions.BindingSyntax.html#UnityEngine_InputSystem_InputActionSetupExtensions_BindingSyntax_Erase_) on the [binding accessor](../api/UnityEngine.InputSystem.InputActionSetupExtensions.BindingSyntax.html).
+You can erase a binding by calling [`Erase`](xref:UnityEngine.InputSystem.InputActionSetupExtensions.BindingSyntax.Erase*) on the [binding accessor](xref:UnityEngine.InputSystem.InputActionSetupExtensions.BindingSyntax).
```CSharp
// Erase first binding on "fire" action.
@@ -509,9 +501,9 @@ playerInput.actions["move"].ChangeCompositeBinding("WASD").Erase();
playerInput.actions.FindActionMap("gameplay").ChangeBinding(0).Erase();
```
-### Adding Bindings
+#### Adding Bindings
-New bindings can be added to an Action using [`AddBinding`](../api/UnityEngine.InputSystem.InputActionSetupExtensions.html#UnityEngine_InputSystem_InputActionSetupExtensions_AddBinding_UnityEngine_InputSystem_InputAction_System_String_System_String_System_String_System_String_) or [`AddCompositeBinding`](../api/UnityEngine.InputSystem.InputActionSetupExtensions.html#UnityEngine_InputSystem_InputActionSetupExtensions_AddCompositeBinding_UnityEngine_InputSystem_InputAction_System_String_System_String_System_String_).
+New bindings can be added to an Action using [`AddBinding`](xref:UnityEngine.InputSystem.InputActionSetupExtensions.AddBinding(UnityEngine.InputSystem.InputAction,System.String,System.String,System.String,System.String)) or [`AddCompositeBinding`](xref:UnityEngine.InputSystem.InputActionSetupExtensions.AddCompositeBinding(UnityEngine.InputSystem.InputAction,System.String,System.String,System.String)).
```CSharp
// Add a binding for the left mouse button to the "fire" action.
@@ -526,9 +518,9 @@ playerInput.actions["move"]
.With("Right", "/d");
```
-### Setting parameters
+#### Setting parameters
-A Binding may, either through itself or through its associated Action, lead to [processor](UsingProcessors.md), [interaction](Interactions.md), and/or [composite](#composite-bindings) objects being created. These objects can have parameters you can configure through in the [Binding properties view](ActionsEditor.md#bindings) of the Action editor or through the API. This configuration will give parameters their default value.
+A Binding may, either through itself or through its associated Action, lead to [processor](UsingProcessors.md), [interaction](xref:input-system-interactions), and/or [composite](#composite-bindings) objects being created. These objects can have parameters you can configure through in the [Binding properties view](xref:input-system-configuring-input#bindings) of the Action editor or through the API. This configuration will give parameters their default value.
```CSharp
// Create an action with a "Hold" interaction on it.
@@ -536,7 +528,7 @@ A Binding may, either through itself or through its associated Action, lead to [
var action = new InputAction(interactions: "hold(duration=4)");
```
-You can query the current value of any such parameter using the [`GetParameterValue`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.html#UnityEngine_InputSystem_InputActionRebindingExtensions_GetParameterValue_UnityEngine_InputSystem_InputAction_System_String_UnityEngine_InputSystem_InputBinding_) API.
+You can query the current value of any such parameter using the [`GetParameterValue`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.GetParameterValue(UnityEngine.InputSystem.InputAction,System.String,UnityEngine.InputSystem.InputBinding)) API.
```CSharp
// This returns a PrimitiveValue?. It will be null if the
@@ -563,9 +555,9 @@ Alternatively, you can use an expression parameter to encapsulate both the type
action.GetParameterValue((TapInteraction x) => x.duration);
```
-To alter the current value of a parameter, you can use what is referred to as a "parameter override". You can apply these at the level of an individual [`InputAction`](../api/UnityEngine.InputSystem.InputAction.html), or at the level of an entire [`InputActionMap`](../api/UnityEngine.InputSystem.InputActionMap.html), or even at the level of an entire [`InputActionAsset`](../api/UnityEngine.InputSystem.InputActionAsset.html). Such overrides are stored internally and applied automatically even on bindings added later.
+To alter the current value of a parameter, you can use what is referred to as a "parameter override". You can apply these at the level of an individual [`InputAction`](xref:UnityEngine.InputSystem.InputAction), or at the level of an entire [`InputActionMap`](xref:UnityEngine.InputSystem.InputActionMap), or even at the level of an entire [`InputActionAsset`](xref:UnityEngine.InputSystem.InputActionAsset). Such overrides are stored internally and applied automatically even on bindings added later.
-To add an override, use the [`ApplyParameterOverride`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.html#UnityEngine_InputSystem_InputActionRebindingExtensions_ApplyParameterOverride_UnityEngine_InputSystem_InputAction_System_String_UnityEngine_InputSystem_Utilities_PrimitiveValue_UnityEngine_InputSystem_InputBinding_) API or any of its overloads.
+To add an override, use the [`ApplyParameterOverride`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.ApplyParameterOverride(UnityEngine.InputSystem.InputAction,System.String,UnityEngine.InputSystem.Utilities.PrimitiveValue,UnityEngine.InputSystem.InputBinding)) API or any of its overloads.
```CSharp
// Set the "duration" parameter on all bindings of the action to 4.
@@ -634,17 +626,20 @@ look.ApplyParameterOverride("scaleVector2:x", 0.5f, new InputBinding("/de
look.ApplyParameterOverride("scaleVector2:y", 0.5f, new InputBinding("/delta"));
```
->NOTE: Parameter overrides are *not* persisted along with an asset.
+> [!NOTE]
+> Parameter overrides are *not* persisted along with an asset.
-## Interactive rebinding
+### Interactive rebinding
->__Note:__ To download a sample project which demonstrates how to set up a rebinding user interface with Input System APIs, open the Package Manager, select the Input System Package, and choose the sample project "Rebinding UI" to download.
+> [!NOTE]
+> To download a sample project which demonstrates how to set up a rebinding user interface with Input System APIs, open the Package Manager, select the Input System Package, and choose the sample project "Rebinding UI" to download.
Runtime rebinding allows users of your application to set their own Bindings.
-To allow users to choose their own Bindings interactively, use the [`InputActionRebindingExtensions.RebindingOperation`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation.html) class. Call the [`PerformInteractiveRebinding()`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.html#UnityEngine_InputSystem_InputActionRebindingExtensions_PerformInteractiveRebinding_UnityEngine_InputSystem_InputAction_System_Int32_) method on an Action to create a rebinding operation. This operation waits for the Input System to register any input from any Device which matches the Action's expected Control type, then uses [`InputBinding.overridePath`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_overridePath) to assign the Control path for that Control to the Action's Bindings. If the user actuates multiple Controls, the rebinding operation chooses the Control with the highest [magnitude](Controls.md#control-actuation).
+To allow users to choose their own Bindings interactively, use the [`InputActionRebindingExtensions.RebindingOperation`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation) class. Call the [`PerformInteractiveRebinding()`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.PerformInteractiveRebinding(UnityEngine.InputSystem.InputAction,System.Int32)) method on an Action to create a rebinding operation. This operation waits for the Input System to register any input from any Device which matches the Action's expected Control type, then uses [`InputBinding.overridePath`](xref:UnityEngine.InputSystem.InputBinding.overridePath) to assign the Control path for that Control to the Action's Bindings. If the user actuates multiple Controls, the rebinding operation chooses the Control with the highest [magnitude](xref:input-system-controls#control-actuation).
->IMPORTANT: You must dispose of [`InputActionRebindingExtensions.RebindingOperation`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation.html) instances via `Dispose()`, so that they don't leak memory on the unmanaged memory heap.
+> [!IMPORTANT]
+> You must dispose of [`InputActionRebindingExtensions.RebindingOperation`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation) instances via `Dispose()`, so that they don't leak memory on the unmanaged memory heap.
```C#
void RemapButtonClicked(InputAction actionToRebind)
@@ -654,23 +649,23 @@ To allow users to choose their own Bindings interactively, use the [`InputActio
}
```
-The [`InputActionRebindingExtensions.RebindingOperation`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation.html) API is highly configurable to match your needs. For example, you can:
+The [`InputActionRebindingExtensions.RebindingOperation`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation) API is highly configurable to match your needs. For example, you can:
-* Choose expected Control types ([`WithExpectedControlType()`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation.html#UnityEngine_InputSystem_InputActionRebindingExtensions_RebindingOperation_WithExpectedControlType_System_Type_)).
+* Choose expected Control types ([`WithExpectedControlType()`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation.WithExpectedControlType(System.Type))).
-* Exclude certain Controls ([`WithControlsExcluding()`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation.html#UnityEngine_InputSystem_InputActionRebindingExtensions_RebindingOperation_WithControlsExcluding_System_String_)).
+* Exclude certain Controls ([`WithControlsExcluding()`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation.WithControlsExcluding(System.String))).
-* Set a Control to cancel the operation ([`WithCancelingThrough()`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation.html#UnityEngine_InputSystem_InputActionRebindingExtensions_RebindingOperation_WithCancelingThrough_UnityEngine_InputSystem_InputControl_)).
+* Set a Control to cancel the operation ([`WithCancelingThrough()`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation.WithCancelingThrough(UnityEngine.InputSystem.InputControl))).
-* Choose which Bindings to apply the operation on if the Action has multiple Bindings ([`WithTargetBinding()`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation.html#UnityEngine_InputSystem_InputActionRebindingExtensions_RebindingOperation_WithTargetBinding_System_Int32_), [`WithBindingGroup()`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation.html#UnityEngine_InputSystem_InputActionRebindingExtensions_RebindingOperation_WithBindingGroup_System_String_), [`WithBindingMask()`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation.html#UnityEngine_InputSystem_InputActionRebindingExtensions_RebindingOperation_WithBindingMask_System_Nullable_UnityEngine_InputSystem_InputBinding__)).
+* Choose which Bindings to apply the operation on if the Action has multiple Bindings ([`WithTargetBinding()`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation.WithTargetBinding(System.Int32)), [`WithBindingGroup()`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation.WithBindingGroup(System.String)), [`WithBindingMask()`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation.WithBindingMask(System.Nullable{UnityEngine.InputSystem.InputBinding}))).
-Refer to the scripting API reference for [`InputActionRebindingExtensions.RebindingOperation`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation.html) for a full overview.
+Refer to the scripting API reference for [`InputActionRebindingExtensions.RebindingOperation`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation) for a full overview.
-Note that [`PerformInteractiveRebinding()`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.html#UnityEngine_InputSystem_InputActionRebindingExtensions_PerformInteractiveRebinding_UnityEngine_InputSystem_InputAction_System_Int32_) automatically applies a set of default configurations based on the given action and targeted binding.
+Note that [`PerformInteractiveRebinding()`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.PerformInteractiveRebinding(UnityEngine.InputSystem.InputAction,System.Int32)) automatically applies a set of default configurations based on the given action and targeted binding.
-## Saving and loading rebinds
+### Saving and loading rebinds
-You can serialize override properties of [Bindings](../api/UnityEngine.InputSystem.InputBinding.html) by serializing them as JSON strings and restoring them from these. Use [`SaveBindingOverridesAsJson`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.html#UnityEngine_InputSystem_InputActionRebindingExtensions_SaveBindingOverridesAsJson_UnityEngine_InputSystem_IInputActionCollection2_) to create these strings and [`LoadBindingOverridesFromJson`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.html#UnityEngine_InputSystem_InputActionRebindingExtensions_LoadBindingOverridesFromJson_UnityEngine_InputSystem_IInputActionCollection2_System_String_System_Boolean_) to restore overrides from them.
+You can serialize override properties of [Bindings](xref:UnityEngine.InputSystem.InputBinding) by serializing them as JSON strings and restoring them from these. Use [`SaveBindingOverridesAsJson`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.SaveBindingOverridesAsJson(UnityEngine.InputSystem.IInputActionCollection2)) to create these strings and [`LoadBindingOverridesFromJson`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.LoadBindingOverridesFromJson(UnityEngine.InputSystem.IInputActionCollection2,System.String,System.Boolean)) to restore overrides from them.
```CSharp
// Store player rebinds in PlayerPrefs.
@@ -684,9 +679,9 @@ var rebinds = PlayerPrefs.GetString("rebinds");
playerInput.actions.LoadBindingOverridesFromJson(rebinds);
```
-### Restoring original Bindings
+#### Restoring original Bindings
-You can remove Binding overrides and thus restore defaults by using [`RemoveBindingOverride`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.html#UnityEngine_InputSystem_InputActionRebindingExtensions_RemoveBindingOverride_UnityEngine_InputSystem_InputAction_System_Int32_) or [`RemoveAllBindingOverrides`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.html#UnityEngine_InputSystem_InputActionRebindingExtensions_RemoveAllBindingOverrides_UnityEngine_InputSystem_IInputActionCollection2_).
+You can remove Binding overrides and thus restore defaults by using [`RemoveBindingOverride`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.RemoveBindingOverride(UnityEngine.InputSystem.InputAction,System.Int32)) or [`RemoveAllBindingOverrides`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.RemoveAllBindingOverrides(UnityEngine.InputSystem.IInputActionCollection2)).
```CSharp
// Remove binding overrides from the first binding of the "fire" action.
@@ -699,11 +694,11 @@ playerInput.actions["fire"].RemoveAllBindingOverrides();
playerInput.actions.RemoveAllBindingOverrides();
```
-### Displaying Bindings
+#### Displaying Bindings
-It can be useful for the user to know what an Action is currently bound to (taking any potentially active rebindings into account) while rebinding UIs, and for on-screen hints while the app is running. You can use [`InputBinding.effectivePath`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_effectivePath) to get the currently active path for a Binding (which returns [`overridePath`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_overridePath) if set, or otherwise returns [`path`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_path)).
+It can be useful for the user to know what an Action is currently bound to (taking any potentially active rebindings into account) while rebinding UIs, and for on-screen hints while the app is running. You can use [`InputBinding.effectivePath`](xref:UnityEngine.InputSystem.InputBinding.effectivePath) to get the currently active path for a Binding (which returns [`overridePath`](xref:UnityEngine.InputSystem.InputBinding.overridePath) if set, or otherwise returns [`path`](xref:UnityEngine.InputSystem.InputBinding.path)).
-The easiest way to retrieve a display string for an action is to call [`InputActionRebindingExtensions.GetBindingDisplayString`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.html#UnityEngine_InputSystem_InputActionRebindingExtensions_GetBindingDisplayString_) which is an extension method for [`InputAction`](../api/UnityEngine.InputSystem.InputAction.html).
+The easiest way to retrieve a display string for an action is to call [`InputActionRebindingExtensions.GetBindingDisplayString`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.GetBindingDisplayString*) which is an extension method for [`InputAction`](xref:UnityEngine.InputSystem.InputAction).
```CSharp
// Get a binding string for the action as a whole. This takes into account which
@@ -761,53 +756,54 @@ You can also use this method to replace the text string with images.
}
```
-Additionally, each Binding has a [`ToDisplayString`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_ToDisplayString_UnityEngine_InputSystem_InputBinding_DisplayStringOptions_UnityEngine_InputSystem_InputControl_) method, which you can use to turn individual Bindings into display strings. There is also a generic formatting method for Control paths, [`InputControlPath.ToHumanReadableString`](../api/UnityEngine.InputSystem.InputControlPath.html#UnityEngine_InputSystem_InputControlPath_ToHumanReadableString_System_String_UnityEngine_InputSystem_InputControlPath_HumanReadableStringOptions_UnityEngine_InputSystem_InputControl_), which you can use with arbitrary Control path strings.
+Additionally, each Binding has a [`ToDisplayString`](xref:UnityEngine.InputSystem.InputBinding.ToDisplayString(UnityEngine.InputSystem.InputBinding.DisplayStringOptions,UnityEngine.InputSystem.InputControl)) method, which you can use to turn individual Bindings into display strings. There is also a generic formatting method for Control paths, [`InputControlPath.ToHumanReadableString`](xref:UnityEngine.InputSystem.InputControlPath.ToHumanReadableString(System.String,UnityEngine.InputSystem.InputControlPath.HumanReadableStringOptions,UnityEngine.InputSystem.InputControl)), which you can use with arbitrary Control path strings.
-Note that the Controls a Binding resolves to can change at any time, and the display strings for controls might change dynamically. For example, if the user switches the currently active keyboard layout, the display string for each individual key on the [`Keyboard`](../api/UnityEngine.InputSystem.Keyboard.html) might change.
+Note that the Controls a Binding resolves to can change at any time, and the display strings for controls might change dynamically. For example, if the user switches the currently active keyboard layout, the display string for each individual key on the [`Keyboard`](xref:UnityEngine.InputSystem.Keyboard) might change.
## Control Schemes
-A Binding can belong to any number of Binding groups. Unity stores these on the [`InputBinding`](../api/UnityEngine.InputSystem.InputBinding.html) class as a semicolon-separated string in the [`InputBinding.groups`](../api/UnityEngine.InputSystem.InputBinding.html#UnityEngine_InputSystem_InputBinding_groups) property, and you can use them for any arbitrary grouping of bindings. To enable different sets of binding groups for an [`InputActionMap`](../api/UnityEngine.InputSystem.InputActionMap.html) or [`InputActionAsset`](../api/UnityEngine.InputSystem.InputActionAsset.html), you can use the [`InputActionMap.bindingMask`](../api/UnityEngine.InputSystem.InputActionMap.html#UnityEngine_InputSystem_InputActionMap_bindingMask)/[`InputActionAsset.bindingMask`](../api/UnityEngine.InputSystem.InputActionAsset.html#UnityEngine_InputSystem_InputActionAsset_bindingMask) property. The Input System uses this to implement the concept of grouping Bindings into different [`InputControlSchemes`](../api/UnityEngine.InputSystem.InputControlScheme.html).
+A Binding can belong to any number of Binding groups. Unity stores these on the [`InputBinding`](xref:UnityEngine.InputSystem.InputBinding) class as a semicolon-separated string in the [`InputBinding.groups`](xref:UnityEngine.InputSystem.InputBinding.groups) property, and you can use them for any arbitrary grouping of bindings. To enable different sets of binding groups for an [`InputActionMap`](xref:UnityEngine.InputSystem.InputActionMap) or [`InputActionAsset`](xref:UnityEngine.InputSystem.InputActionAsset), you can use the [`InputActionMap.bindingMask`](xref:UnityEngine.InputSystem.InputActionMap.bindingMask)/[`InputActionAsset.bindingMask`](xref:UnityEngine.InputSystem.InputActionAsset.bindingMask) property. The Input System uses this to implement the concept of grouping Bindings into different [`InputControlSchemes`](xref:UnityEngine.InputSystem.InputControlScheme).
-Control Schemes use Binding groups to map Bindings in an [`InputActionMap`](../api/UnityEngine.InputSystem.InputActionMap.html) or [`InputActionAsset`](../api/UnityEngine.InputSystem.InputActionAsset.html) to different types of Devices. The [`PlayerInput`](PlayerInput.md) class uses these to enable a matching Control Scheme for a new [user](UserManagement.md) joining the game, based on the Device they are playing on.
+Control Schemes use Binding groups to map Bindings in an [`InputActionMap`](xref:UnityEngine.InputSystem.InputActionMap) or [`InputActionAsset`](xref:UnityEngine.InputSystem.InputActionAsset) to different types of Devices. The [`PlayerInput`](xref:input-system-player-input) class uses these to enable a matching Control Scheme for a new [user](xref:input-system-user-management) joining the game, based on the Device they are playing on.
## Details
### Binding resolution
-When the Input System accesses the [Controls](Controls.md) bound to an Action for the first time, the Action resolves its Bindings to match them to existing Controls on existing Devices. In this process, the Action calls [`InputSystem.FindControls<>()`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_FindControls__1_System_String_UnityEngine_InputSystem_InputControlList___0___) (filtering for devices assigned to the InputActionMap, if there are any) for the Binding path of each of the Action's bindings. This creates a list of resolved Controls that are now bound to the Action.
+When the Input System accesses the [Controls](xref:input-system-controls) bound to an Action for the first time, the Action resolves its Bindings to match them to existing Controls on existing Devices. In this process, the Action calls [`InputSystem.FindControls<>()`](xref:UnityEngine.InputSystem.InputSystem.FindControls``1(System.String,UnityEngine.InputSystem.InputControlList{``0}@)) (filtering for devices assigned to the InputActionMap, if there are any) for the Binding path of each of the Action's bindings. This creates a list of resolved Controls that are now bound to the Action.
-Note that a single [Binding path](Controls.md#control-paths) can match multiple Controls:
+Note that a single [Binding path](xref:input-system-controls#control-paths) can match multiple Controls:
-* A specific Device path such as `/buttonEast` matches the "Circle" button on a [PlayStation controller](Gamepad.md#playstation-controllers). If you have multiple PlayStation controllers connected, it resolves to the "Circle" button on each of these controllers.
+* A specific Device path such as `/buttonEast` matches the "Circle" button on a [PlayStation controller](xref:input-system-gamepad#playstation-controllers). If you have multiple PlayStation controllers connected, it resolves to the "Circle" button on each of these controllers.
-* An abstract Device path such as `/buttonEast` matches the right action button on any connected gamepad. If you have a PlayStation controller and an [Xbox controller](Gamepad.md#xbox-controllers) connected, it resolves to the "Circle" button on the PlayStation controller, and to the "B" button on the Xbox controller.
+* An abstract Device path such as `/buttonEast` matches the right action button on any connected gamepad. If you have a PlayStation controller and an [Xbox controller](xref:input-system-gamepad#xbox-controllers) connected, it resolves to the "Circle" button on the PlayStation controller, and to the "B" button on the Xbox controller.
-* A Binding path can also contain wildcards, such as `/button*`. This matches any Control on any gamepad with a name starting with "button", which matches all the four action buttons on any connected gamepad. A different example: `*/{Submit}` matches any Control tagged with the "Submit" [usage](Controls.md#control-usages) on any Device.
+* A Binding path can also contain wildcards, such as `/button*`. This matches any Control on any gamepad with a name starting with "button", which matches all the four action buttons on any connected gamepad. A different example: `*/{Submit}` matches any Control tagged with the "Submit" [usage](xref:input-system-controls#control-usages) on any Device.
-If there are multiple Bindings on the same Action that all reference the same Control(s), the Control will effectively feed into the Action multiple times. This is to allow, for example, a single Control to produce different input on the same Action by virtue of being bound in a different fashion (composites, processors, interactions, etc). However, regardless of how many times a Control is bound on any given action, it will only be mentioned once in the Action's [array of `controls`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_controls).
+If there are multiple Bindings on the same Action that all reference the same Control(s), the Control will effectively feed into the Action multiple times. This is to allow, for example, a single Control to produce different input on the same Action by virtue of being bound in a different fashion (composites, processors, interactions, etc). However, regardless of how many times a Control is bound on any given action, it will only be mentioned once in the Action's [array of `controls`](xref:UnityEngine.InputSystem.InputAction.controls).
-To query the Controls that an Action resolves to, you can use [`InputAction.controls`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_controls). You can also run this query if the Action is disabled.
+To query the Controls that an Action resolves to, you can use [`InputAction.controls`](xref:UnityEngine.InputSystem.InputAction.controls). You can also run this query if the Action is disabled.
-To be notified when binding resolution happens, you can listen to [`InputSystem.onActionChange`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_onActionChange) which triggers [`InputActionChange.BoundControlsAboutToChange`](../api/UnityEngine.InputSystem.InputActionChange.html#UnityEngine_InputSystem_InputActionChange_BoundControlsAboutToChange) before modifying Control lists and triggers [`InputActionChange.BoundControlsChanged`](../api/UnityEngine.InputSystem.InputActionChange.html#UnityEngine_InputSystem_InputActionChange_BoundControlsChanged) after having updated them.
+To be notified when binding resolution happens, you can listen to [`InputSystem.onActionChange`](xref:UnityEngine.InputSystem.InputSystem.onActionChange) which triggers [`InputActionChange.BoundControlsAboutToChange`](xref:UnityEngine.InputSystem.InputActionChange.BoundControlsAboutToChange) before modifying Control lists and triggers [`InputActionChange.BoundControlsChanged`](xref:UnityEngine.InputSystem.InputActionChange.BoundControlsChanged) after having updated them.
#### Binding resolution while Actions are enabled
-In certain situations, the [Controls](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_controls) bound to an Action have to be updated more than once. For example, if a new [Device](Devices.md) becomes usable with an Action, the Action may now pick up input from additional controls. Also, if Bindings are added, removed, or modified, Control lists will need to be updated.
+In certain situations, the [Controls](xref:UnityEngine.InputSystem.InputAction.controls) bound to an Action have to be updated more than once. For example, if a new [Device](xref:input-system-devices) becomes usable with an Action, the Action may now pick up input from additional controls. Also, if Bindings are added, removed, or modified, Control lists will need to be updated.
-This updating of Controls usually happens transparently in the background. However, when an Action is [enabled](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_enabled) and especially when it is [in progress](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_IsInProgress_), there may be a noticeable effect on the Action.
+This updating of Controls usually happens transparently in the background. However, when an Action is [enabled](xref:UnityEngine.InputSystem.InputAction.enabled) and especially when it is [in progress](xref:UnityEngine.InputSystem.InputAction.IsInProgress*), there may be a noticeable effect on the Action.
-Adding or removing a device – either [globally](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_devices) or to/from the [device list](../api/UnityEngine.InputSystem.InputActionAsset.html#UnityEngine_InputSystem_InputActionAsset_devices) of an Action – will remain transparent __except__ if an Action is in progress and it is the device of its [active Control](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_activeControl) that is being removed. In this case, the Action will automatically be [cancelled](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_canceled).
+Adding or removing a device – either [globally](xref:UnityEngine.InputSystem.InputSystem.devices) or to/from the [device list](xref:UnityEngine.InputSystem.InputActionAsset.devices) of an Action – will remain transparent __except__ if an Action is in progress and it is the device of its [active Control](xref:UnityEngine.InputSystem.InputAction.activeControl) that is being removed. In this case, the Action will automatically be [cancelled](xref:UnityEngine.InputSystem.InputAction.canceled).
-Modifying the [binding mask](../api/UnityEngine.InputSystem.InputActionAsset.html#UnityEngine_InputSystem_InputActionAsset_bindingMask) or modifying any of the Bindings (such as through [rebinding](#interactive-rebinding) or by adding or removing bindings) will, however, lead to all enabled Actions being temporarily disabled and then re-enabled and resumed.
+Modifying the [binding mask](xref:UnityEngine.InputSystem.InputActionAsset.bindingMask) or modifying any of the Bindings (such as through [rebinding](#interactive-rebinding) or by adding or removing bindings) will, however, lead to all enabled Actions being temporarily disabled and then re-enabled and resumed.
#### Choosing which Devices to use
->__Note__: [`InputUser`](UserManagement.md) and [`PlayerInput`](PlayerInput.md) make use of this facility automatically. They set [`InputActionMap.devices`](../api/UnityEngine.InputSystem.InputActionMap.html#UnityEngine_InputSystem_InputActionMap_devices) automatically based on the Devices that are paired to the user.
+> [!NOTE]
+> [`InputUser`](xref:input-system-user-management) and [`PlayerInput`](xref:input-system-player-input) make use of this facility automatically. They set [`InputActionMap.devices`](xref:UnityEngine.InputSystem.InputActionMap.devices) automatically based on the Devices that are paired to the user.
-By default, Actions resolve their Bindings against all Devices present in the Input System (that is, [`InputSystem.devices`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_devices)). For example, if there are two gamepads present in the system, a Binding to `/buttonSouth` picks up both gamepads and allows the Action to be used from either.
+By default, Actions resolve their Bindings against all Devices present in the Input System (that is, [`InputSystem.devices`](xref:UnityEngine.InputSystem.InputSystem.devices)). For example, if there are two gamepads present in the system, a Binding to `/buttonSouth` picks up both gamepads and allows the Action to be used from either.
-You can override this behavior by restricting [`InputActionAssets`](../api/UnityEngine.InputSystem.InputActionAsset.html) or individual [`InputActionMaps`](../api/UnityEngine.InputSystem.InputActionMap.html) to a specific set of Devices. If you do this, Binding resolution only takes the Controls of the given Devices into account.
+You can override this behavior by restricting [`InputActionAssets`](xref:UnityEngine.InputSystem.InputActionAsset) or individual [`InputActionMaps`](xref:UnityEngine.InputSystem.InputActionMap) to a specific set of Devices. If you do this, Binding resolution only takes the Controls of the given Devices into account.
```
var actionMap = new InputActionMap();
@@ -825,13 +821,14 @@ There are two situations where a given input may lead to ambiguity:
#### Multiple, concurrently used Controls
->__Note:__ This section does not apply to [`PassThrough`](RespondingToActions.md#pass-through) Actions as they are by design meant to allow multiple concurrent inputs.
+> [!NOTE]
+> This section does not apply to [`PassThrough`](xref:input-system-responding#pass-through) Actions as they are by design meant to allow multiple concurrent inputs.
-For a [`Button`](RespondingToActions.md#button) or [`Value`](RespondingToActions.md#value) Action, 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).
+For a [`Button`](xref:input-system-responding#button) or [`Value`](xref:input-system-responding#value) Action, there can only be one Control at any time that is "driving" the Action. This Control is considered the [`activeControl`](xref:UnityEngine.InputSystem.InputAction.activeControl).
-When an Action is bound to multiple Controls, the [`activeControl`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_activeControl) at any point is the one with the greatest level of ["actuation"](Controls.md#control-actuation), that is, the largest value returned from [`EvaluateMagnitude`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_EvaluateMagnitude_). If a Control exceeds the actuation level of the current [`activeControl`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_activeControl), it will itself become the active Control.
+When an Action is bound to multiple Controls, the [`activeControl`](xref:UnityEngine.InputSystem.InputAction.activeControl) at any point is the one with the greatest level of ["actuation"](xref:input-system-controls#control-actuation), that is, the largest value returned from [`EvaluateMagnitude`](xref:UnityEngine.InputSystem.InputControl.EvaluateMagnitude*). If a Control exceeds the actuation level of the current [`activeControl`](xref:UnityEngine.InputSystem.InputAction.activeControl), it will itself become the active Control.
-The following example demonstrates this mechanism with a [`Button`](RespondingToActions.md#button) Action and also demonstrates the difference to a [`PassThrough`](RespondingToActions.md#pass-through) Action.
+The following example demonstrates this mechanism with a [`Button`](xref:input-system-responding#button) Action and also demonstrates the difference to a [`PassThrough`](xref:input-system-responding#pass-through) Action.
```CSharp
// Create a button and a pass-through action and bind each of them
@@ -877,22 +874,23 @@ Set(gamepad.leftTrigger, 0f);
// "leftTrigger changed (Pass-Through)"
```
-For [composite bindings](#composite-bindings), 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 stick track individual Controls from the composite.
+For [composite bindings](#composite-bindings), magnitudes of the composite as a whole rather than for individual Controls are tracked. However, [`activeControl`](xref:UnityEngine.InputSystem.InputAction.activeControl) will stick track individual Controls from the composite.
##### Disabling Conflict Resolution
-Conflict resolution is always applied to [Button](RespondingToActions.md#button) and [Value](RespondingToActions.md#value) type Actions. However, it can be undesirable in situations when an Action is simply used to gather any and all inputs from bound Controls. For example, the following Action would monitor the A button of all available gamepads:
+Conflict resolution is always applied to [Button](xref:input-system-responding#button) and [Value](xref:input-system-responding#value) type Actions. However, it can be undesirable in situations when an Action is simply used to gather any and all inputs from bound Controls. For example, the following Action would monitor the A button of all available gamepads:
```CSharp
var action = new InputAction(type: InputActionType.PassThrough, binding: "/buttonSouth");
action.Enable();
```
-By using the [Pass-Through](RespondingToActions.md#pass-through) Action type, conflict resolution is bypassed and thus, pressing the A button on one gamepad will not result in a press on a different gamepad being ignored.
+By using the [Pass-Through](xref:input-system-responding#pass-through) Action type, conflict resolution is bypassed and thus, pressing the A button on one gamepad will not result in a press on a different gamepad being ignored.
#### Multiple input sequences (such as keyboard shortcuts)
->__Note__: The mechanism described here only applies to Actions that are part of the same [`InputActionMap`](../api/UnityEngine.InputSystem.InputActionMap.html) or [`InputActionAsset`](../api/UnityEngine.InputSystem.InputActionAsset.html).
+> [!NOTE]
+> The mechanism described here only applies to Actions that are part of the same [`InputActionMap`](xref:UnityEngine.InputSystem.InputActionMap) or [`InputActionAsset`](xref:UnityEngine.InputSystem.InputActionAsset).
Inputs that are used in combinations with other inputs may also lead to ambiguities. If, for example, the `b` key on the Keyboard is bound both on its own as well as in combination with the `shift` key, then if you first press `shift` and then `b`, the latter key press would be a valid input for either of the Actions.
@@ -903,7 +901,7 @@ The way this is handled is that Bindings will be processed in the order of decre
In our example, this means that a [`OneModifier`](#one-modifier) composite Binding to `Shift+B` has a higher "complexity" than a Binding to `B` and thus is processed first.
-Additionally, the first Binding that results in the Action changing [phase](RespondingToActions.md#action-callbacks) will "consume" the input. This consuming will result in other Bindings to the same input not being processed. So in our example, when `Shift+B` "consumes" the `B` input, the Binding to `B` will be skipped.
+Additionally, the first Binding that results in the Action changing [phase](xref:input-system-responding#action-callbacks) will "consume" the input. This consuming will result in other Bindings to the same input not being processed. So in our example, when `Shift+B` "consumes" the `B` input, the Binding to `B` will be skipped.
The following example illustrates how this works at the API level.
@@ -941,14 +939,14 @@ Press(keyboard.bKey);
### Initial state check
-After an Action is [enabled](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_enabled), it will start reacting to input as it comes in. However, at the time the Action is enabled, one or more of the Controls that are [bound](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_controls) to an action may already have a non-default state at that point.
-x
-Using what is referred to as an "initial state check", an Action can be made to respond to such a non-default state as if the state change happened *after* the Action was enabled. The way this works is that in the first input [update](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_Update_) after the Action was enabled, all its bound controls are checked in turn. If any of them has a non-default state, the Action responds right away.
+After an Action is [enabled](xref:UnityEngine.InputSystem.InputAction.enabled), it will start reacting to input as it comes in. However, at the time the Action is enabled, one or more of the Controls that are [bound](xref:UnityEngine.InputSystem.InputAction.controls) to an action may already have a non-default state at that point.
+
+Using what is referred to as an "initial state check", an Action can be made to respond to such a non-default state as if the state change happened *after* the Action was enabled. The way this works is that in the first input [update](xref:UnityEngine.InputSystem.InputSystem.Update*) after the Action was enabled, all its bound controls are checked in turn. If any of them has a non-default state, the Action responds right away.
-This check is implicitly enabled for [Value](RespondingToActions.md#value) actions. If, for example, you have a `Move` Action bound to the left stick on the gamepad and the stick is already pushed in a direction when `Move` is enabled, the character will immediately start walking.
+This check is implicitly enabled for [Value](xref:input-system-responding#value) actions. If, for example, you have a `Move` Action bound to the left stick on the gamepad and the stick is already pushed in a direction when `Move` is enabled, the character will immediately start walking.
-By default, [Button](RespondingToActions.md#button) and [Pass-Through](RespondingToActions.md#pass-through) type Actions, do not perform this check. A button that is pressed when its respective Action is enabled first needs to be released and then pressed again for it to trigger the Action.
+By default, [Button](xref:input-system-responding#button) and [Pass-Through](xref:input-system-responding#pass-through) type Actions, do not perform this check. A button that is pressed when its respective Action is enabled first needs to be released and then pressed again for it to trigger the Action.
-However, you can manually enable initial state checks on these types of Actions using the checkbox in the editor:
+However, you can manually enable initial state checks on these types of Actions using the checkbox in the Editor:
-
+{width="486" height="116"}
diff --git a/Packages/com.unity.inputsystem/Documentation~/Actions.md b/Packages/com.unity.inputsystem/Documentation~/Actions.md
index 780d0e2ddc..da7ba0987b 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Actions.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Actions.md
@@ -7,24 +7,24 @@ uid: input-system-actions
For example, the purpose of an input in a game might be to make the player's character move around. The device control associated with that action might be the motion of the left gamepad stick.
-The association between an Action and the device controls which perform that input is a **binding**, and you can set up bindings in the [Input Actions editor](ActionsEditor.md). When you use Actions in your code, you do not need to refer to specific devices because the binding defines which device's controls are used to perform the action.
+The association between an Action and the device controls which perform that input is a **binding**, and you can set up bindings in the [Input Actions editor](xref:input-system-configuring-input). When you use Actions in your code, you do not need to refer to specific devices because the binding defines which device's controls are used to perform the action.
-To use actions in your code, you must use the [Input Actions editor](ActionsEditor.md) to establish the mapping between the Action and one or more device controls. For example in this screenshot, the "Move" action is displayed, showing its bindings the left gamepad stick, and the keyboard's arrow keys.
+To use actions in your code, you must use the [Input Actions editor](xref:input-system-configuring-input) to establish the mapping between the Action and one or more device controls. For example in this screenshot, the "Move" action is displayed, showing its bindings the left gamepad stick, and the keyboard's arrow keys.
-
+
*The Actions panel of the Input Actions Editor in Project Settings*
-You can then get a reference to this action in your code, and check its value, or attach a callback method to be notified when it is performed. See the [Actions Workflow page](Workflow-Actions.md) for a simple example script demonstrating this.
+You can then get a reference to this action in your code, and check its value, or attach a callback method to be notified when it is performed. See the [Actions Workflow page](xref:input-system-workflow-project-wide-actions) for a simple example script demonstrating this.
-Actions also make it simpler to create a system that lets your players [customize their bindings at runtime](ActionBindings.md#interactive-rebinding), which is a common requirement for games.
+Actions also make it simpler to create a system that lets your players [customize their bindings at runtime](xref:input-system-action-bindings#interactive-rebinding), which is a common requirement for games.
->**Notes:**
-> - Actions are a runtime only feature. You can't use them in [Editor window code](https://docs.unity3d.com/ScriptReference/EditorWindow.html).
+> [!NOTE]
+> - Actions are a runtime only feature. You can't use them in [Editor window code](xref:UnityEditor.EditorWindow).
>
-> - You can read input without using Actions and Bindings by directly reading specific device controls. This is less flexible, but can be quicker to implement for certain situations. Read more about [directly reading devices from script](Workflow-Direct.md).
+> - You can read input without using Actions and Bindings by directly reading specific device controls. This is less flexible, but can be quicker to implement for certain situations. Read more about [directly reading devices from script](xref:input-system-workflow-direct).
>
> - Although you can reorder actions in this window, the ordering is for visual convenience only, and does not affect the order in which the actions are triggered in your code. If multiple actions are performed in the same frame, the order in which they are reported by the input system is undefined. To avoid problems, you should not write code that assumes they will be reported in a particular order.
->
+
## Overview
@@ -33,24 +33,24 @@ When scripting with Actions in the Input System, there are number of important A
|API name|Description|
|-----|-----------|
-|[`InputSystem.actions`](../api/UnityEngine.InputSystem.InputSystem.html)|A reference to the set of actions assigned as the [project-wide Actions](./ProjectWideActions.md).|
-|[`InputActionMap`](../api/UnityEngine.InputSystem.InputActionMap.html)|A named collection of Actions. The API equivalent to an entry in the "Action Maps" column of the [Input Actions editor](ActionsEditor.md).|
-|[`InputAction`](../api/UnityEngine.InputSystem.InputAction.html)|A named Action that can return the current value of the controls that it is bound to, or can trigger callbacks in response to input. The API equivalent to an entry in the "Actions" column of the [Input Actions editor](ActionsEditor.md).|
-|[`InputBinding`](../api/UnityEngine.InputSystem.InputBinding.html)|The relationship between an Action and the specific device controls for which it receives input. For more information about Bindings and how to use them, see [Action Bindings](ActionBindings.md).|
+|[`InputSystem.actions`](xref:UnityEngine.InputSystem.InputSystem)|A reference to the set of actions assigned as the [project-wide Actions](xref:project-wide-actions).|
+|[`InputActionMap`](xref:UnityEngine.InputSystem.InputActionMap)|A named collection of Actions. The API equivalent to an entry in the "Action Maps" column of the [Input Actions editor](xref:input-system-configuring-input).|
+|[`InputAction`](xref:UnityEngine.InputSystem.InputAction)|A named Action that can return the current value of the controls that it is bound to, or can trigger callbacks in response to input. The API equivalent to an entry in the "Actions" column of the [Input Actions editor](xref:input-system-configuring-input).|
+|[`InputBinding`](xref:UnityEngine.InputSystem.InputBinding)|The relationship between an Action and the specific device controls for which it receives input. For more information about Bindings and how to use them, see [Action Bindings](xref:input-system-action-bindings).|
-Each Action has a name ([`InputAction.name`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_name)), which must be unique within the Action Map that the Action belongs to, if any (see [`InputAction.actionMap`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_actionMap)). Each Action also has a unique ID ([`InputAction.id`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_id)), which you can use to reference the Action. The ID remains the same even if you rename the Action.
+Each Action has a name ([`InputAction.name`](xref:UnityEngine.InputSystem.InputAction.name)), which must be unique within the Action Map that the Action belongs to, if any (see [`InputAction.actionMap`](xref:UnityEngine.InputSystem.InputAction.actionMap)). Each Action also has a unique ID ([`InputAction.id`](xref:UnityEngine.InputSystem.InputAction.id)), which you can use to reference the Action. The ID remains the same even if you rename the Action.
-Each Action Map has a name ([`InputActionMap.name`](../api/UnityEngine.InputSystem.InputActionMap.html#UnityEngine_InputSystem_InputActionMap_name)), which must also be unique with respect to the other Action Maps present, if any. Each Action Map also has a unique ID ([`InputActionMap.id`](../api/UnityEngine.InputSystem.InputActionMap.html#UnityEngine_InputSystem_InputActionMap_id)), which you can use to reference the Action Map. The ID remains the same even if you rename the Action Map.
+Each Action Map has a name ([`InputActionMap.name`](xref:UnityEngine.InputSystem.InputActionMap.name)), which must also be unique with respect to the other Action Maps present, if any. Each Action Map also has a unique ID ([`InputActionMap.id`](xref:UnityEngine.InputSystem.InputActionMap.id)), which you can use to reference the Action Map. The ID remains the same even if you rename the Action Map.
## Creating Actions
-The simplest way to create actions is to use the [Input Actions editor](ActionsEditor.md) in the Project Settings window. This is the primary recommended workflow and suitable for most scenarios.
+The simplest way to create actions is to use the [Input Actions editor](xref:input-system-configuring-input) in the Project Settings window. This is the primary recommended workflow and suitable for most scenarios.
However, because the input system API is very open, there are many other ways to create actions which may suit less common scenarios. For example, by loading actions from JSON data, or creating actions entirely in code.
### Creating Actions using the Action editor
-For information on how to create and edit Input Actions in the editor, see the [Input Actions editor](ActionsEditor.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.
+For information on how to create and edit Input Actions in the editor, see the [Input Actions editor](xref:input-system-configuring-input). 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.

*The Input Actions Editor in the Project Settings window*
@@ -58,11 +58,11 @@ For information on how to create and edit Input Actions in the editor, see the [
# Other ways to create Actions
-The simplest way to create actions is to use the [Input Actions editor](ActionsEditor.md) to configure a set of actions in an asset, as described above. However, because the Input System package API is open and flexible, you can create actions using alternative techniques. These alternatives might be more suitable if you want to customize your project beyond the standard workflow.
+The simplest way to create actions is to use the [Input Actions editor](xref:input-system-configuring-input) to configure a set of actions in an asset, as described above. However, because the Input System package API is open and flexible, you can create actions using alternative techniques. These alternatives might be more suitable if you want to customize your project beyond the standard workflow.
### Creating Actions by declaring them in MonoBehaviours
-As an alternative workflow, you can declare individual [Input Action](../api/UnityEngine.InputSystem.InputAction.html) and [Input Action Maps](../api/UnityEngine.InputSystem.InputActionMap.html) as fields directly inside `MonoBehaviour` components.
+As an alternative workflow, you can declare individual [Input Action](xref:UnityEngine.InputSystem.InputAction) and [Input Action Maps](xref:UnityEngine.InputSystem.InputActionMap) as fields directly inside `MonoBehaviour` components.
```CSharp
using UnityEngine;
@@ -77,7 +77,7 @@ public class ExampleScript : MonoBehaviour
The result is similar to using an Actions defined in the Input Actions editor, except the Actions are defined in the GameObject's properties and saved as Scene or Prefab data, instead of in a dedicated Asset.
-When you embed actions like this, by defining serialized InputAction fields in a MonoBehaviour, the GameObject's Inspector window displays an interface similar to the Actions column of the [Actions Editor](./ActionsEditor.md), which allows you to set up the bindings for those actions. For example:
+When you embed actions like this, by defining serialized InputAction fields in a MonoBehaviour, the GameObject's Inspector window displays an interface similar to the Actions column of the [Actions Editor](xref:input-system-configuring-input), which allows you to set up the bindings for those actions. For example:

@@ -92,7 +92,7 @@ When you use this workflow, the serialised action configurations are stored with
### Loading Actions from JSON
-You can load Actions as JSON in the form of a set of Action Maps or as a full [`InputActionAsset`](../api/UnityEngine.InputSystem.InputActionAsset.html). This also works at runtime in the Player.
+You can load Actions as JSON in the form of a set of Action Maps or as a full [`InputActionAsset`](xref:UnityEngine.InputSystem.InputActionAsset). This also works at runtime in the Player.
```CSharp
// Load a set of action maps from JSON.
@@ -137,7 +137,7 @@ Any action that you create in this way during Play mode do not persist in the In
Actions have an **enabled** state, meaning you can enable or disable them to suit different situations.
-If you have an Action Asset assigned as [project-wide](./ProjectWideActions.md), the actions it contains are enabled by default and ready to use.
+If you have an Action Asset assigned as [project-wide](xref:project-wide-actions), the actions it contains are enabled by default and ready to use.
For actions defined elsewhere, such as in an Action Asset not assigned as project-wide, or defined your own code, they begin in a disabled state, and you must enable them before they will respond to input.
@@ -151,8 +151,8 @@ lookAction.Enable();
gameplayActions.Enable();
```
-When you enable an Action, the Input System resolves its bindings, unless it has done so already, or if the set of devices that the Action can use has not changed. For more details about this process, see the documentation on [binding resolution](ActionBindings.md#binding-resolution).
+When you enable an Action, the Input System resolves its bindings, unless it has done so already, or if the set of devices that the Action can use has not changed. For more details about this process, see the documentation on [binding resolution](xref:input-system-action-bindings#binding-resolution).
-You can't change certain aspects of the configuration, such Action Bindings, while an Action is enabled. To stop Actions or Action Maps from responding to input, call [`Disable`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_Disable).
+You can't change certain aspects of the configuration, such Action Bindings, while an Action is enabled. To stop Actions or Action Maps from responding to input, call [`Disable`](xref:UnityEngine.InputSystem.InputAction.Disable).
-While enabled, an Action actively monitors the [Control(s)](Controls.md) it's bound to. If a bound Control changes state, the Action processes the change. If the Control's change represents an [Interaction](Interactions.md) change, the Action creates a response. All of this happens during the Input System update logic. Depending on the [update mode](Settings.md#update-mode) selected in the input settings, this happens once every frame, once every fixed update, or manually if updates are set to manual.
+While enabled, an Action actively monitors the [Control(s)](xref:input-system-controls) it's bound to. If a bound Control changes state, the Action processes the change. If the Control's change represents an [Interaction](xref:input-system-interactions) change, the Action creates a response. All of this happens during the Input System update logic. Depending on the [update mode](xref:input-system-settings#update-mode) selected in the input settings, this happens once every frame, once every fixed update, or manually if updates are set to manual.
diff --git a/Packages/com.unity.inputsystem/Documentation~/ActionsEditor.md b/Packages/com.unity.inputsystem/Documentation~/ActionsEditor.md
index 516d608cbc..f7bad06349 100644
--- a/Packages/com.unity.inputsystem/Documentation~/ActionsEditor.md
+++ b/Packages/com.unity.inputsystem/Documentation~/ActionsEditor.md
@@ -3,15 +3,15 @@ uid: input-system-configuring-input
---
# Configuring Input with the Actions Editor
-The **Input Actions Editor** allows you to edit [Action Assets](ActionAssets.md), which contain a saved configuration of [Input Actions](Actions.md) and their associated [Bindings](ActionBindings.md).
+The **Input Actions Editor** allows you to edit [Action Assets](xref:input-system-action-assets), which contain a saved configuration of [Input Actions](xref:input-system-actions) and their associated [Bindings](xref:input-system-action-bindings).
It allows you to group collections of Actions into [Action Maps](ActionsEditor.html#configure-action-maps), which represent different input scenarios in your project (such as UI navigation, gameplay, etc.)
-It also allows you to define [Control Schemes](ActionBindings.md#control-schemes) which are a way to enable or disable a set of devices, or respond to which type of device is being used. This is often useful if you want to customise your UI based on whether your users are using mouse, keyboard, or gamepad as their chosen input.
+It also allows you to define [Control Schemes](xref:input-system-action-bindings#control-schemes) which are a way to enable or disable a set of devices, or respond to which type of device is being used. This is often useful if you want to customise your UI based on whether your users are using mouse, keyboard, or gamepad as their chosen input.
### Action Assets and Project-Wide Actions
-The typical workflow for most projects is to have a single Action Asset, which is assigned as the **project-wide actions**. If you have not yet created and assigned an Actions Asset as the project-wide actions, the recommended workflow is to do this first. Read more about [project-wide actions](ProjectWideActions.md).
+The typical workflow for most projects is to have a single Action Asset, which is assigned as the **project-wide actions**. If you have not yet created and assigned an Actions Asset as the project-wide actions, the recommended workflow is to do this first. Read more about [project-wide actions](xref:project-wide-actions).
### Opening the Actions Editor
@@ -19,8 +19,8 @@ The **Input Actions Editor** is an editor window displayed when you open an Acti
It is also displayed in the Project Settings window under **Edit** > **Project Settings** > **Input System Package** if you have an Action Asset assigned as project-wide.
-
-*The Input Actions editor, displaying the default actions*
+
+*The Input Actions editor, displaying the three panels and the default actions*
### The Actions Editor panels
@@ -82,20 +82,20 @@ There are more specific control types available which further filter the availab
You can add multiple bindings to an action, which is generally useful for supporting multiple types of input device. For example, in the default set of actions, the "Move" action has a binding to the left gamepad stick and the WSAD keys, which means input through any of these bindings will perform the action.
-
-_The default "Move" action in the Actions Editor window, displaying the multiple bindings associated with it._
+
+_The default Move action in the Actions Editor window, displaying the multiple bindings associated with it._
If you select a Binding, you can edit its properties in the right-hand pane of the window:
-
+![The Binding Properties panel displays the Path value as Left Stick [Gamepad].](Images/BindingProperties.png)
#### Picking Controls
-The most important property of any Binding is the [control path](Controls.md#control-paths) it's bound to. To edit it, open the __Path__ drop-down list. This displays a Control picker window.
+The most important property of any Binding is the [control path](xref:input-system-controls#control-paths) it's bound to. To edit it, open the __Path__ dropdown menu. This displays a Control picker window.
-
+
-In the Control picker window, you can explore a tree of Input Devices and Controls that the Input System recognizes, and bind to these Controls. Unity filters this list by the Action's [`Control Type`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_expectedControlType) property. For example, if the Control type is `Vector2`, you can only select a Control that generates two-dimensional values, like a stick.
+In the Control picker window, you can explore a tree of Input Devices and Controls that the Input System recognizes, and bind to these Controls. Unity filters this list by the Action's [`Control Type`](xref:UnityEngine.InputSystem.InputAction.expectedControlType) property. For example, if the Control type is `Vector2`, you can only select a Control that generates two-dimensional values, like a stick.
The Device and Control tree is organized hierarchically from generic to specific. For example, the __Gamepad__ Control path `/buttonSouth` matches the lower action button on any gamepad. Alternatively, if you navigate to __Gamepad__ > __More Specific Gamepads__ and select __PS4 Controller__, and then choose the Control path `/buttonSouth`, this only matches the "Cross" button on PlayStation gamepads, and doesn't match any other gamepads.
@@ -105,35 +105,37 @@ Finally, you can choose to manually edit the Binding path, instead of using the
#### Editing Composite Bindings
-Composite Bindings are Bindings consisting of multiple parts, which form a Control together. For instance, a [2D Vector Composite](ActionBindings.md#2d-vector) uses four buttons (left, right, up, down) to simulate a 2D stick input. See the [Composite Bindings](ActionBindings.md#composite-bindings) documentation to learn more.
+Composite Bindings are Bindings consisting of multiple parts, which form a Control together. For instance, a [2D Vector Composite](xref:input-system-action-bindings#2d-vector) uses four buttons (left, right, up, down) to simulate a 2D stick input. See the [Composite Bindings](xref:input-system-action-bindings#composite-bindings) documentation to learn more.
+
+{width="486" height="178"}
-
To create a Composite Binding, in the Input Action Asset editor window, select the Add (+) icon on the Action you want to add it to, and select the Composite Binding type from the popup menu.
-
+{width="486" height="199"}
This creates multiple Binding entries for the Action: one for the Composite as a whole, and then, one level below that, one for each Composite part. The Composite itself doesn't have a Binding path property, but its individual parts do, and you can edit these parts like any other Binding. Once you bind all the Composite's parts, the Composite can work together as if you bound a single control to the Action.
-**Note**: The set of Composites displayed in the menu is depends on the value type of the Action. This means that, for example, if the Action is set to type "Button", then only Composites able to return values of type `float` will be shown.
+> [!NOTE]
+> The set of Composites displayed in the menu is depends on the value type of the Action. This means that, for example, if the Action is set to type "Button", then only Composites able to return values of type `float` will be shown.
To change the type of a Composite retroactively, select the Composite, then select the new type from the **Composite Type** drop-down in the **Properties** pane.
-
+{width="486" height="184"}
To change the part of the Composite to which a particular Binding is assigned, use the **Composite Part** drop-down in the Binding's properties.
-
+{width="486" height="161"}
You can assign multiple Bindings to the same part. You can also duplicate individual part Bindings: right-click the Binding, then select **Duplicate** to create new part Bindings for the Composite. This can be used, for example, to create a single Composite for both "WASD" style controls and arrow keys.
-
+{width="486" height="214"}
### Editing Control Schemes
-Input Action Assets can have multiple [Control Schemes](ActionBindings.md#control-schemes), which let you enable or disable different sets of Bindings for your Actions for different types of Devices.
+Input Action Assets can have multiple [Control Schemes](xref:input-system-action-bindings#control-schemes), which let you enable or disable different sets of Bindings for your Actions for different types of Devices.
-
+
To see the Control Schemes in the Input Action Asset editor window, open the Control Scheme drop-down list in the top left of the window. This menu lets you add or remove Control Schemes to your Actions Asset. If the Actions Asset contains any Control Schemes, you can select a Control Scheme, and then the window only shows bindings that are associated with that Scheme. If you select a binding, you can now pick the Control Schemes for which this binding should be active in the __Properties__ view to the left of the window.
diff --git a/Packages/com.unity.inputsystem/Documentation~/Architecture.md b/Packages/com.unity.inputsystem/Documentation~/Architecture.md
index 6b764ab258..bbd82ab672 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Architecture.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Architecture.md
@@ -9,9 +9,9 @@ The Input System has a layered architecture that consists of a low-level layer a
The foundation of the Input System is the native backend code. This is platform-specific code which collects information about available Devices and input data from Devices. This code is not part of the Input System package, but is included with Unity itself. It has implementations for each runtime platform supported by Unity. This is why some platform-specific input bugs can only be fixed by an update to Unity, rather than a new version of the Input System package.
-The Input System interfaces with the native backend using [events](Events.md) that the native backend sends. These events notify the system of the creation and removal of [Input Devices](Devices.md), as well as any updates to the Device states. For efficiency and to avoid creating any garbage, the native backend reports these events as a simple buffer of raw, unmanaged memory containing a stream of events.
+The Input System interfaces with the native backend using [events](xref:input-system-events) that the native backend sends. These events notify the system of the creation and removal of [Input Devices](xref:input-system-devices), as well as any updates to the Device states. For efficiency and to avoid creating any garbage, the native backend reports these events as a simple buffer of raw, unmanaged memory containing a stream of events.
-The Input System can also send data back to the native backend in the form of [commands](Devices.md#device-commands) sent to Devices, which are also buffers of memory that the native backend interprets. These commands can have different meanings for different Device types and platforms.
+The Input System can also send data back to the native backend in the form of [commands](xref:input-system-devices#device-commands) sent to Devices, which are also buffers of memory that the native backend interprets. These commands can have different meanings for different Device types and platforms.
# Input System (low-level)
@@ -19,7 +19,7 @@ The Input System can also send data back to the native backend in the form of [c
The low-level Input System code processes and interprets the memory from the event stream that the native backend provides, and dispatches individual events.
-The Input System creates Device representations for any newly discovered Device in the event stream. The low-level code sees a Device as a block of raw, unmanaged memory. If it receives a state event for a Device, it writes the data from the state event into the Device's [state representation](Controls.md#control-state) in memory, so that the state always contains an up-to-date representation of the Device and all its Controls.
+The Input System creates Device representations for any newly discovered Device in the event stream. The low-level code sees a Device as a block of raw, unmanaged memory. If it receives a state event for a Device, it writes the data from the state event into the Device's [state representation](xref:input-system-controls#control-state) in memory, so that the state always contains an up-to-date representation of the Device and all its Controls.
The low-level system code also contains structs which describe the data layout of commonly known Devices.
@@ -27,8 +27,8 @@ The low-level system code also contains structs which describe the data layout o

-The high-level Input System code interprets the data in a Device's state buffers by using [layouts](Layouts.md), which describe the data layout of a Device and its Controls in memory. The Input System creates layouts from either the pre-defined structs of commonly known Devices supplied by the low level system, or dynamically at runtime, as in the case of [generic HIDs](HID.md#auto-generated-layouts).
+The high-level Input System code interprets the data in a Device's state buffers by using [layouts](xref:input-system-layouts), which describe the data layout of a Device and its Controls in memory. The Input System creates layouts from either the pre-defined structs of commonly known Devices supplied by the low level system, or dynamically at runtime, as in the case of [generic HIDs](xref:input-system-hid#auto-generated-layouts).
-Based on the information in the layouts, the Input System then creates [Control](Controls.md) representations for each of the Device's controls, which let you read the state of each individual Control in a Device.
+Based on the information in the layouts, the Input System then creates [Control](xref:input-system-controls) representations for each of the Device's controls, which let you read the state of each individual Control in a Device.
-As part of the high-level system, you can also build another abstraction layer to map Input Controls to your application mechanics. Use [Actions](Actions.md) to [bind](ActionBindings.md) one or more Controls to an input in your application. The Input System then monitors these Controls for state changes, and notifies your game logic using [callbacks](RespondingToActions.md#responding-to-actions-using-callbacks). You can also specify more complex behaviors for your Actions using [Processors](UsingProcessors.md) (which perform processing on the input data before sending it to you) and [Interactions](Interactions.md) (which let you specify patterns of input on a Control to listen to, such as multi-taps).
+As part of the high-level system, you can also build another abstraction layer to map Input Controls to your application mechanics. Use [Actions](xref:input-system-actions) to [bind](xref:input-system-action-bindings) one or more Controls to an input in your application. The Input System then monitors these Controls for state changes, and notifies your game logic using [callbacks](xref:input-system-responding#responding-to-actions-using-callbacks). You can also specify more complex behaviors for your Actions using [Processors](UsingProcessors.md) (which perform processing on the input data before sending it to you) and [Interactions](xref:input-system-interactions) (which let you specify patterns of input on a Control to listen to, such as multi-taps).
diff --git a/Packages/com.unity.inputsystem/Documentation~/Concepts.md b/Packages/com.unity.inputsystem/Documentation~/Concepts.md
index 1ed32098e3..e9bb07c058 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Concepts.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Concepts.md
@@ -13,7 +13,7 @@ This page introduces the basic concepts that relate to working with the Input Sy
|[**Input Device**](SupportedDevices.html)| Often referred to just as a "**device**" within the context of input. A physical piece of hardware, such as a keyboard, gamepad, mouse, or touchscreen which allows the user to send input into Unity.|
|[**Control**](Controls.html)|The separate individual parts of an input device which each send input values into Unity. For example, a gamepad’s **controls** comprise multiple buttons, sticks and triggers, and a mouse’s controls include the two X and Y sensors on the underside, and the various buttons and scroll wheels on the top side.|
|[**Action**](Actions.html)| Actions are a high-level concept that describe individual things that a user might want to do in your game or app, such as "Jump" within a game, or "Select" in an on-screen UI. They are things a user can do in your game or app as a result of input, regardless of what device or control they use to perform it. Actions generally have conceptual names that you choose to suit your project, and should usually be verbs. For example "Run", "Jump" "Crouch", "Use", "Start", "Quit".|
-|[**Action Map**](ActionsEditor.html#configure-action-maps) | Action Maps allow you to organise Actions into groups which represent specific situations where a set of actions make sense together. You can simultaneously enable or disable all Actions in an action map, so it is useful to group Actions in Action Maps by the context in which they are relevant. For example, you might have one action map for controlling a player, and another for interacting with your game's UI.|
-|[**Binding**](ActionBindings.html)| A connection defined between an **Action** and specific device controls. For example, your "Move" action might have bindings to the arrow keys and WSAD keys on the keyboard, and the left stick on a joypad, and the primary 2D axis on a VR controller. Multiple bindings like this means your game can accept cross-platform input. |
-|[**Your Action Code**](RespondingToActions.md)| The part of your script which is executed based on the actions you have configured. In your code, you can use references to actions to either read the current value or state of the action (also known as "polling"), or set up a callback to call your own method when actions are performed.|
-|[**Action Asset**](ActionAssets.md) | An asset type which contains a saved configuration of Action Maps, Actions and Bindings. You can specify one Action Asset in your project as the [project-wide actions](ProjectWideActions.md), which allows you to easily reference those actions in code by using [`InputSystem.actions`](../api/UnityEngine.InputSystem.InputSystem.html). |
+|[**Action Map**](ActionsEditor.html#configure-action-maps) | Action Maps allow you to organize Actions into groups which represent specific situations where a set of actions make sense together. You can simultaneously enable or disable all Actions in an action map, so it is useful to group Actions in Action Maps by the context in which they are relevant. For example, you might have one action map for controlling a player, and another for interacting with your game's UI.|
+|[**Binding**](ActionBindings.html)| A connection defined between an **Action** and specific device controls. There are two main types of bindings:**Normal** bindings directly bind to control(s) by means of a [control path](xref:input-system-controls#control-paths). At runtime, any path that matches one or multiple controls will feed input into the binding. **Composite** bindings don't bind to controls themselves. Instead, they receive their input from their **Part** bindings and then return a value representing a composition of those inputs. For example, the right trigger on the gamepad can act as a strength multiplier on the value of the left stick. |
+|[**Your Action Code**](xref:input-system-responding)| The part of your script which is executed based on the actions you have configured. In your code, you can use references to actions to either read the current value or state of the action (also known as "polling"), or set up a callback to call your own method when actions are performed.|
+|[**Action Asset**](xref:input-system-action-assets) | An asset type which contains a saved configuration of Action Maps, Actions and Bindings. You can specify one Action Asset in your project as the [project-wide actions](xref:project-wide-actions), which allows you to easily reference those actions in code by using [`InputSystem.actions`](xref:UnityEngine.InputSystem.InputSystem). |
diff --git a/Packages/com.unity.inputsystem/Documentation~/Contributing.md b/Packages/com.unity.inputsystem/Documentation~/Contributing.md
index ad1e654e45..6696dba1a1 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Contributing.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Contributing.md
@@ -5,7 +5,8 @@ uid: input-system-contributing
The [full source code](https://github.com/Unity-Technologies/InputSystem) for the Input System is available on GitHub. This is also where most of the Input System's development happens.
->__Note__: This includes the full source code for the managed/C# part of the system. At this point, the native, platform-specific C++ backends are still closed-source and require a source code license.
+> [!NOTE]
+> This includes the full source code for the managed/C# part of the system. At this point, the native, platform-specific C++ backends are still closed-source and require a source code license.
## Reporting bugs
diff --git a/Packages/com.unity.inputsystem/Documentation~/Controls.md b/Packages/com.unity.inputsystem/Documentation~/Controls.md
index a728fb5d1a..806adfb003 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Controls.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Controls.md
@@ -3,68 +3,59 @@ uid: input-system-controls
---
# Controls
-* [Hierarchies](#control-hierarchies)
-* [Types](#control-types)
-* [Usages](#control-usages)
-* [Paths](#control-paths)
-* [State](#control-state)
-* [Actuation](#control-actuation)
-* [Noisy Controls](#noisy-controls)
-* [Synthetic Controls](#synthetic-controls)
-* [Performance Optimization](#performance-optimization)
+An input control represents a source of values. These values can be of any structured or primitive type. The only requirement is that the type is [blittable](https://docs.microsoft.com/en-us/dotnet/framework/interop/blittable-and-non-blittable-types).
-An Input Control represents a source of values. These values can be of any structured or primitive type. The only requirement is that the type is [blittable](https://docs.microsoft.com/en-us/dotnet/framework/interop/blittable-and-non-blittable-types).
+> [!NOTE]
+> Controls are for input only. Output and configuration items on input devices are not represented as controls.
->__Note__: Controls are for input only. Output and configuration items on Input Devices are not represented as Controls.
+## Identification
-Each Control is identified by a name ([`InputControl.name`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_name)) and can optionally have a display name ([`InputControl.displayName`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_displayName)) that differs from the Control name. For example, the right-hand face button closest to the touchpad on a PlayStation DualShock 4 controller has the control name "buttonWest" and the display name "Square".
+Each control is identified by its [name](xref:UnityEngine.InputSystem.InputControl.name). Optionally, it can also have a different [display name](xref:UnityEngine.InputSystem.InputControl.displayName). For example, the right-hand face button closest to the touchpad on a PlayStation DualShock 4 controller has the control name "buttonWest" and the display name "Square".
-Additionally, a Control might have one or more aliases which provide alternative names for the Control. You can access the aliases for a specific Control through its [`InputControl.aliases`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_aliases) property.
+Additionally, a control might have one or more aliases which provide alternative names for the control. You can access the aliases for a specific control through its [`aliases`](xref:UnityEngine.InputSystem.InputControl.aliases) property.
-Finally, a Control might also have a short display name which can be accessed through the [`InputControl.shortDisplayName`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_shortDisplayName) property. For example, the short display name for the left mouse button is "LMB".
+Finally, a control might also have a short display name which can be accessed through the [`shortDisplayName`](xref:UnityEngine.InputSystem.InputControl.shortDisplayName) property. For example, the short display name for the left mouse button is "LMB".
## Control hierarchies
-Controls can form hierarchies. The root of a Control hierarchy is always a [Device](Devices.md).
+Controls can form hierarchies. The root of a control hierarchy is always a [device](xref:input-system-devices).
-The setup of hierarchies is exclusively controlled through [layouts](Layouts.md).
+The setup of hierarchies is exclusively controlled through [layouts](xref:input-system-layouts).
-You can access the parent of a Control using [`InputControl.parent`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_parent), and its children using [`InputControl.children`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_children). To access the flattened hierarchy of all Controls on a Device, use [`InputDevice.allControls`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_allControls).
+You can access the parent of a control using its [`parent`](xref:UnityEngine.InputSystem.InputControl.parent) property, and its children using [`children`](xref:UnityEngine.InputSystem.InputControl.children). To access the flattened hierarchy of all controls on a device, use [`allControls`](xref:UnityEngine.InputSystem.InputDevice.allControls).
## Control types
-All controls are based on the [`InputControl`](../api/UnityEngine.InputSystem.InputControl.html) base class. Most concrete implementations are based on [`InputControl`](../api/UnityEngine.InputSystem.InputControl-1.html).
+All controls are based on the [`InputControl`](xref:UnityEngine.InputSystem.InputControl) base class. Most concrete implementations are based on [InputControl](xref:UnityEngine.InputSystem.InputControl`1).
The Input System provides the following types of controls out of the box:
|Control Type|Description|Example|
|------------|-----------|-------|
-|[`AxisControl`](../api/UnityEngine.InputSystem.Controls.AxisControl.html)|A 1D floating-point axis.|[`Gamepad.leftStick.x`](../api/UnityEngine.InputSystem.Controls.Vector2Control.html#UnityEngine_InputSystem_Controls_Vector2Control_x)|
-|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|A button expressed as a floating-point value. Whether the button can have a value other than 0 or 1 depends on the underlying representation. For example, gamepad trigger buttons can have values other than 0 and 1, but gamepad face buttons generally can't.|[`Mouse.leftButton`](../api/UnityEngine.InputSystem.Mouse.html#UnityEngine_InputSystem_Mouse_leftButton)|
-|[`KeyControl`](../api/UnityEngine.InputSystem.Controls.KeyControl.html)|A specialized button that represents a key on a [`Keyboard`](../api/UnityEngine.InputSystem.Keyboard.html). Keys have an associated [`keyCode`](../api/UnityEngine.InputSystem.Controls.KeyControl.html#UnityEngine_InputSystem_Controls_KeyControl_keyCode) and, unlike other types of Controls, change their display name in accordance to the currently active system-wide keyboard layout. See the [Keyboard](Keyboard.md) documentation for details.|[`Keyboard.aKey`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_aKey)|
-|[`Vector2Control`](../api/UnityEngine.InputSystem.Controls.Vector2Control.html)|A 2D floating-point vector.|[`Pointer.position`](../api/UnityEngine.InputSystem.Pointer.html#UnityEngine_InputSystem_Pointer_position)|
-|[`Vector3Control`](../api/UnityEngine.InputSystem.Controls.Vector3Control.html)|A 3D floating-point vector.|[`Accelerometer.acceleration`](../api/UnityEngine.InputSystem.Accelerometer.html#UnityEngine_InputSystem_Accelerometer_acceleration)|
-|[`QuaternionControl`](../api/UnityEngine.InputSystem.Controls.QuaternionControl.html)|A 3D rotation.|[`AttitudeSensor.attitude`](../api/UnityEngine.InputSystem.AttitudeSensor.html#UnityEngine_InputSystem_AttitudeSensor_attitude)|
-|[`IntegerControl`](../api/UnityEngine.InputSystem.Controls.IntegerControl.html)|An integer value.|[`Touchscreen.primaryTouch.touchId`](../api/UnityEngine.InputSystem.Controls.TouchControl.html#UnityEngine_InputSystem_Controls_TouchControl_touchId)|
-|[`StickControl`](../api/UnityEngine.InputSystem.Controls.StickControl.html)|A 2D stick control like the thumbsticks on gamepads or the stick control of a joystick.|[`Gamepad.rightStick`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_rightStick)|
-|[`DpadControl`](../api/UnityEngine.InputSystem.Controls.DpadControl.html)|A 4-way button control like the D-pad on gamepads or hatswitches on joysticks.|[`Gamepad.dpad`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_dpad)|
-|[`TouchControl`](../api/UnityEngine.InputSystem.Controls.TouchControl.html)|A control that represents all the properties of a touch on a [touch screen](Touch.md).|[`Touchscreen.primaryTouch`](../api/UnityEngine.InputSystem.Touchscreen.html#UnityEngine_InputSystem_Touchscreen_primaryTouch)|
-
-You can browse the set of all registered control layouts in the [input debugger](Debugging.md#debugging-layouts).
+|[`AxisControl`](xref:UnityEngine.InputSystem.Controls.AxisControl)|A 1D floating-point axis.|[`Gamepad.leftStick.x`](xref:UnityEngine.InputSystem.Controls.Vector2Control.x)|
+|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|A button expressed as a floating-point value. Whether the button can have a value other than 0 or 1 depends on the underlying representation. For example, gamepad trigger buttons can have values other than 0 and 1, but gamepad face buttons generally can't.|[`Mouse.leftButton`](xref:UnityEngine.InputSystem.Mouse.leftButton)|
+|[`KeyControl`](xref:UnityEngine.InputSystem.Controls.KeyControl)|A specialized button that represents a key on a [`Keyboard`](xref:UnityEngine.InputSystem.Keyboard). Keys have an associated [`keyCode`](xref:UnityEngine.InputSystem.Controls.KeyControl.keyCode) and, unlike other types of controls, change their display name in accordance to the currently active system-wide keyboard layout. See the [Keyboard](xref:input-system-keyboard) documentation for details.|[`Keyboard.aKey`](xref:UnityEngine.InputSystem.Keyboard.aKey)|
+|[`Vector2Control`](xref:UnityEngine.InputSystem.Controls.Vector2Control)|A 2D floating-point vector.|[`Pointer.position`](xref:UnityEngine.InputSystem.Pointer.position)|
+|[`Vector3Control`](xref:UnityEngine.InputSystem.Controls.Vector3Control)|A 3D floating-point vector.|[`Accelerometer.acceleration`](xref:UnityEngine.InputSystem.Accelerometer.acceleration)|
+|[`QuaternionControl`](xref:UnityEngine.InputSystem.Controls.QuaternionControl)|A 3D rotation.|[`AttitudeSensor.attitude`](xref:UnityEngine.InputSystem.AttitudeSensor.attitude)|
+|[`IntegerControl`](xref:UnityEngine.InputSystem.Controls.IntegerControl)|An integer value.|[`Touchscreen.primaryTouch.touchId`](xref:UnityEngine.InputSystem.Controls.TouchControl.touchId)|
+|[`StickControl`](xref:UnityEngine.InputSystem.Controls.StickControl)|A 2D stick control like the thumbsticks on gamepads or the stick control of a joystick.|[`Gamepad.rightStick`](xref:UnityEngine.InputSystem.Gamepad.rightStick)|
+|[`DpadControl`](xref:UnityEngine.InputSystem.Controls.DpadControl)|A 4-way button control like the D-pad on gamepads or hatswitches on joysticks.|[`Gamepad.dpad`](xref:UnityEngine.InputSystem.Gamepad.dpad)|
+|[`TouchControl`](xref:UnityEngine.InputSystem.Controls.TouchControl)|A control that represents all the properties of a touch on a [touch screen](xref:input-system-touch).|[`Touchscreen.primaryTouch`](xref:UnityEngine.InputSystem.Touchscreen.primaryTouch)|
+
+You can browse the set of all registered control layouts in the [input debugger](xref:input-system-debugging#debugging-layouts).
## Control usages
-A Control can have one or more associated usages. A usage is a string that denotes the Control's intended use. An example of a Control usage is `Submit`, which labels a Control that is commonly used to confirm a selection in the UI. On a gamepad, this usage is commonly found on the `buttonSouth` Control.
+A control can have one or more associated usages. A usage is a string that denotes the control's intended use. An example of a control usage is `Submit`, which labels a control that is commonly used to confirm a selection in the UI. On a gamepad, this usage is commonly found on the `buttonSouth` control.
-You can access a Control's usages using the [`InputControl.usages`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_usages) property.
+You can access a control's usages using the [`InputControl.usages`](xref:UnityEngine.InputSystem.InputControl.usages) property.
-Usages can be arbitrary strings. However, a certain set of usages is very commonly used and comes predefined in the API in the form of the [`CommonUsages`](../api/UnityEngine.InputSystem.CommonUsages.html) static class. Check out the [`CommonUsages` scripting API page](../api/UnityEngine.InputSystem.CommonUsages.html) for an overview.
+Usages can be arbitrary strings. However, a certain set of usages is very commonly used and comes predefined in the API in the [`CommonUsages`](xref:UnityEngine.InputSystem.CommonUsages) static class.
## Control paths
->Example: `/leftStick/x` means "X Control on left stick of gamepad".
-
-The Input System can look up Controls using textual paths. [Bindings](ActionBindings.md) on Input Actions rely on this feature to identify the Control(s) they read input from. 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`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_FindControls_System_String_).
+The Input System can look up controls using textual paths. [Bindings](xref:input-system-action-bindings) on Input Actions rely on this feature to identify the control(s) they read input from. For example, `/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)):
```CSharp
var gamepad = Gamepad.all[0];
@@ -73,26 +64,17 @@ var submitButton = gamepad["{Submit}"];
var allSubmitButtons = InputSystem.FindControls("*/{Submit}");
```
-Control paths resemble file system paths. Each path consists of one or more components separated by a forward slash:
+Control paths resemble file system paths: they contain components separated by a forward slash (`/`):
component/component...
-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.
-
- {usageName}controlName#(displayName)
-
-The following table explains the use of each field:
-
-|Field|Description|Example|
-|-----|-----------|-------|
-|``|Requires the Control at the current level to be based on the given layout. The actual layout of the Control may be the same or a layout *based* on the given layout.|`/buttonSouth`|
-|`{usageName}`|Works differently for Controls and Devices. When used on a Device (the first component of a path), it requires the device to have the given usage. See [Device usages](Devices.md#device-usages) for more details. For looking up a Control, the usage field is currently restricted to the path component immediately following the Device (the second component in the path). It finds the Control on the Device that has the given usage. The Control can be anywhere in the Control hierarchy of the Device.|Device: `{LeftHand}/trigger` Control: `/{Submit}`|
-|`controlName`|Requires the Control at the current level to have the given name. Takes both "proper" names ([`InputControl.name`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_name)) and aliases ([`InputControl.aliases`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_aliases)) into account. This field can also be a wildcard (`*`) to match any name.|`MyGamepad/buttonSouth` `*/{PrimaryAction}` (match `PrimaryAction` usage on Devices with any name)|
-|`#(displayName)`|Requires the Control at the current level to have the given display name (i.e. [`InputControl.displayName`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_displayName)). The display name may contain whitespace and symbols.|`/#(a)` (matches the key that generates the "a" character, if any, according to the current keyboard layout). `/#(Cross)`|
+Each component itself contains a set of [fields](#component-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:
-You can access the literal path of a given control via its [`InputControl.path`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_path) property.
+```structured text
+{usageName}#(displayName)controlName
+```
-If needed, you can manually parse a control path into its components using the [`InputControlPath.Parse(path)`](../api/UnityEngine.InputSystem.InputControlPath.html#UnityEngine_InputSystem_InputControlPath_Parse_System_String_) API.
+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:
```CSharp
var parsed = InputControlPath.Parse("{LeftHand}/trigger").ToArray();
@@ -105,23 +87,53 @@ Debug.Log(parsed[1].layout); // Prints null.
Debug.Log(parsed[1].name); // Prints "trigger".
```
+### Component fields
+
+All fields are case-insensitive.
+
+The following table explains the use of each field:
+
+|Field|Description|Related links|
+|-----|-----|------------------|
+|`layoutName`|The name of the layout that the control must be based on. The actual layout of the control may be the same or a layout *based* on the given layout. For example, ``.|The [Layouts](xref:input-system-layouts) user manual topic The [InputControlLayout](xref:UnityEngine.InputSystem.Layouts.InputControlLayout) class|
+|`usageName`|Works differently for controls and devices:When used on a device (the first component of a path), it requires the device to have the given usage. For example, `{LeftHand}/trigger`. For looking up a control, the usage field is currently restricted to the path component immediately following the device (the second component in the path). It finds the control on the device that has the given usage. The control can be anywhere in the control hierarchy of the device. For example, `/{Submit}`. |The [Device usages](xref:input-system-devices#device-usages) user manual topic The [Control usages](#control-usages) topic on this page< The [InputControl.usages](xref:UnityEngine.InputSystem.Layouts.InputControlLayout) property|
+|`displayName`|Requires the control at the current level to have the given display name. The display name may contain whitespace and symbols. For example:`/#(a)` matches the key that generates the "a" character, if any, according to the current keyboard layout. `/#(Cross)` matches the button named "Cross" on the Gamepad. |The [Identification](#identification) topic on this page The [InputControl.displayName](xref:UnityEngine.InputSystem.InputControl.displayName) property|
+|`controlName`|Requires the control at the current level to have the given name. Takes both "proper" names such as `MyGamepad/buttonSouth`, and aliases such as `MyGamepad/South` into account. This field can also be a wildcard (`*`) to match any name. For example, `*/{PrimaryAction}` matches any `PrimaryAction` usage on devices with any name.|The [Identification](#identification) topic on this page The [InputControl.name](xref:UnityEngine.InputSystem.InputControl.name) property for "proper" names The [InputControl.aliases](xref:UnityEngine.InputSystem.InputControl.aliases) property for aliases|
+
+Here are several examples of control paths:
+
+```csharp
+// Matches all gamepads (also gamepads *based* on the Gamepad layout):
+""
+// Matches the "Submit" control on all devices:
+"*/"
+// Matches the key that prints the "a" character on the current keyboard layout:
+"/#(a)"
+// Matches the X axis of the left stick on a gamepad.
+"/leftStick/x"
+// Matches the orientation control of the right-hand XR controller:
+"/orientation"
+// Matches all buttons on a gamepad.
+"/"
+```
+
## Control state
-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`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_stateBlock) property.
+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.stateBlock) property.
-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.
+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.
-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.
+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](xref:input-system-layouts) to understand this representation.
-You can access the current state of a Control through its [`ReadValue`](../api/UnityEngine.InputSystem.InputControl-1.html#UnityEngine_InputSystem_InputControl_1_ReadValue) method.
+You can access the current state of a control through its [`ReadValue`](xref:UnityEngine.InputSystem.InputControl`1.ReadValue) method.
```CSharp
Gamepad.current.leftStick.x.ReadValue();
```
-Each type of Control has a specific type of values that it returns, regardless of how many different types of formats it supports for its state. You can access this value type through the [`InputControl.valueType`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_valueType) property.
+Each type of control has a specific type of values that it returns, regardless of how many different types of formats it supports for its state. You can access this value type through the [`InputControl.valueType`](xref:UnityEngine.InputSystem.InputControl.valueType) property.
-Reading a value from a Control might apply one or more value Processors. See documentation on [Processors](UsingProcessors.md) for more information.
+Reading a value from a control might apply one or more value Processors. Refer to the documentation on [Processors](UsingProcessors.md) for more information.
[//]: # (#### Default State - TODO)
@@ -129,9 +141,7 @@ Reading a value from a Control might apply one or more value Processors. See doc
#### Recording state history
-You might want to access the history of value changes on a Control (for example, in order to compute exit velocity on a touch release).
-
-To record state changes over time, you can use [`InputStateHistory`](../api/UnityEngine.InputSystem.LowLevel.InputStateHistory.html) or [`InputStateHistory`](../api/UnityEngine.InputSystem.LowLevel.InputStateHistory-1.html). The latter restricts Controls to those of a specific value type, which in turn simplifies some of the API.
+If you want to access the history of value changes on a control (for example, in order to compute exit velocity on a touch release), you can record state changes over time with [`InputStateHistory`](xref:UnityEngine.InputSystem.LowLevel.InputStateHistory) or [`InputStateHistory`](xref:UnityEngine.InputSystem.LowLevel.InputStateHistory`1). The latter restricts controls to those of a specific value type, which in turn simplifies some of the API.
```CSharp
// Create history that records Vector2 control value changes.
@@ -185,7 +195,7 @@ history.StartRecording();
## Control actuation
-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. You can query whether a Control is currently actuated using [`IsActuated`](../api/UnityEngine.InputSystem.InputControlExtensions.html#UnityEngine_InputSystem_InputControlExtensions_IsActuated_UnityEngine_InputSystem_InputControl_System_Single_).
+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.
```CSharp
// Check if leftStick is currently actuated.
@@ -193,11 +203,11 @@ if (Gamepad.current.leftStick.IsActuated())
Debug.Log("Left Stick is actuated");
```
-It can be useful to determine not just whether a Control is actuated at all, but also the amount by which it is actuated (that is, its magnitude). For example, for a [`Vector2Control`](../api/UnityEngine.InputSystem.Controls.Vector2Control.html) this would be the length of the vector, whereas for a button it is the raw, absolute floating-point value.
+It can be useful to determine not just whether a control is actuated at all, but also the amount by which it is actuated (that is, its magnitude). For example, for a [`Vector2Control`](xref:UnityEngine.InputSystem.Controls.Vector2Control) this would be the length of the vector, whereas for a button it is the raw, absolute floating-point value.
-In general, the current magnitude of a Control is always >= 0. However, a Control might not have a meaningful magnitude, in which case it returns -1. Any negative value should be considered an invalid magnitude.
+In general, the current magnitude of a control is always >= 0. However, a control might not have a meaningful magnitude, in which case it returns -1. Any negative value should be considered an invalid magnitude.
-You can query the current amount of actuation using [`EvaluateMagnitude`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_EvaluateMagnitude).
+You can query the current amount of actuation using [`EvaluateMagnitude`](xref:UnityEngine.InputSystem.InputControl.EvaluateMagnitude).
```CSharp
// Check if left stick is actuated more than a quarter of its motion range.
@@ -205,81 +215,98 @@ if (Gamepad.current.leftStick.EvaluateMagnitude() > 0.25f)
Debug.Log("Left Stick actuated past 25%");
```
-There are two mechanisms that most notably make use of Control actuation:
+These two mechanisms use control actuation:
+
+- [Interactive rebinding](xref:input-system-action-bindings#interactive-rebinding) (`InputActionRebindingExceptions.RebindOperation`) uses it to select between multiple suitable controls to find the one that is actuated the most.
+- [Conflict resolution](xref:input-system-action-bindings#conflicting-inputs) between multiple controls that are bound to the same action uses it to decide which control gets to drive the action.
+
+## Noisy controls
+
+The Input System can label a control as "noisy", meaning that they can change value without needing any actual or intentional user interaction, such as a gravity [sensor](xref:UnityEngine.InputSystem.Sensor) in a cellphone, or taking orientation readings from an [XR head-mounted display](xref:UnityEngine.InputSystem.XR.XRHMD).
-- [Interactive rebinding](ActionBindings.md#interactive-rebinding) (`InputActionRebindingExceptions.RebindOperation`) uses it to select between multiple suitable Controls to find the one that is actuated the most.
-- [Conflict resolution](ActionBindings.md#conflicting-inputs) between multiple Controls that are bound to the same action uses it to decide which Control gets to drive the action.
+For example, the PS4 controller has a gyroscope sensor built into the device which constantly feeds data about the angular velocity of the device, even if the device just sits there without user interaction. Conversely, the controller's sticks and buttons require user interaction to produce non-default values.
-## Noisy Controls
+If a control is marked as noisy, it means that:
-The Input System can label a Control as "noisy". You can query this using the [`InputControl.noisy`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_noisy) property.
+- The control is not considered for [interactive rebinding](xref:input-system-action-bindings#interactive-rebinding). The [`InputActionRebindingExceptions.RebindingOperation`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation) ignores the control by default (although you can bypass this using [`WithoutIgnoringNoisyControls`](xref:UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation.WithoutIgnoringNoisyControls)).
-Noisy Controls are those that can change value without any actual or intentional user interaction required. A good example of this is a gravity sensor in a cellphone. Even if the cellphone is perfectly still, there are usually fluctuations in gravity readings. Another example are orientation readings from an HMD.
+- If enabled in the Project Settings, the system performs additional event filtering, then calls [`InputDevice.MakeCurrent`](xref:UnityEngine.InputSystem.InputDevice.MakeCurrent). If an input event for a device contains no state change on a control that is not marked noisy, then the device will not be made current based on the event. This avoids, for example, a plugged in PS4 controller constantly making itself the current gamepad ([`Gamepad.current`](xref:UnityEngine.InputSystem.Gamepad.current)) due to its sensors constantly feeding data into the system.
-If a Control is marked as noisy, it means that:
+- When the application loses focus and devices are [reset](xref:input-system-devices#device-resets) as a result, the state of noisy controls will be preserved as is. This ensures that sensor readings will remain at their last value rather than being reset to default values. However, while other controls are reset to their default value, noisy controls will not be reset but rather remain at their current value (unless the device is [running in the background](xref:input-system-devices#background-and-focus-change-behavior)). This is based on the assumption that noisy controls most often represent sensor values and snapping the last sampling value back to default will usually have undesirable effects on an application's simulation logic.
-1. The Control is not considered for [interactive rebinding](ActionBindings.md#interactive-rebinding). [`InputActionRebindingExceptions.RebindingOperation`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation.html) ignores the Control by default (you can bypass this using [`WithoutIgnoringNoisyControls`](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.RebindingOperation.html#UnityEngine_InputSystem_InputActionRebindingExtensions_RebindingOperation_WithoutIgnoringNoisyControls)).
-2. If enabled in the Project Settings, the system performs additional event filtering, then calls [`InputDevice.MakeCurrent`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_MakeCurrent). If an input event for a Device contains no state change on a Control that is not marked noisy, then the Device will not be made current based on the event. This avoids, for example, a plugged in PS4 controller constantly making itself the current gamepad ([`Gamepad.current`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_current)) due to its sensors constantly feeding data into the system.
-3. When the application loses focus and Devices are [reset](Devices.md#device-resets) as a result, the state of noisy Controls will be preserved as is. This ensures that sensor readinds will remain at their last value rather than being reset to default values.
+> [!NOTE]
+> To query whether a control is noisy, use the [`InputControl.noisy`](xref:UnityEngine.InputSystem.InputControl.noisy) property.
+>
+> If any control on a device is noisy, the device itself is flagged as noisy.
->**Note**: If any Control on a Device is noisy, the Device itself is flagged as noisy.
+### Noise masks
-Parallel to the [`input state`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_currentStatePtr) and the [`default state`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_defaultStatePtr) that the Input System keeps for all Devices currently present, it also maintains a [`noise mask`](../api/UnityEngine.InputSystem.InputControl.html#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.
+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.
-## Synthetic Controls
+## Synthetic controls
-A synthetic Control is a Control that doesn't correspond to an actual physical control on a device (for example the `left`, `right`, `up`, and `down` child Controls on a [`StickControl`](../api/UnityEngine.InputSystem.Controls.StickControl.html)). These Controls synthesize input from other, actual physical Controls and present it in a different way (in this example, they allow you to treat the individual directions of a stick as buttons).
+A synthetic control is an input control that doesn't correspond to an actual physical control on a device (for example the `left`, `right`, `up`, and `down` child controls on a [`StickControl`](xref:UnityEngine.InputSystem.Controls.StickControl)). These controls synthesize input from other, actual physical controls and present it in a different way (in this example, they allow you to treat the individual directions of a stick as buttons).
-Whether a given Control is synthetic is indicated by its [`InputControl.synthetic`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_synthetic) property.
+The system considers synthetic controls for [interactive rebinding](xref:input-system-action-bindings#interactive-rebinding) but always favors non-synthetic controls. If both a synthetic and a non-synthetic control that are a potential match exist (for example, `/leftStick/x` and `/leftStick/left`), the non-synthetic control (`/leftStick/x`) wins by default. This makes it possible to interactively bind to `/leftStick/left`, for example, but also makes it possible to bind to `/leftStickPress` without getting interference from the synthetic buttons on the stick.
+
+> [!NOTE]
+> To query whether a control is synthetic, use the [`InputControl.synthetic`](xref:UnityEngine.InputSystem.InputControl.synthetic) property.
-The system considers synthetic Controls for [interactive rebinding](ActionBindings.md#interactive-rebinding) but always favors non-synthetic Controls. If both a synthetic and a non-synthetic Control that are a potential match exist, the non-synthetic Control wins by default. This makes it possible to interactively bind to `/leftStick/left`, for example, but also makes it possible to bind to `/leftStickPress` without getting interference from the synthetic buttons on the stick.
## Performance Optimization
### Avoiding defensive copies
-Use [`InputControl.value`](../api/UnityEngine.InputSystem.InputControl-1.html#UnityEngine_InputSystem_InputControl_1_value) instead of [`InputControl.ReadValue`](../api/UnityEngine.InputSystem.InputControl-1.html#UnityEngine_InputSystem_InputControl_1_ReadValue) to avoid creating a copy of the control state on every call, as the former returns the value as `ref readonly` while the latter always makes a copy. Note that this optimization only applies if the call site assigns the return value to a variable that has been declared 'ref readonly'. Otherwise a copy will be made as before. Additionally, be aware of defensive copies that can be allocated by the compiler when it is unable to determine that it can safely use the readonly reference i.e. if it can't determine that the reference won't be changed, it will create a defensive copy for you. For more details, see https://learn.microsoft.com/en-us/dotnet/csharp/write-safe-efficient-code#use-ref-readonly-return-statements.
+Use [`InputControl.value`](xref:UnityEngine.InputSystem.InputControl`1.value) instead of [`InputControl.ReadValue`](xref:UnityEngine.InputSystem.InputControl`1.ReadValue) to avoid creating a copy of the control state on every call. This is because `InputControl.value` returns the value as `ref readonly` while `InputControl.ReadValue` always makes a copy. Note that this optimization only applies if the call site assigns the return value to a variable that has been declared `ref readonly`. Otherwise, a copy is made as before.
+
+Additionally, be aware of defensive copies that the compiler can allocate when it is unable to determine that it can safely use the read-only reference. This means that if the compiler can't determine that the reference won't be changed, it will create a defensive copy. For more details, refer to the [.NET guidance on reducing memory allocations](https://learn.microsoft.com/en-us/dotnet/csharp/write-safe-efficient-code#use-ref-readonly-return-statements).
### Control Value Caching
-When the `'USE_READ_VALUE_CACHING'` internal feature flag is set, the Input System will switch to an optimized path for reading control values. This path efficiently marks controls as 'stale' when they have been actuated. Subsequent calls to [`InputControl.ReadValue`](../api/UnityEngine.InputSystem.InputControl-1.html#UnityEngine_InputSystem_InputControl_1_ReadValue) will only apply control processing when there have been changes to that control or in case of control processing. Control processing in this case can mean any hard-coded processing that might exist on the control, such as with [`AxisControl`](../api/UnityEngine.InputSystem.Controls.AxisControl.html) which has built-in inversion, normalisation, scaling etc, or any processors that have been applied to the controls' [processor stack](HowToApplyProcessors.md#processors-on-controls).
-> Note: Performance improvements **are currently not guaranteed** for all use cases. Even though this performance path marks controls as "stale" in an efficient way, it still has an overhead which can degrade performance in some cases.
+Enable the `USE_READ_VALUE_CACHING` internal feature flag to get the Input System to switch to an optimized path for reading control values. This path efficiently marks controls as "stale" when they have been actuated. Subsequent calls to [`InputControl.ReadValue`](xref:UnityEngine.InputSystem.InputControl`1.ReadValue) will only apply control processing when there have been changes to that control or in the case of any [hard-coded processing](xref:input-system-processors#processors-on-controls) that might exist on the control. For example, [`AxisControl`](xref:UnityEngine.InputSystem.Controls.AxisControl) has built-in inversion, normalization, scaling, and any other processors added to the controls' [processor stack](xref:input-system-processors#processors-on-controls).
+
+> [!NOTE]
+> Performance improvements **are currently not guaranteed** for all use cases. Even though this performance path marks controls as "stale" in an efficient way, it still has an overhead which can degrade performance in some cases.
-A positive performance impact has been seen when:
-- Reading from controls that do not change frequently.
-- In case the controls change every frame, are being read and have actions bound to them as well, e.g. on a Gamepad, reading `leftStick`, `leftStick.x` and `leftStick.left` for example when there's a action with composite bindings setup.
+Positive performance impact can occur when:
+- Reading from controls that don't change frequently.
+- If the controls change every frame, are being read and have actions bound to them as well. For example, reading `leftStick`, `leftStick.x` and `leftStick.left` when there's an action with composite bindings on a Gamepad.
-On the other hand, it is likely to have a negative performance impact when:
-- No control reads are performed for a control, and there are a lot of changes for that particular control.
-- Reading from controls that change frequently that have no actions bound to those controls.
+Negative performance impact can occur when:
+- Reading from controls that change frequently but which have no bound actions.
+- No readings from controls that change frequently.
-Moreover, this feature is not enabled by default as it can result in the following minor behavioural changes:
- * Some control processors use global state. Without cached value optimizations, it is possible to read the control value, change the global state, read the control value again, and get a new value due to the fact that the control processor runs on every call. With cached value optimizations, reading the control value will only ever return a new value if the physical control has been actuated. Changing the global state of a control processor will have no effect otherwise.
- * Writing to device state using low-level APIs like [`InputControl.WriteValueIntoState`](../api/UnityEngine.InputSystem.InputControl-1.html#UnityEngine_InputSystem_InputControl_1_WriteValueIntoState__0_System_Void__) does not set the stale flag and subsequent calls to [`InputControl.value`](../api/UnityEngine.InputSystem.InputControl-1.html#UnityEngine_InputSystem_InputControl_1_value) will not reflect those changes.
- * After changing properties on [`AxisControl`](../api/UnityEngine.InputSystem.Controls.AxisControl.html) the [`ApplyParameterChanges`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_ApplyParameterChanges) has to be called to invalidate cached value.
+`USE_READ_VALUE_CACHING` is not enabled by default because it can result in the following minor behavioral changes:
+- For control processors that use a global state with cached value optimization, changing the global state of a control processor will have no effect. Reading the control value will only ever return a new value if the physical control has been actuated.
-Processors that need to run on every read can set their respective caching policy to EvaluateOnEveryRead. That will disable caching on controls that are using such processor.
+ This behavior differs from using global states without cached value optimizations, in which you can read the control value, change the global state, read the control value again, and get a new value due to the fact that the control processor runs on every call.
+- Writing to device state using low-level APIs like [`InputControl.WriteValueIntoState`](xref:UnityEngine.InputSystem.InputControl`1.WriteValueIntoState(`0,System.Void*)) doesn't set the stale flag and subsequent calls to [`InputControl.value`](xref:UnityEngine.InputSystem.InputControl`1.value) won't reflect those changes.
+- After changing properties on [`AxisControl`](xref:UnityEngine.InputSystem.Controls.AxisControl) the [`ApplyParameterChanges`](xref:UnityEngine.InputSystem.InputControl.ApplyParameterChanges) method has to be called to invalidate cached values.
-If there are any non-obvious inconsistencies, 'PARANOID_READ_VALUE_CACHING_CHECKS' internal feature flag can be enabled to compare cached and uncached value on every read and log an error if they don't match.
+Processors that must run on every read can set their caching policy to [EvaluateOnEveryRead](xref:UnityEngine.InputSystem.InputProcessor.CachingPolicy.EvaluateOnEveryRead), which disables caching on controls that are using such processors.
+
+You can enable the `PARANOID_READ_VALUE_CACHING_CHECKS` internal feature flag to compare cached and uncached values on every read. If they don't match, the check logs an error.
### Optimized control read value
-When the `'USE_OPTIMIZED_CONTROLS'` internal feature flag is set, the Input System will use faster way to use state memory for some controls instances. This is very specific optimization and should be used with caution.
+Enable the `USE_OPTIMIZED_CONTROLS` internal feature flag to get the Input System to access state memory faster for some control instances. This is very specific optimization and should be used with caution.
+
+> [!NOTE]
+> This optimization has a performance impact on `PlayMode` because the Input System performs extra checks in order to ensure that the controls have the correct memory representation during development. If you see a performance drop in `PlayMode` when using this optimization, that is expected at this stage.
-> __Please note__: This optimization has a performance impact on `PlayMode` as we do extra checks to ensure that the controls have the correct memory representation during development. Don't be alarmed if you see a performance drop in `PlayMode` when using this optimization as it's expected at this stage.
+Most controls are flexible with regards to memory representation. For example, [`AxisControl`](xref:UnityEngine.InputSystem.Controls.AxisControl) can be one bit, multiple bits, a float, or in [`Vector2Control`](xref:UnityEngine.InputSystem.Controls.Vector2Control) where `x` and `y` can have different memory representation. However, most controls use common memory representation patterns, such as [`AxisControl`](xref:UnityEngine.InputSystem.Controls.AxisControl), which uses floats or single bytes. Another example is [`Vector2Control`](xref:UnityEngine.InputSystem.Controls.Vector2Control) which consists of two consecutive floats in memory.
-Most controls are flexible with regards to memory representation, like [`AxisControl`](../api/UnityEngine.InputSystem.Controls.AxisControl.html) can be one bit, multiple bits, a float, etc, or in [`Vector2Control`](../api/UnityEngine.InputSystem.Controls.Vector2Control.html) where x and y can have different memory representation.
-Yet for most controls there are common memory representation patterns, for example [`AxisControl`](../api/UnityEngine.InputSystem.Controls.AxisControl.html) are floats or single bytes. Or some [`Vector2Control`](../api/UnityEngine.InputSystem.Controls.Vector2Control.html) are two consequitive floats in memory.
-If a control matches a common representation we can bypass reading its children control and cast the memory directly to the common representation. For example if [`Vector2Control`](../api/UnityEngine.InputSystem.Controls.Vector2Control.html) is two consecutive floats in memory we can bypass reading `x` and `y` separately and just cast the state memory to `Vector2`.
+If a control matches a common representation, you can bypass reading its children's controls and cast the memory directly to the common representation. For example if [`Vector2Control`](xref:UnityEngine.InputSystem.Controls.Vector2Control) has two consecutive floats in memory, you can bypass reading `x` and `y` separately and just cast the state memory to `Vector2`.
-> __Please note__: This optimization only works if the controls don't need any processing applied to them, such as `invert`, `clamp`, `normalize`, `scale` or any other processor. If any of these are applied to the control, **there won't be any optimization applied** and the control will be read as usual.
+> [!NOTE]
+> This optimization only works if the controls don't need any processing applied, such as `invert`, `clamp`, `normalize`, `scale` or any other processor. If any of these are applied to the control, the control will be read as usual without any optimization.
-Also, [`InputControl.ApplyParameterChanges()`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_ApplyParameterChanges) **must be explicitly called** in specific changes to ensure [`InputControl.optimizedControlDataType`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_optimizedControlDataType) is updated to the correct memory representation. Make sure to call it when:
-* Configuration changes after [`InputControl.FinishSetup()`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_FinishSetup_) is called.
-* Changing parameters such [`AxisControl.invert`](../api/UnityEngine.InputSystem.Controls.AxisControl.html#UnityEngine_InputSystem_Controls_AxisControl_invert), [`AxisControl.clamp`](../api/UnityEngine.InputSystem.Controls.AxisControl.html#UnityEngine_InputSystem_Controls_AxisControl_clamp), [`AxisControl.normalize`](../api/UnityEngine.InputSystem.Controls.AxisControl.html#UnityEngine_InputSystem_Controls_AxisControl_normalize), [`AxisControl.scale`](../api/UnityEngine.InputSystem.Controls.AxisControl.html#UnityEngine_InputSystem_Controls_AxisControl_scale) or changing processors. The memory representation needs to be recalculated after these changes so that we know that the control is not optimized anymore. Otherwise, the control will be read with wrong values.
+It is important to explicitly call [`InputControl.ApplyParameterChanges()`](xref:UnityEngine.InputSystem.InputControl.ApplyParameterChanges) to ensure [`InputControl.optimizedControlDataType`](xref:UnityEngine.InputSystem.InputControl.optimizedControlDataType) is updated to the correct memory representation for these specific changes:
+- Configuration changes after calling [`InputControl.FinishSetup()`](xref:UnityEngine.InputSystem.InputControl.FinishSetup*).
+- Changing parameters such as [`AxisControl.invert`](xref:UnityEngine.InputSystem.Controls.AxisControl.invert), [`AxisControl.clamp`](xref:UnityEngine.InputSystem.Controls.AxisControl.clamp), [`AxisControl.normalize`](xref:UnityEngine.InputSystem.Controls.AxisControl.normalize), [`AxisControl.scale`](xref:UnityEngine.InputSystem.Controls.AxisControl.scale) or changing processors. The memory representation needs to be recalculated after these changes to ensure that the control is no longer optimized. Otherwise, the control will be read with wrong values.
The optimized controls work as follows:
-* A potential memory representation is set using [`InputControl.CalculateOptimizedControlDataType()`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_CalculateOptimizedControlDataType)
-* Its memory representation is stored in [`InputControl.optimizedControlDataType`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_optimizedControlDataType)
-* Finally, [`ReadUnprocessedValueFromState`](../api/UnityEngine.InputSystem.InputControl-1.html#UnityEngine_InputSystem_InputControl_1_ReadUnprocessedValueFromState_) uses the optimized memory representation to decide if it should cast to memory directly instead of reading every children control on it's own to reconstruct the controls state.
+- A potential memory representation is set using [`InputControl.CalculateOptimizedControlDataType()`](xref:UnityEngine.InputSystem.InputControl.CalculateOptimizedControlDataType)
+- Its memory representation is stored in [`InputControl.optimizedControlDataType`](xref:UnityEngine.InputSystem.InputControl.optimizedControlDataType)
+- Finally, [`ReadUnprocessedValueFromState`](xref:UnityEngine.InputSystem.InputControl`1.ReadUnprocessedValueFromState*) uses the optimized memory representation to decide if it should cast to memory directly instead of reading every children control on its own to reconstruct the controls state.
diff --git a/Packages/com.unity.inputsystem/Documentation~/Debugging.md b/Packages/com.unity.inputsystem/Documentation~/Debugging.md
index 84040dcfcb..a357072331 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Debugging.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Debugging.md
@@ -3,20 +3,6 @@ uid: input-system-debugging
---
# Debugging
-- [Debugging](#debugging)
- - [Input Debugger](#input-debugger)
- - [Debugging Devices](#debugging-devices)
- - [Debugging Actions](#debugging-actions)
- - [Debugging users and PlayerInput](#debugging-users-and-playerinput)
- - [Debugging layouts](#debugging-layouts)
- - [Debugging remotely](#debugging-remotely)
- - [Input visualizers](#input-visualizers)
- - [`InputControlVisualizer`](#inputcontrolvisualizer)
- - [`InputActionVisualizer`](#inputactionvisualizer)
- - [Device Simulator](#device-simulator)
- - [Unity Remote (iOS, Android)](#unity-remote)
- - [Other tips:](#other-tips)
-
When something isn't working as expected, the quickest way to troubleshoot what's wrong is the Input Debugger in the Unity Editor. The Input Debugger provides access to the activity of the Input System in both the Editor and the connected Players.
To open the Input Debugger, go to __Window > Analysis > Input Debugger__ from Unity's main menu.
@@ -29,18 +15,18 @@ The Input Debugger displays a tree breakdown of the state of the Input System.
|Item|Description|
|----|-----------|
-|Devices|A list of all [Input Devices](Devices.md) that are currently in the system, and a list of unsupported/unrecognized Devices.|
+|Devices|A list of all [Input Devices](xref:input-system-devices) that are currently in the system, and a list of unsupported/unrecognized Devices.|
|Layouts|A list of all registered Control and Device layouts. This is the database of supported hardware, and information on how to represent a given piece of input hardware.|
-|Actions|Only visible in Play mode, and only if at least one [Action](Actions.md) is enabled. A list of all currently enabled Actions, and the Controls they are bound to. See [Debugging Actions](#debugging-actions).|
-|Users|Only visible when one or more `InputUser` instances exist. See documentation on [user management](UserManagement.md). A list of all currently active users, along with their active Control Schemes and Devices, all their associated Actions, and the Controls these Actions are bound to. Note that `PlayerInput` uses `InputUser` to run. When using `PlayerInput` components, each player has an entry in this list. See [Debugging users and PlayerInput](#debugging-users-and-playerinput).|
-|Settings|The currently active Input System [settings](Settings.md).|
+|Actions|Only visible in Play mode, and only if at least one [Action](xref:input-system-actions) is enabled. A list of all currently enabled Actions, and the Controls they are bound to. See [Debugging Actions](#debugging-actions).|
+|Users|Only visible when one or more `InputUser` instances exist. See documentation on [user management](xref:input-system-user-management). A list of all currently active users, along with their active Control Schemes and Devices, all their associated Actions, and the Controls these Actions are bound to. Note that `PlayerInput` uses `InputUser` to run. When using `PlayerInput` components, each player has an entry in this list. See [Debugging users and PlayerInput](#debugging-users-and-playerinput).|
+|Settings|The currently active Input System [settings](xref:input-system-settings).|
|Metrics|Statistics about Input System resource usage.|
### Debugging Devices
-In the Input Debugger window, navigate to the __Devices__ list and double-click any [Input Device](Devices.md). This opens a window that displays information about the Device, including real-time state information for its Controls.
+In the Input Debugger window, navigate to the __Devices__ list and double-click any [Input Device](xref:input-system-devices). This opens a window that displays information about the Device, including real-time state information for its Controls.
-
+
The top of the Device window displays general information about the specific Device, such as name, manufacturer, associated layout, device flags, device ID and serial number. In addition, this section also display the current __sample frequency__ and __processing delay__ of the deivce.
@@ -50,35 +36,33 @@ __Processing delay__ indicates the average, minimum and maximum latency contribu
The __Controls__ section lists the Device's Controls and their individual states. This is useful when debugging input issues, because you can verify whether the data that the Input System receives from the Input Device is what you expect it to be. There are two buttons at the top of this panel:
-* __HID Descriptor__: Only displayed for devices that use the HID protocol to connect. This opens a window that displays the detailed [HID](HID.md) specifications for the Device and each of it's logical controls.
+* __HID Descriptor__: Only displayed for devices that use the HID protocol to connect. This opens a window that displays the detailed [HID](xref:input-system-hid) specifications for the Device and each of it's logical controls.
* __State__: Display the current state of the Device in a new window. This is identical to the information displayed in this view, but doesn't update in real time, so you can take a snapshot of input state data and take the time to inspect it as needed.
-The __Events__ section lists all [input events](Events.md) generated by the Device. You can double-click any event in the list to inspect the full Device state at the time the event occurred. To get a side-by-side difference between the state of the Device at different points in time, select multiple events, right-click them, and click __Compare__ from the context menu.
+The __Events__ section lists all [input events](xref:input-system-events) generated by the Device. You can double-click any event in the list to inspect the full Device state at the time the event occurred. To get a side-by-side difference between the state of the Device at different points in time, select multiple events, right-click them, and click __Compare__ from the context menu.
### Debugging Actions
-The Input Debugger window lists all enabled [Actions](Actions.md) in the __Actions__ list. This list only appears if at least one Action is active and the Editor is in Play mode. If an Action has actively bound Controls, you can click the arrow next to the Action to see a list of the Controls. This is useful to debug whether your Bindings correctly map to the Controls you want them to bind to. See documentation on [Binding resolution](ActionBindings.md#binding-resolution) for more information about how Unity maps Bindings to Controls.
+The Input Debugger window lists all enabled [Actions](xref:input-system-actions) in the __Actions__ list. This list only appears if at least one Action is active and the Editor is in Play mode. If an Action has actively bound Controls, you can click the arrow next to the Action to see a list of the Controls. This is useful to debug whether your Bindings correctly map to the Controls you want them to bind to. See documentation on [Binding resolution](xref:input-system-action-bindings#binding-resolution) for more information about how Unity maps Bindings to Controls.
->__Note__: Actions that belong to [`InputUsers`](UserManagement.md) don't appear here. They appear in the [__Users__](#debugging-users-and-playerinput) list instead.
+> [!NOTE]
+> Actions that belong to [`InputUsers`](xref:input-system-user-management) don't appear here. They appear in the [__Users__](#debugging-users-and-playerinput) list instead.
### Debugging users and PlayerInput
-When there are [`InputUser`](UserManagement.md) instances (if you use `PlayerInput`, each `PlayerInput` instance implicitly creates one), the Input Debugger's __Users__ list displays each instance along with its paired Devices and active Actions. The listed Devices and Actions work the same way as those displayed in the [__Devices__](#debugging-devices) and [__Actions__](#debugging-actions) lists in the debugging window.
-
-
+When there are [`InputUser`](xref:input-system-user-management) instances (if you use `PlayerInput`, each `PlayerInput` instance implicitly creates one), the Input Debugger's __Users__ list displays each instance along with its paired Devices and active Actions. The listed Devices and Actions work the same way as those displayed in the [__Devices__](#debugging-devices) and [__Actions__](#debugging-actions) lists in the debugging window.
### Debugging layouts
-The [__Layouts__](Layouts.md) list in the Input Debugger window displays a breakdown of all registered [Control and Device layouts](Layouts.md). This is the database of supported hardware and the knowledge of how to represent a given piece of input hardware. It's useful when you want to [create a new Device mapping](HID.md#creating-a-custom-device-layout) and see how the Input System represents it.
-
-
+The [__Layouts__](xref:input-system-layouts) list in the Input Debugger window displays a breakdown of all registered [Control and Device layouts](xref:input-system-layouts). This is the database of supported hardware and the knowledge of how to represent a given piece of input hardware. It's useful when you want to [create a new Device mapping](xref:input-system-hid#creating-a-custom-device-layout) and see how the Input System represents it.
### Debugging remotely
You can connect the Input Debugger to a Player that runs on a remote computer or device. This makes it possible to observe input activity from the Player in the Editor. This connection uses the `PlayerConnection` mechanism, which is the same one the Unity profiler uses to connect to a Player.
->__Note__: At the moment, debugging input in Players is restricted to seeing Devices and events from connected Players. There is no support for seeing other input-related data such as Actions and input users from Players.
+> [!NOTE]
+> At the moment, debugging input in Players is restricted to seeing Devices and events from connected Players. There is no support for seeing other input-related data such as Actions and input users from Players.
To see remote Devices from built Players, open the Input Debugger window's __Remote Devices__ drop-down list. This list displays the remote Player instance you can connect to (if there are any). The same list appears in the Profiler and Console windows, and any connections are shared between those windows. If any Player(s) are connected, you can enable __Show remote devices__ in the same drop-down list. If Players are connected, and __Show remote devices__ is enabled, the [__Devices__](#debugging-devices) list in the Input Debugger window splits into a __Local__ section and a __Remote__ section. The __Remote__ section displays any Input Device from any connected Player, and lets you inspect Device state and events in real time, as if it were a local Device.
@@ -86,7 +70,7 @@ To see remote Devices from built Players, open the Input Debugger window's __Rem
The Input System package comes with a __Visualizers__ sample, which provides various components which let you monitor the state of various Input System elements in real time using on-screen visualizers.
-To install the sample, navigate to the Input System package in the Package Manager window (see [Installation](Installation.md)), and next to the __Visualizers__ sample, click __Import in project__.
+To install the sample, navigate to the Input System package in the Package Manager window (see [Installation](xref:input-system-installation)), and next to the __Visualizers__ sample, click __Import in project__.
The sample provides two visualizer components:
@@ -94,13 +78,13 @@ The sample provides two visualizer components:
Visualizes the current state of a single Control in real time. You can have multiple Control visualizers to visualize the state of multiple Controls. Check the `GamepadVisualizer`, `MouseVisualizer`, or `PenVisualizer` Scenes in the sample for examples.
-
+
### `InputActionVisualizer`
-Visualizes the current state of a single Action in real time. You can have multiple Action visualizers to visualize the state of multiple Actions. This can also display the current value of the Action and the Control currently driving the Action, and track the state of [Interactions](Interactions.md) over time. Check the `SimpleControlsVisualizer` Scene in the sample for examples.
+Visualizes the current state of a single Action in real time. You can have multiple Action visualizers to visualize the state of multiple Actions. This can also display the current value of the Action and the Control currently driving the Action, and track the state of [Interactions](xref:input-system-interactions) over time. Check the `SimpleControlsVisualizer` Scene in the sample for examples.
-
+
## Device Simulator
@@ -112,29 +96,31 @@ To prevent conflicts between simulated touchscreen inputs and native mouse and p
The Unity Remote is an app available for iOS and Android which allows using a mobile device for input while running in the Unity Editor. You can find details about the app and how to install it in the [Unity manual](https://docs.unity3d.com/Manual/UnityRemote5.html).
-If you would like to try out the Unity Remote app, you can [install](Installation.md#installing-samples) the "Unity Remote" sample that is provided with the Input System package.
+If you would like to try out the Unity Remote app, you can [install](xref:input-system-installation#install-samples) the "Unity Remote" sample that is provided with the Input System package.
->__Note__: Joysticks/gamepads are not yet supported over the Unity Remote. No joystick/gamepad input from the mobile device will come through in the editor.
+> [!NOTE]
+> Joysticks/gamepads are not yet supported over the Unity Remote. No joystick/gamepad input from the mobile device will come through in the editor.
->__Note__: This requires Unity 2021.2.18 or later.
+> [!NOTE]
+> This requires Unity 2021.2.18 or later.
-When in play mode in the Editor and connected to the Unity Remote app, you will see a number of Devices have been added with the [`InputDevice.remote`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_remote) flag set to true:
+When in play mode in the Editor and connected to the Unity Remote app, you will see a number of Devices have been added with the [`InputDevice.remote`](xref:UnityEngine.InputSystem.InputDevice.remote) flag set to true:
-- [`Touchscreen`](../api/UnityEngine.InputSystem.Touchscreen.html)
-- [`Accelerometer`](../api/UnityEngine.InputSystem.Accelerometer.html)
+- [`Touchscreen`](xref:UnityEngine.InputSystem.Touchscreen)
+- [`Accelerometer`](xref:UnityEngine.InputSystem.Accelerometer)
If a gyro is present on the mobile device:
-- [`Gyroscope`](../api/UnityEngine.InputSystem.Gyroscope.html)
-- [`AttitudeSensor`](../api/UnityEngine.InputSystem.AttitudeSensor.html)
-- [`LinearAccelerationSensor`](../api/UnityEngine.InputSystem.LinearAccelerationSensor.html)
-- [`GravitySensor`](../api/UnityEngine.InputSystem.GravitySensor.html)
+- [`Gyroscope`](xref:UnityEngine.InputSystem.Gyroscope)
+- [`AttitudeSensor`](xref:UnityEngine.InputSystem.AttitudeSensor)
+- [`LinearAccelerationSensor`](xref:UnityEngine.InputSystem.LinearAccelerationSensor)
+- [`GravitySensor`](xref:UnityEngine.InputSystem.GravitySensor)
These Devices can be used just like local Devices. They will receive input from the connected mobile device which in turn will receive the rendered output of the game running in the editor.
-The [`Accelerometer`](../api/UnityEngine.InputSystem.Accelerometer.html) device will automatically be enabled and will not need you to call [`InputSystem.EnableDevice`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_EnableDevice_UnityEngine_InputSystem_InputDevice_) explicitly. Setting the sampling frequency on the accelerometer from the Unity Remote using [`Sensor.samplingFrequency`](../api/UnityEngine.InputSystem.Sensor.html#UnityEngine_InputSystem_Sensor_samplingFrequency) has no effect.
+The [`Accelerometer`](xref:UnityEngine.InputSystem.Accelerometer) device will automatically be enabled and will not need you to call [`InputSystem.EnableDevice`](xref:UnityEngine.InputSystem.InputSystem.EnableDevice(UnityEngine.InputSystem.InputDevice)) explicitly. Setting the sampling frequency on the accelerometer from the Unity Remote using [`Sensor.samplingFrequency`](xref:UnityEngine.InputSystem.Sensor.samplingFrequency) has no effect.
-The remaining sensors listed above will need to be explicitly enabled via [`InputSystem.EnableDevice`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_EnableDevice_UnityEngine_InputSystem_InputDevice_) just like local sensors. Setting the sampling frequency on these sensors from the Unity Remote using [`Sensor.samplingFrequency`](../api/UnityEngine.InputSystem.Sensor.html#UnityEngine_InputSystem_Sensor_samplingFrequency) will be relayed to the device but note that setting the frequency on one of them will set it for all of them.
+The remaining sensors listed above will need to be explicitly enabled via [`InputSystem.EnableDevice`](xref:UnityEngine.InputSystem.InputSystem.EnableDevice(UnityEngine.InputSystem.InputDevice)) just like local sensors. Setting the sampling frequency on these sensors from the Unity Remote using [`Sensor.samplingFrequency`](xref:UnityEngine.InputSystem.Sensor.samplingFrequency) will be relayed to the device but note that setting the frequency on one of them will set it for all of them.
Touch coordinates from the device will be translated to the screen coordinates of the Game View inside the Editor.
diff --git a/Packages/com.unity.inputsystem/Documentation~/Devices.md b/Packages/com.unity.inputsystem/Documentation~/Devices.md
index 53d87bba7a..c76038b8d5 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Devices.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Devices.md
@@ -3,72 +3,37 @@ uid: input-system-devices
---
# Devices
-- [Devices](#devices)
- - [Device descriptions](#device-descriptions)
- - [Capabilities](#capabilities)
- - [Matching](#matching)
- - [Hijacking the matching process](#hijacking-the-matching-process)
- - [Device lifecycle](#device-lifecycle)
- - [Device creation](#device-creation)
- - [Device removal](#device-removal)
- - [Device resets](#device-resets)
- - [Device syncs](#device-syncs)
- - [Device enabling and disabling](#device-enabling-and-disabling)
- - [Background and focus change behavior](#background-and-focus-change-behavior)
- - [Domain reloads in the Editor](#domain-reloads-in-the-editor)
- - [Native Devices](#native-devices)
- - [Disconnected Devices](#disconnected-devices)
- - [Device IDs](#device-ids)
- - [Device usages](#device-usages)
- - [Device commands](#device-commands)
- - [Sending commands to Devices](#sending-commands-to-devices)
- - [Adding custom device Commands](#adding-custom-device-commands)
- - [Device state](#device-state)
- - [State changes](#state-changes)
- - [Monitoring state changes](#monitoring-state-changes)
- - [Synthesizing state](#synthesizing-state)
- - [Working with Devices](#working-with-devices)
- - [Monitoring Devices](#monitoring-devices)
- - [Adding and removing Devices](#adding-and-removing-devices)
- - [Creating custom Devices](#creating-custom-devices)
- - [Step 1: The state struct](#step-1-the-state-struct)
- - [Step 2: The Device class](#step-2-the-device-class)
- - [Step 3: The Update method](#step-3-the-update-method)
- - [Step 4: Device registration and creation](#step-4-device-registration-and-creation)
- - [Step 5: `current` and `all` (optional)](#step-5-current-and-all-optional)
- - [Step 6: Device Commands (Optional)](#step-6-device-commands-optional)
-
-Physically, Input Devices represent devices attached to the computer, which a user can use to control the app. Logically, Input Devices are the top-level container for [Controls](Controls.md). The [`InputDevice`](../api/UnityEngine.InputSystem.InputDevice.html) class is itself a specialization of [`InputControl`](../api/UnityEngine.InputSystem.InputControl.html). See [supported Devices](SupportedDevices.md) to see what kind of Devices the Input System currently supports.
-
-To query the set of all currently present Devices, you can use [`InputSystem.devices`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_devices).
+Physically, Input Devices represent devices attached to the computer, which a user can use to control the app. Logically, Input Devices are the top-level container for [Controls](xref:input-system-controls). The [`InputDevice`](xref:UnityEngine.InputSystem.InputDevice) class is itself a specialization of [`InputControl`](xref:UnityEngine.InputSystem.InputControl). See [supported Devices](xref:input-system-supported-devices) to see what kind of Devices the Input System currently supports.
+
+To query the set of all currently present Devices, you can use [`InputSystem.devices`](xref:UnityEngine.InputSystem.InputSystem.devices).
## Device descriptions
-An [`InputDeviceDescription`](../api/UnityEngine.InputSystem.Layouts.InputDeviceDescription.html) describes a Device. The Input System uses this primarily during the Device discovery process. When a new Device is reported (by the runtime or by the user), the report contains a Device description. Based on the description, the system then attempts to find a Device [layout](Layouts.md) that matches the description. This process is based on [Device matchers](#matching).
+The Input System uses the device description defined as a [`InputDeviceDescription`](xref:UnityEngine.InputSystem.Layouts.InputDeviceDescription) primarily during the Device discovery process. When a new Device is reported (by the runtime or by the user), the system then attempts to find a Device [layout](xref:input-system-layouts) that matches the Device description contained in the report. This process is based on [Device matching](#matching).
-After a Device has been created, you can retrieve the description it was created from through the [`InputDevice.description`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_description) property.
+After a Device has been created, you can retrieve the description it was created from through the [`InputDevice.description`](xref:UnityEngine.InputSystem.InputDevice.description) property.
Every description has a set of standard fields:
|Field|Description|
|-----|-----------|
-|[`interfaceName`](../api/UnityEngine.InputSystem.Layouts.InputDeviceDescription.html#UnityEngine_InputSystem_Layouts_InputDeviceDescription_interfaceName)|Identifier for the interface/API that is making the Device available. In many cases, this corresponds to the name of the platform, but there are several more specific interfaces that are commonly used: [HID](https://www.usb.org/hid), [RawInput](https://docs.microsoft.com/en-us/windows/desktop/inputdev/raw-input), [XInput](https://docs.microsoft.com/en-us/windows/desktop/xinput/xinput-game-controller-apis-portal). This field is required.|
-|[`deviceClass`](../api/UnityEngine.InputSystem.Layouts.InputDeviceDescription.html#UnityEngine_InputSystem_Layouts_InputDeviceDescription_deviceClass)|A broad categorization of the Device. For example, "Gamepad" or "Keyboard".|
-|[`product`](../api/UnityEngine.InputSystem.Layouts.InputDeviceDescription.html#UnityEngine_InputSystem_Layouts_InputDeviceDescription_product)|Name of the product as reported by the Device/driver itself.|
-|[`manufacturer`](../api/UnityEngine.InputSystem.Layouts.InputDeviceDescription.html#UnityEngine_InputSystem_Layouts_InputDeviceDescription_manufacturer)|Name of the manufacturer as reported by the Device/driver itself.|
-|[`version`](../api/UnityEngine.InputSystem.Layouts.InputDeviceDescription.html#UnityEngine_InputSystem_Layouts_InputDeviceDescription_version)|If available, provides the version of the driver or hardware for the Device.|
-|[`serial`](../api/UnityEngine.InputSystem.Layouts.InputDeviceDescription.html#UnityEngine_InputSystem_Layouts_InputDeviceDescription_serial)|If available, provides the serial number for the Device.|
-|[`capabilities`](../api/UnityEngine.InputSystem.Layouts.InputDeviceDescription.html#UnityEngine_InputSystem_Layouts_InputDeviceDescription_capabilities)|A string in JSON format that describes Device/interface-specific capabilities. See the [section on capabilities](#capabilities).|
+|[`interfaceName`](xref:UnityEngine.InputSystem.Layouts.InputDeviceDescription.interfaceName)|Identifier for the interface/API that is making the Device available. In many cases, this corresponds to the name of the platform, but there are several more specific interfaces that are commonly used: [HID](https://www.usb.org/hid), [RawInput](https://docs.microsoft.com/en-us/windows/desktop/inputdev/raw-input), [XInput](https://docs.microsoft.com/en-us/windows/desktop/xinput/xinput-game-controller-apis-portal). This field is required.|
+|[`deviceClass`](xref:UnityEngine.InputSystem.Layouts.InputDeviceDescription.deviceClass)|A broad categorization of the Device. For example, "Gamepad" or "Keyboard".|
+|[`product`](xref:UnityEngine.InputSystem.Layouts.InputDeviceDescription.product)|Name of the product as reported by the Device/driver itself.|
+|[`manufacturer`](xref:UnityEngine.InputSystem.Layouts.InputDeviceDescription.manufacturer)|Name of the manufacturer as reported by the Device/driver itself.|
+|[`version`](xref:UnityEngine.InputSystem.Layouts.InputDeviceDescription.version)|If available, provides the version of the driver or hardware for the Device.|
+|[`serial`](xref:UnityEngine.InputSystem.Layouts.InputDeviceDescription.serial)|If available, provides the serial number for the Device.|
+|[`capabilities`](xref:UnityEngine.InputSystem.Layouts.InputDeviceDescription.capabilities)|A string in JSON format that describes Device/interface-specific capabilities. See the [section on capabilities](#capabilities).|
### Capabilities
-Aside from a number of standardized fields, such as `product` and `manufacturer`, a Device description can contain a [`capabilities`](../api/UnityEngine.InputSystem.Layouts.InputDeviceDescription.html#UnityEngine_InputSystem_Layouts_InputDeviceDescription_capabilities) string in JSON format. This string describes characteristics which help the Input System to interpret the data from a Device, and map it to Control representations. Not all Device interfaces report Device capabilities. Examples of interface-specific Device capabilities are [HID descriptors](HID.md). WebGL, Android, and Linux use similar mechanisms to report available Controls on connected gamepads.
+Aside from a number of standardized fields, such as `product` and `manufacturer`, a Device description can contain a [`capabilities`](xref:UnityEngine.InputSystem.Layouts.InputDeviceDescription.capabilities) string in JSON format. This string describes characteristics which help the Input System to interpret the data from a Device, and map it to Control representations. Not all Device interfaces report Device capabilities. Examples of interface-specific Device capabilities are [HID descriptors](xref:input-system-hid). WebGL, Android, and Linux use similar mechanisms to report available Controls on connected gamepads.
### Matching
-[`InputDeviceMatcher`](../api/UnityEngine.InputSystem.Layouts.InputDeviceMatcher.html) instances handle matching an [`InputDeviceDescription`](../api/UnityEngine.InputSystem.Layouts.InputDeviceDescription.html) to a registered layout. Each matcher loosely functions as a kind of regular expression. Each field in the description can be independently matched with either a plain string or regular expression. Matching is not case-sensitive. For a matcher to apply, all of its individual expressions have to match.
+[`InputDeviceMatcher`](xref:UnityEngine.InputSystem.Layouts.InputDeviceMatcher) instances handle matching an [`InputDeviceDescription`](xref:UnityEngine.InputSystem.Layouts.InputDeviceDescription) to a registered layout. Each matcher loosely functions as a kind of regular expression. Each field in the description can be independently matched with either a plain string or regular expression. Matching is not case-sensitive. For a matcher to apply, all of its individual expressions have to match.
-To matchers to any layout, call [`InputSystem.RegisterLayoutMatcher`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_RegisterLayoutMatcher_System_String_UnityEngine_InputSystem_Layouts_InputDeviceMatcher_). You can also supply them when you register a layout.
+To matchers to any layout, call [`InputSystem.RegisterLayoutMatcher`](xref:UnityEngine.InputSystem.InputSystem.RegisterLayoutMatcher(System.String,UnityEngine.InputSystem.Layouts.InputDeviceMatcher)). You can also supply them when you register a layout.
```CSharp
// Register a new layout and supply a matcher for it.
@@ -85,27 +50,28 @@ InputSystem.RegisterLayoutMatcher(
```
-If multiple matchers are matching the same [`InputDeviceDescription`](../api/UnityEngine.InputSystem.Layouts.InputDeviceDescription.html), the Input System chooses the matcher that has the larger number of properties to match against.
+If multiple matchers identifies the same [`InputDeviceDescription`](xref:UnityEngine.InputSystem.Layouts.InputDeviceDescription), the Input System chooses the matcher that has the larger number of properties to match against.
#### Hijacking the matching process
-You can overrule the internal matching process from outside to select a different layout for a Device than the system would normally choose. This also makes it possible to quickly build new layouts. To do this, add a custom handler to the [`InputSystem.onFindControlLayoutForDevice`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_onFindLayoutForDevice) event. If your handler returns a non-null layout string, then the Input System uses this layout.
+You can overrule the internal matching process from outside to select a different layout for a Device than the system would normally choose. This also makes it possible to quickly build new layouts. To do this, add a custom handler to the [`InputSystem.onFindControlLayoutForDevice`](xref:UnityEngine.InputSystem.InputSystem.onFindLayoutForDevice) event. If your handler returns a non-null layout string, then the Input System uses this layout.
### Device lifecycle
#### Device creation
-Once the system has chosen a [layout](Layouts.md) for a device, it instantiates an [`InputDevice`](../api/UnityEngine.InputSystem.InputDevice.html) and populates it with [`InputControls`](../api/UnityEngine.InputSystem.InputControl.html) as the layout dictates. This process is internal and happens automatically.
+Once the system has chosen a [layout](xref:input-system-layouts) for a device, it instantiates an [`InputDevice`](xref:UnityEngine.InputSystem.InputDevice) and populates it with [`InputControls`](xref:UnityEngine.InputSystem.InputControl) as the layout dictates. This process is internal and happens automatically.
->__Note__: You can't create valid [`InputDevices`](../api/UnityEngine.InputSystem.InputDevice.html) and [`InputControls`](../api/UnityEngine.InputSystem.InputControl.html) by manually instantiating them with `new`. To guide the creation process, you must use [layouts](Layouts.md).
+> [!NOTE]
+> You can't create valid [`InputDevices`](xref:UnityEngine.InputSystem.InputDevice) and [`InputControls`](xref:UnityEngine.InputSystem.InputControl) by manually instantiating them with `new`. To guide the creation process, you must use [layouts](xref:input-system-layouts).
-After the Input System assembles the [`InputDevice`](../api/UnityEngine.InputSystem.InputDevice.html), it calls [`FinishSetup`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_FinishSetup_) on each control of the device and on the device itself. Use this to finalize the setup of the Controls.
+After the Input System assembles the [`InputDevice`](xref:UnityEngine.InputSystem.InputDevice), it calls [`FinishSetup`](xref:UnityEngine.InputSystem.InputControl.FinishSetup*) on each control of the device and on the device itself. Use this to finalize the setup of the Controls.
-After an [`InputDevice`](../api/UnityEngine.InputSystem.InputDevice.html) is fully assembled, the Input System adds it to the system. As part of this process, the Input System calls [`MakeCurrent`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_MakeCurrent_) on the Device, and signals [`InputDeviceChange.Added`](../api/UnityEngine.InputSystem.InputDeviceChange.html#UnityEngine_InputSystem_InputDeviceChange_Added) on [`InputSystem.onDeviceChange`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_onDeviceChange). The Input System also calls [`InputDevice.OnAdded`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_OnAdded_).
+After an [`InputDevice`](xref:UnityEngine.InputSystem.InputDevice) is fully assembled, the Input System adds it to the system. As part of this process, the Input System calls [`MakeCurrent`](xref:UnityEngine.InputSystem.InputDevice.MakeCurrent*) on the Device, and signals [`InputDeviceChange.Added`](xref:UnityEngine.InputSystem.InputDeviceChange.Added) on [`InputSystem.onDeviceChange`](xref:UnityEngine.InputSystem.InputSystem.onDeviceChange). The Input System also calls [`InputDevice.OnAdded`](xref:UnityEngine.InputSystem.InputDevice.OnAdded*).
-Once added, the [`InputDevice.added`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_added) flag is set to true.
+Once added, the [`InputDevice.added`](xref:UnityEngine.InputSystem.InputDevice.added) flag is set to true.
-To add devices manually, you can call one of the `InputSystem.AddDevice` methods such as [`InputSystem.AddDevice(layout)`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_AddDevice_System_String_System_String_System_String_).
+To add devices manually, you can call one of the `InputSystem.AddDevice` methods such as [`InputSystem.AddDevice(layout)`](xref:UnityEngine.InputSystem.InputSystem.AddDevice(System.String,System.String,System.String)).
```CSharp
// Add a gamepad. This bypasses the matching process and creates a device directly
@@ -120,58 +86,58 @@ InputSystem.AddDevice(new InputDeviceDescription
});
```
-When a device is added, the Input System automatically issues a [sync request](../api/UnityEngine.InputSystem.LowLevel.RequestSyncCommand.html) on the device. This instructs the device to send an event representing its current state. Whether this request succeeds depends on the whether the given device supports the sync command.
+When a device is added, the Input System automatically issues a [sync request](xref:UnityEngine.InputSystem.LowLevel.RequestSyncCommand) on the device. This instructs the device to send an event representing its current state. Whether this request succeeds depends on the whether the given device supports the sync command.
#### Device removal
-When a Device is disconnected, it is removed from the system. A notification appears for [`InputDeviceChange.Removed`](../api/UnityEngine.InputSystem.InputDeviceChange.html) (sent via [`InputSystem.onDeviceChange`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_onDeviceChange)) and the Devices are removed from the [`devices`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_onDeviceChange) list. The system also calls [`InputDevice.OnRemoved`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_OnRemoved_).
+When a Device is disconnected, it is removed from the system. A notification appears for [`InputDeviceChange.Removed`](xref:UnityEngine.InputSystem.InputDeviceChange) (sent via [`InputSystem.onDeviceChange`](xref:UnityEngine.InputSystem.InputSystem.onDeviceChange)) and the Devices are removed from the [`devices`](xref:UnityEngine.InputSystem.InputSystem.onDeviceChange) list. The system also calls [`InputDevice.OnRemoved`](xref:UnityEngine.InputSystem.InputDevice.OnRemoved*).
-The [`InputDevice.added`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_added) flag is reset to false in the process.
+The [`InputDevice.added`](xref:UnityEngine.InputSystem.InputDevice.added) flag is reset to false in the process.
Note that Devices are not destroyed when removed. Device instances remain valid and you can still access them in code. However, trying to read values from the controls of these Devices leads to exceptions.
#### Device resets
-Resetting a Device resets its Controls to their default state. You can do this manually using [`InputSystem.ResetDevice`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_ResetDevice_UnityEngine_InputSystem_InputDevice_System_Boolean_):
+Resetting a Device resets its Controls to their default state. You can do this manually using [`InputSystem.ResetDevice`](xref:UnityEngine.InputSystem.InputSystem.ResetDevice(UnityEngine.InputSystem.InputDevice,System.Boolean)):
```CSharp
InputSystem.ResetDevice(Gamepad.current);
```
-There are two types of resets as determined by the second parameter to [`InputSystem.ResetDevice`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_ResetDevice_UnityEngine_InputSystem_InputDevice_System_Boolean_):
+There are two types of resets as determined by the second parameter to [`InputSystem.ResetDevice`](xref:UnityEngine.InputSystem.InputSystem.ResetDevice(UnityEngine.InputSystem.InputDevice,System.Boolean)):
-|Type|Description|
+|Reset Type|Description|
|----|-----------|
-|"Soft" Resets|This is the default. With this type, only controls that are *not* marked as [`dontReset`](Layouts.md#control-items) are reset to their default value. This excludes controls such as [`Pointer.position`](../api/UnityEngine.InputSystem.Pointer.html#UnityEngine_InputSystem_Pointer_position) from resets and thus prevents mouse positions resetting to `(0,0)`.|
-|"Hard" Resets|In this type, *all* controls are reset to their default value regardless of whether they have [`dontReset`](Layouts.md#control-items) set or not.|
+|**Soft** Resets|This is the default. With this type, only controls that are not marked as [`dontReset`](xref:input-system-layouts#control-items) are reset to their default value. This excludes controls such as [`Pointer.position`](xref:UnityEngine.InputSystem.Pointer.position) from resets and thus prevents mouse positions resetting to `(0,0)`.|
+|**Hard** Resets|In this type, all controls are reset to their default value regardless of whether they have [`dontReset`](xref:input-system-layouts#control-items) set or not.|
-Resetting Controls this way is visible on [Actions](Actions.md). If you reset a Device that is currently driving one or more Action, the Actions are cancelled. This cancellation is different from sending an event with default state. Whereas the latter may inadvertently [perform](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_performed) Actions (e.g. a button that was pressed would not appear to have been released), a reset will force clean cancellation.
+Resetting Controls this way is visible on [Actions](xref:input-system-actions). If you reset a Device that is currently driving one or more Action, the Actions are cancelled. This cancellation is different from sending an event with default state. Whereas the latter may inadvertently [perform](xref:UnityEngine.InputSystem.InputAction.performed) Actions (for example, a button that was pressed would not appear to have been released), a reset will force clean cancellation.
Resets may be triggered automatically by the Input System depending on [application focus](#background-and-focus-change-behavior).
#### Device syncs
-A Device may be requested to send an event with its current state through [`RequestSyncCommand`](../api/UnityEngine.InputSystem.LowLevel.RequestSyncCommand.html). It depends on the platform and type of Device whether this is supported or not.
+A Device may be requested to send an event with its current state through [`RequestSyncCommand`](xref:UnityEngine.InputSystem.LowLevel.RequestSyncCommand). It depends on the platform and type of Device whether this is supported or not.
-A synchronization request can be explicitly sent using [`InputSystem.TrySyncDevice`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_TrySyncDevice_UnityEngine_InputSystem_InputDevice_). If the device supports sync requests, the method returns true and an [`InputEvent`](../api/UnityEngine.InputSystem.LowLevel.InputEvent.html) will have been queued on the device for processing in the next [update](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_Update_).
+A synchronization request can be explicitly sent using [`InputSystem.TrySyncDevice`](xref:UnityEngine.InputSystem.InputSystem.TrySyncDevice(UnityEngine.InputSystem.InputDevice)). If the device supports sync requests, the method returns true and an [`InputEvent`](xref:UnityEngine.InputSystem.LowLevel.InputEvent) will have been queued on the device for processing in the next [update](xref:UnityEngine.InputSystem.InputSystem.Update*).
Synchronization requests are also automatically sent by the Input System in certain situations. See [Background and focus change behavior](#background-and-focus-change-behavior) for more details.
#### Device enabling and disabling
-When a Device is added, the Input System sends it an initial [`QueryEnabledStateCommand`](../api/UnityEngine.InputSystem.LowLevel.QueryEnabledStateCommand.html) to find out whether the device is currently enabled or not. The result of this is reflected in the [`InputDevice.enabled`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_enabled) property.
+When a Device is added, the Input System sends it an initial [`QueryEnabledStateCommand`](xref:UnityEngine.InputSystem.LowLevel.QueryEnabledStateCommand) to find out whether the device is currently enabled or not. The result of this is reflected in the [`InputDevice.enabled`](xref:UnityEngine.InputSystem.InputDevice.enabled) property.
-When disabled, no events other than removal ([`DeviceRemoveEvent`](../api/UnityEngine.InputSystem.LowLevel.DeviceRemoveEvent.html)) and configuration change ([`DeviceConfigurationEvent`](../api/UnityEngine.InputSystem.LowLevel.DeviceConfigurationEvent.html)) events are processed for a Device, even if they are sent.
+When disabled, no events other than removal ([`DeviceRemoveEvent`](xref:UnityEngine.InputSystem.LowLevel.DeviceRemoveEvent)) and configuration change ([`DeviceConfigurationEvent`](xref:UnityEngine.InputSystem.LowLevel.DeviceConfigurationEvent)) events are processed for a Device, even if they are sent.
-A Device can be manually disabled and re-enabled via [`InputSystem.DisableDevice`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_DisableDevice_) and [`InputSystem.EnableDevice`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_EnableDevice_) respectively.
+A Device can be manually disabled and re-enabled via [`InputSystem.DisableDevice`](xref:UnityEngine.InputSystem.InputSystem.DisableDevice*) and [`InputSystem.EnableDevice`](xref:UnityEngine.InputSystem.InputSystem.EnableDevice*) respectively.
-Note that [sensors](Sensors.md) start in a disabled state by default, and you need to enable them in order for them to generate events.
+Note that [sensors](xref:input-system-sensors) start in a disabled state by default, and you need to enable them in order for them to generate events.
The Input System may automatically disable and re-enable Devices in certain situations, as detailed in the [next section](#background-and-focus-change-behavior).
#### Background and focus change behavior
-In general, input is tied to [application focus](https://docs.unity3d.com/ScriptReference/Application-isFocused.html). This means that Devices do not receive input while the application is not in the foreground and thus no [Actions](Actions.md) will receive input either. When the application comes back into focus, all devices will receive a [sync](#device-syncs) request to have them send their current state (which may have changed while the application was in the background) to the application. Devices that do not support sync requests will see a [soft reset](#device-resets) that resets all Controls not marked as [`dontReset`](Layouts.md#control-items) to their default state.
+In general, input is tied to [application focus](xref:UnityEngine.Application.isFocused). This means that Devices do not receive input while the application is not in the foreground and thus no [Actions](xref:input-system-actions) will receive input either. When the application comes back into focus, all devices will receive a [sync](#device-syncs) request to have them send their current state (which may have changed while the application was in the background) to the application. Devices that do not support sync requests will see a [soft reset](#device-resets) that resets all Controls not marked as [`dontReset`](xref:input-system-layouts#control-items) to their default state.
On platforms such as iOS and Android, that do not support running Unity applications in the background, this is the only supported behavior.
@@ -182,12 +148,16 @@ If the application is configured to run while in the background (that is, not ha
If the application is configured this way to keep running while in the background, the player loop and thus the Input System, too, will keep running even when the application does not have focus. What happens with respect to input then depends on two factors:
-1. On the ability of individual devices to receive input while the application is not running in the foreground. This is only supported by a small subset of devices and platforms. VR devices ([`TrackedDevice`](../api/UnityEngine.InputSystem.TrackedDevice.html)) such as HMDs and VR controllers generally support this. To find out whether a specific device supports this, you can query the [`InputDevice.canRunInBackground`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_canRunInBackground) property. This property can also be forced to true or false via a Device's [layout](Layouts.md#control-items).
-2. On two settings you can find in the project-wide [Input Settings](Settings.md). Specifically, [`InputSettings.backgroundBehavior`](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_backgroundBehavior) and [`InputSettings.editorInputBehaviorInPlayMode`](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_editorInputBehaviorInPlayMode). The table below shows a detailed breakdown of how input behaviors vary based on these two settings and in relation to the `Run In Background` player setting in Unity.
+1. On the ability of individual devices to receive input while the application is not running in the foreground. This is only supported by a small subset of devices and platforms. VR devices ([`TrackedDevice`](xref:UnityEngine.InputSystem.TrackedDevice)) such as HMDs and VR controllers generally support this.
+
+ To find out whether a specific device supports this, you can query the [`InputDevice.canRunInBackground`](xref:UnityEngine.InputSystem.InputDevice.canRunInBackground) property. This property can also be forced to true or false via a Device's [layout](xref:input-system-layouts#control-items).
+
+ > [!NOTE]
+ > [`InputDevice.canRunInBackground`](xref:UnityEngine.InputSystem.InputDevice.canRunInBackground) is overridden by the editor in certain situations (see table below). In general, the value of the property does not have to be the same between the editor and the player and depends on the specific platform and device.
->__Note__: [`InputDevice.canRunInBackground`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_canRunInBackground) is overridden by the editor in certain situations (see table below). In general, the value of the property does not have to be the same between the editor and the player and depends on the specific platform and device.
+2. On two settings you can find in the project-wide [Input Settings](xref:input-system-settings): [`InputSettings.backgroundBehavior`](xref:UnityEngine.InputSystem.InputSettings.backgroundBehavior) and [`InputSettings.editorInputBehaviorInPlayMode`](xref:UnityEngine.InputSystem.InputSettings.editorInputBehaviorInPlayMode). The table below shows a detailed breakdown of how input behaviors vary based on these two settings and in relation to the `Run In Background` player setting in Unity.
-The following table shows the full matrix of behaviors according to the [Input Settings](Settings.md) and whether the game is running in the editor or in the player.
+The following table shows the full matrix of behaviors according to the [Input Settings](xref:input-system-settings) and whether the game is running in the editor or in the player.

@@ -199,11 +169,11 @@ Note that layout registrations do not persist across domain reloads. Instead, th
## Native Devices
-Devices that the [native backend](Architecture.md#native-backend) reports are considered native (as opposed to Devices created from script code). To identify these Devices, you can check the [`InputDevice.native`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_native) property.
+Devices that the [native backend](xref:input-system-architecture#native-backend) reports are considered native (as opposed to Devices created from script code). To identify these Devices, you can check the [`InputDevice.native`](xref:UnityEngine.InputSystem.InputDevice.native) property.
The Input System remembers native Devices. For example, if the system has no matching layout when the Device is first reported, but a layout which matches the device is registered later, the system uses this layout to recreate the Device.
-You can force the Input System to use your own [layout](Layouts.md) when the native backend discovers a specific Device, by describing the Device in the layout, like this:
+You can force the Input System to use your own [layout](xref:input-system-layouts) when the native backend discovers a specific Device, by describing the Device in the layout, like this:
```
{
@@ -217,64 +187,65 @@ You can force the Input System to use your own [layout](Layouts.md) when the nat
}
```
-Note: You don't have to restart Unity in order for changes in your layout to take effect on native Devices. The Input System applies changes automatically on every domain reload, so you can just keep refining a layout and your Device is recreated with the most up-to-date version every time scripts are recompiled.
+> [!NOTE]
+> You don't have to restart Unity in order for changes in your layout to take effect on native Devices. The Input System applies changes automatically on every domain reload, so you can just keep refining a layout and your Device is recreated with the most up-to-date version every time scripts are recompiled.
### Disconnected Devices
-If you want to get notified when Input Devices disconnect, subscribe to the [`InputSystem.onDeviceChange`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_onDeviceChange) event, and look for events of type [`InputDeviceChange.Disconnected`](../api/UnityEngine.InputSystem.InputDeviceChange.html).
+If you want to get notified when Input Devices disconnect, subscribe to the [`InputSystem.onDeviceChange`](xref:UnityEngine.InputSystem.InputSystem.onDeviceChange) event, and look for events of type [`InputDeviceChange.Disconnected`](xref:UnityEngine.InputSystem.InputDeviceChange).
-The Input System keeps track of disconnected Devices in [`InputSystem.disconnectedDevices`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_disconnectedDevices). If one of these Devices reconnects later, the Input System can detect that the Device was connected before, and reuses its [`InputDevice`](../api/UnityEngine.InputSystem.InputDevice.html) instance. This allows the [`PlayerInputManager`](PlayerInputManager.md) to reassign the Device to the same [user](UserManagement.md) again.
+The Input System keeps track of disconnected Devices in [`InputSystem.disconnectedDevices`](xref:UnityEngine.InputSystem.InputSystem.disconnectedDevices). If one of these Devices reconnects later, the Input System can detect that the Device was connected before, and reuses its [`InputDevice`](xref:UnityEngine.InputSystem.InputDevice) instance. This allows the [`PlayerInputManager`](xref:input-system-player-input-manager) to reassign the Device to the same [user](xref:input-system-user-management) again.
## Device IDs
-Each Device that is created receives a unique numeric ID. You can access this ID through [`InputDevice.deviceId`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_deviceId).
+Each Device that is created receives a unique numeric ID. You can access this ID through [`InputDevice.deviceId`](xref:UnityEngine.InputSystem.InputDevice.deviceId).
All IDs are only used once per Unity session.
## Device usages
-Like any [`InputControl`](../api/UnityEngine.InputSystem.InputControl.html), a Device can have usages associated with it. You can query usages with the [`usages`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_usages) property, and use[`InputSystem.SetDeviceUsage()`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_SetDeviceUsage_UnityEngine_InputSystem_InputDevice_System_String_) to set them. Usages can be arbitrary strings with arbitrary meanings. One common case where the Input System assigns Devices usages is the handedness of XR controllers, which are tagged with the "LeftHand" or "RightHand" usages.
+Like any [`InputControl`](xref:UnityEngine.InputSystem.InputControl), a Device can have usages associated with it. You can query usages with the [`usages`](xref:UnityEngine.InputSystem.InputControl.usages) property, and use[`InputSystem.SetDeviceUsage()`](xref:UnityEngine.InputSystem.InputSystem.SetDeviceUsage(UnityEngine.InputSystem.InputDevice,System.String)) to set them. Usages can be arbitrary strings with arbitrary meanings. One common case where the Input System assigns Devices usages is the handedness of XR controllers, which are tagged with the "LeftHand" or "RightHand" usages.
## Device commands
-While input [events](Events.md) deliver data from a Device, commands send data back to the Device. The Input System uses these to retrieve specific information from the Device, to trigger functions on the Device (such as rumble effects), and for a variety of other needs.
+While input [events](xref:input-system-events) deliver data from a Device, commands send data back to the Device. The Input System uses these to retrieve specific information from the Device, to trigger functions on the Device (such as rumble effects), and for a variety of other needs.
### Sending commands to Devices
-The Input System sends commands to the Device through [`InputDevice.ExecuteCommand`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_ExecuteCommand__1___0__). To monitor Device commands, use [`InputSystem.onDeviceCommand`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_onDeviceCommand).
+The Input System sends commands to the Device through [`InputDevice.ExecuteCommand`](xref:UnityEngine.InputSystem.InputDevice.ExecuteCommand``1(``0@)). To monitor Device commands, use [`InputSystem.onDeviceCommand`](xref:UnityEngine.InputSystem.InputSystem.onDeviceCommand).
-Each Device command implements the [`IInputDeviceCommandInfo`](../api/UnityEngine.InputSystem.LowLevel.IInputDeviceCommandInfo.html) interface, which only requires the [`typeStatic`](../api/UnityEngine.InputSystem.LowLevel.IInputDeviceCommandInfo.html#UnityEngine_InputSystem_LowLevel_IInputDeviceCommandInfo_typeStatic) property to identify the type of the command. The native implementation of the Device should then understand how to handle that command. One common case is the `"HIDO"` command type which is used to send [HID output reports](HID.md#hid-output) to HIDs.
+Each Device command implements the [`IInputDeviceCommandInfo`](xref:UnityEngine.InputSystem.LowLevel.IInputDeviceCommandInfo) interface, which only requires the [`typeStatic`](xref:UnityEngine.InputSystem.LowLevel.IInputDeviceCommandInfo.typeStatic) property to identify the type of the command. The native implementation of the Device should then understand how to handle that command. One common case is the `"HIDO"` command type which is used to send [HID output reports](xref:input-system-hid#hid-output) to HIDs.
### Adding custom device Commands
-To create custom Device commands (for example, to support some functionality for a specific HID), create a `struct` that contains all the data to be sent to the Device, and add a [`typeStatic`](../api/UnityEngine.InputSystem.LowLevel.IInputDeviceCommandInfo.html#UnityEngine_InputSystem_LowLevel_IInputDeviceCommandInfo_typeStatic) property to make that struct implement the [`IInputDeviceCommandInfo`](../api/UnityEngine.InputSystem.LowLevel.IInputDeviceCommandInfo.html) interface. To send data to a HID, this property should return `"HIDO"`.
+To create custom Device commands (for example, to support some functionality for a specific HID), create a `struct` that contains all the data to be sent to the Device, and add a [`typeStatic`](xref:UnityEngine.InputSystem.LowLevel.IInputDeviceCommandInfo.typeStatic) property to make that struct implement the [`IInputDeviceCommandInfo`](xref:UnityEngine.InputSystem.LowLevel.IInputDeviceCommandInfo) interface. To send data to a HID, this property should return `"HIDO"`.
-You can then create an instance of this struct and populate all its fields, then use [`InputDevice.ExecuteCommand`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_ExecuteCommand__1___0__) to send it to the Device. The data layout of the struct must match the native representation of the data as the device interprets it.
+You can then create an instance of this struct and populate all its fields, then use [`InputDevice.ExecuteCommand`](xref:UnityEngine.InputSystem.InputDevice.ExecuteCommand``1(``0@)) to send it to the Device. The data layout of the struct must match the native representation of the data as the device interprets it.
## Device state
-Like any other type of [Control](Controls.md#control-state), each Device has a block of memory allocated to it which stores the state of all the Controls associated with the Device.
+Like any other type of [Control](xref:input-system-controls#control-state), each Device has a block of memory allocated to it which stores the state of all the Controls associated with the Device.
### State changes
-State changes are usually initiated through [state events](Events.md#state-events) from the native backend, but you can use [`InputControl<>.WriteValueIntoState()`](../api/UnityEngine.InputSystem.InputControl-1.html#UnityEngine_InputSystem_InputControl_1_WriteValueIntoState__0_System_Void__) to manually overwrite the state of any Control.
+State changes are usually initiated through [state events](xref:input-system-events#state-events) from the native backend, but you can use [`InputControl<>.WriteValueIntoState()`](xref:UnityEngine.InputSystem.InputControl`1.WriteValueIntoState(`0,System.Void*)) to manually overwrite the state of any Control.
#### Monitoring state changes
-You can use [`InputState.AddChangeMonitor()`](../api/UnityEngine.InputSystem.LowLevel.InputState.html#UnityEngine_InputSystem_LowLevel_InputState_AddChangeMonitor_UnityEngine_InputSystem_InputControl_System_Action_UnityEngine_InputSystem_InputControl_System_Double_UnityEngine_InputSystem_LowLevel_InputEventPtr_System_Int64__System_Int32_System_Action_UnityEngine_InputSystem_InputControl_System_Double_System_Int64_System_Int32__) to register a callback to be called whenever the state of a Control changes. The Input System uses the same mechanism to implement [input Actions](Actions.md).
+You can use [`InputState.AddChangeMonitor()`](xref:UnityEngine.InputSystem.LowLevel.InputState.AddChangeMonitor(UnityEngine.InputSystem.InputControl,System.Action{UnityEngine.InputSystem.InputControl,System.Double,UnityEngine.InputSystem.LowLevel.InputEventPtr,System.Int64},System.Int32,System.Action{UnityEngine.InputSystem.InputControl,System.Double,System.Int64,System.Int32})) to register a callback to be called whenever the state of a Control changes. The Input System uses the same mechanism to implement [input Actions](xref:input-system-actions).
#### Synthesizing state
-The Input System can synthesize a new state from an existing state. An example of such a synthesized state is the [`press`](../api/UnityEngine.InputSystem.Pointer.html#UnityEngine_InputSystem_Pointer_press) button Control that [`Touchscreen`](../api/UnityEngine.InputSystem.Touchscreen.html) inherits from [`Pointer`](../api/UnityEngine.InputSystem.Pointer.html). Unlike a mouse, which has a physical button, for [`Touchscreen`](../api/UnityEngine.InputSystem.Touchscreen.html) this is a [synthetic Control](Controls.md#synthetic-controls) that doesn't correspond to actual data coming in from the Device backend. Instead, the Input System considers the button to be pressed if any touch is currently ongoing, and released otherwise.
+The Input System can synthesize a new state from an existing state. An example of such a synthesized state is the [`press`](xref:UnityEngine.InputSystem.Pointer.press) button Control that [`Touchscreen`](xref:UnityEngine.InputSystem.Touchscreen) inherits from [`Pointer`](xref:UnityEngine.InputSystem.Pointer). Unlike a mouse, which has a physical button, for [`Touchscreen`](xref:UnityEngine.InputSystem.Touchscreen) this is a [synthetic Control](xref:input-system-controls#synthetic-controls) that doesn't correspond to actual data coming in from the Device backend. Instead, the Input System considers the button to be pressed if any touch is currently ongoing, and released otherwise.
-To do this, the Input System uses [`InputState.Change`](../api/UnityEngine.InputSystem.LowLevel.InputState.html#UnityEngine_InputSystem_LowLevel_InputState_Change__1_UnityEngine_InputSystem_InputControl___0_UnityEngine_InputSystem_LowLevel_InputUpdateType_UnityEngine_InputSystem_LowLevel_InputEventPtr_), which allows feeding arbitrary state changes into the system without having to run them through the input event queue. The Input System incorporates state changes directly and synchronously. State change [monitors](#monitoring-state-changes) still trigger as expected.
+To do this, the Input System uses [`InputState.Change`](xref:UnityEngine.InputSystem.LowLevel.InputState.Change``1(UnityEngine.InputSystem.InputControl,``0,UnityEngine.InputSystem.LowLevel.InputUpdateType,UnityEngine.InputSystem.LowLevel.InputEventPtr)), which allows feeding arbitrary state changes into the system without having to run them through the input event queue. The Input System incorporates state changes directly and synchronously. State change [monitors](#monitoring-state-changes) still trigger as expected.
## Working with Devices
### Monitoring Devices
-To be notified when new Devices are added or existing Devices are removed, use [`InputSystem.onDeviceChange`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_onDeviceChange).
+To be notified when new Devices are added or existing Devices are removed, use [`InputSystem.onDeviceChange`](xref:UnityEngine.InputSystem.InputSystem.onDeviceChange).
```CSharp
InputSystem.onDeviceChange +=
@@ -301,24 +272,25 @@ InputSystem.onDeviceChange +=
}
```
-[`InputSystem.onDeviceChange`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_onDeviceChange) delivers notifications for other device-related changes as well. See the [`InputDeviceChange` enum](../api/UnityEngine.InputSystem.InputDeviceChange.html) for more information.
+[`InputSystem.onDeviceChange`](xref:UnityEngine.InputSystem.InputSystem.onDeviceChange) delivers notifications for other device-related changes as well. See the [`InputDeviceChange` enum](xref:UnityEngine.InputSystem.InputDeviceChange) for more information.
### Adding and removing Devices
-To manually add and remove Devices through the API, use [`InputSystem.AddDevice()`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_AddDevice_UnityEngine_InputSystem_InputDevice_) and [`InputSystem.RemoveDevice()`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_RemoveDevice_UnityEngine_InputSystem_InputDevice_).
+To manually add and remove Devices through the API, use [`InputSystem.AddDevice()`](xref:UnityEngine.InputSystem.InputSystem.AddDevice(UnityEngine.InputSystem.InputDevice)) and [`InputSystem.RemoveDevice()`](xref:UnityEngine.InputSystem.InputSystem.RemoveDevice(UnityEngine.InputSystem.InputDevice)).
-This allows you to create your own Devices, which can be useful for testing purposes, or for creating virtual Input Devices which synthesize input from other events. As an example, see the [on-screen Controls](OnScreen.md) that the Input System provides. The Input Devices used for on-screen Controls are created entirely in code and have no [native representation](#native-devices).
+This allows you to create your own Devices, which can be useful for testing purposes, or for creating virtual Input Devices which synthesize input from other events. As an example, see the [on-screen Controls](xref:input-system-on-screen) that the Input System provides. The Input Devices used for on-screen Controls are created entirely in code and have no [native representation](#native-devices).
### Creating custom Devices
->__Note__: This example deals only with Devices that have fixed layouts (that is, you know the specific model or models that you want to implement). This is different from an interface such as HID, where Devices can describe themselves through the interface and take on a wide variety of forms. A fixed Device layout can't cover self-describing Devices, so you need to use a [layout builder](Layouts.md#generated-layouts) to build Device layouts from information you obtain at runtime.
+> [!NOTE]
+> This example deals only with Devices that have fixed layouts (that is, you know the specific model or models that you want to implement). This is different from an interface such as HID, where Devices can describe themselves through the interface and take on a wide variety of forms. A fixed Device layout can't cover self-describing Devices, so you need to use a [layout builder](xref:input-system-layouts#generated-layouts) to build Device layouts from information you obtain at runtime.
There are two main situations in which you might need to create a custom Device:
1. You have an existing API that generates input, and which you want to reflect into the Input System.
2. You have an HID that the Input System ignores, or that the Input system auto-generates a layout for that doesn't work well enough for your needs.
-For the second scenario, see [Overriding the HID Fallback](HID.md#creating-a-custom-device-layout).
+For the second scenario, see [Overriding the HID Fallback](xref:input-system-hid#creating-a-custom-device-layout).
The steps below deal with the first scenario, where you want to create a new Input Device entirely from scratch and provide input to it from a third-party API.
@@ -361,15 +333,15 @@ public struct MyDeviceState : IInputStateTypeInfo
}
```
-The Input System's layout mechanism uses [`InputControlAttribute`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html) annotations to add Controls to the layout of your Device. For details, see the [layout system](Layouts.md) documentation.
+The Input System's layout mechanism uses [`InputControlAttribute`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute) annotations to add Controls to the layout of your Device. For details, see the [layout system](xref:input-system-layouts) documentation.
-With the state struct in place, you now have a way to send input data to the Input System and store it there. The next thing you need is an [`InputDevice`](../api/UnityEngine.InputSystem.InputDevice.html) that uses your custom state struct and represents your custom Device.
+With the state struct in place, you now have a way to send input data to the Input System and store it there. The next thing you need is an [`InputDevice`](xref:UnityEngine.InputSystem.InputDevice) that uses your custom state struct and represents your custom Device.
#### Step 2: The Device class
-Next, you need a class derived from one of the [`InputDevice`](../api/UnityEngine.InputSystem.InputDevice.html) base classes. You can either base your Device directly on [`InputDevice`](../api/UnityEngine.InputSystem.InputDevice.html), or you can pick a more specific Device type, like [`Gamepad`](../api/UnityEngine.InputSystem.Gamepad.html).
+Next, you need a class derived from one of the [`InputDevice`](xref:UnityEngine.InputSystem.InputDevice) base classes. You can either base your Device directly on [`InputDevice`](xref:UnityEngine.InputSystem.InputDevice), or you can pick a more specific Device type, like [`Gamepad`](xref:UnityEngine.InputSystem.Gamepad).
-This example assumes that your Device doesn't fit into any of the existing Device classes, so it derives directly from [`InputDevice`](../api/UnityEngine.InputSystem.InputDevice.html).
+This example assumes that your Device doesn't fit into any of the existing Device classes, so it derives directly from [`InputDevice`](xref:UnityEngine.InputSystem.InputDevice).
```CSharp
// InputControlLayoutAttribute attribute is only necessary if you want
@@ -412,9 +384,10 @@ You now have a Device in place along with its associated state format. You can c
InputSystem.AddDevice();
```
-However, this Device doesn't receive input yet, because you haven't added any code that generates input. To do that, you can use [`InputSystem.QueueStateEvent`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_QueueStateEvent__1_UnityEngine_InputSystem_InputDevice___0_System_Double_) or [`InputSystem.QueueDeltaStateEvent`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_QueueDeltaStateEvent__1_UnityEngine_InputSystem_InputControl___0_System_Double_) from anywhere, including from a thread. The following example uses [`IInputUpdateCallbackReceiver`](../api/UnityEngine.InputSystem.LowLevel.IInputUpdateCallbackReceiver.html), which, when implemented by any [`InputDevice`](../api/UnityEngine.InputSystem.InputDevice.html), adds an [`OnUpdate()`](../api/UnityEngine.InputSystem.LowLevel.IInputUpdateCallbackReceiver.html#UnityEngine_InputSystem_LowLevel_IInputUpdateCallbackReceiver_OnUpdate) method that automatically gets called during [`InputSystem.onBeforeUpdate`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_onBeforeUpdate) and provides input events to the current input update.
+However, this Device doesn't receive input yet, because you haven't added any code that generates input. To do that, you can use [`InputSystem.QueueStateEvent`](xref:UnityEngine.InputSystem.InputSystem.QueueStateEvent``1(UnityEngine.InputSystem.InputDevice,``0,System.Double)) or [`InputSystem.QueueDeltaStateEvent`](xref:UnityEngine.InputSystem.InputSystem.QueueDeltaStateEvent``1(UnityEngine.InputSystem.InputControl,``0,System.Double)) from anywhere, including from a thread. The following example uses [`IInputUpdateCallbackReceiver`](xref:UnityEngine.InputSystem.LowLevel.IInputUpdateCallbackReceiver), which, when implemented by any [`InputDevice`](xref:UnityEngine.InputSystem.InputDevice), adds an [`OnUpdate()`](xref:UnityEngine.InputSystem.LowLevel.IInputUpdateCallbackReceiver.OnUpdate) method that automatically gets called during [`InputSystem.onBeforeUpdate`](xref:UnityEngine.InputSystem.InputSystem.onBeforeUpdate) and provides input events to the current input update.
->__Note__: If you already have a place where input for your device becomes available, you can skip this step and queue input events from there instead of using [`IInputUpdateCallbackReceiver`](../api/UnityEngine.InputSystem.LowLevel.IInputUpdateCallbackReceiver.html).
+> [!NOTE]
+> If you already have a place where input for your device becomes available, you can skip this step and queue input events from there instead of using [`IInputUpdateCallbackReceiver`](xref:UnityEngine.InputSystem.LowLevel.IInputUpdateCallbackReceiver).
```CSharp
public class MyDevice : InputDevice, IInputUpdateCallbackReceiver
@@ -433,7 +406,7 @@ public class MyDevice : InputDevice, IInputUpdateCallbackReceiver
#### Step 4: Device registration and creation
-You now have a functioning device, but you haven't registered it (added it to the system) yet. This means you can't see the device when, for example, you create bindings in the [Action editor](ActionAssets.md#editing-input-action-assets).
+You now have a functioning device, but you haven't registered it (added it to the system) yet. This means you can't see the device when, for example, you create bindings in the [Action editor](xref:input-system-action-assets#editing-input-action-assets).
You can register your device type with the system from within the code that runs automatically as part of Unity's startup. To do so, modify the definition of `MyDevice` like so:
@@ -466,7 +439,7 @@ public class MyDevice : InputDevice, IInputUpdateCallbackReceiver
This registers the Device type with the system and makes it available in the Control picker. However, you still need a way to add an instance of the Device when it is connected.
-In theory, you could call [`InputSystem.AddDevice()`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_AddDevice__1_System_String_) somewhere, but in a real-world setup you likely have to correlate the Input Devices you create with their identities in the third-party API.
+In theory, you could call [`InputSystem.AddDevice()`](xref:UnityEngine.InputSystem.InputSystem.AddDevice``1(System.String)) somewhere, but in a real-world setup you likely have to correlate the Input Devices you create with their identities in the third-party API.
It might be tempting to do something like this:
@@ -480,7 +453,7 @@ public class MyDevice : InputDevice, IInputUpdateCallbackReceiver
}
```
-and then set that on the Device after calling [`AddDevice`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_AddDevice__1_System_String_). However, this doesn't work as expected in the Editor, because the Input System requires Devices to be created solely from their [`InputDeviceDescription`](../api/UnityEngine.InputSystem.Layouts.InputDeviceDescription.html) in combination with the chosen layout (and layout variant). In addition, the system supports a fixed set of mutable per-device properties such as device usages (that is, [`InputSystem.SetDeviceUsage()`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_SetDeviceUsage_UnityEngine_InputSystem_InputDevice_System_String_) and related methods). This allows the system to easily recreate Devices after domain reloads in the Editor, as well as to create replicas of remote Devices when connecting to a Player. To comply with this requirement, you must cast that information provided by the third-party API into an [`InputDeviceDescription`](../api/UnityEngine.InputSystem.Layouts.InputDeviceDescription.html) and then use an [`InputDeviceMatcher`](../api/UnityEngine.InputSystem.Layouts.InputDeviceMatcher.html) to match the description to our custom `MyDevice` layout.
+and then set that on the Device after calling [`AddDevice`](xref:UnityEngine.InputSystem.InputSystem.AddDevice``1(System.String)). However, this doesn't work as expected in the Editor, because the Input System requires Devices to be created solely from their [`InputDeviceDescription`](xref:UnityEngine.InputSystem.Layouts.InputDeviceDescription) in combination with the chosen layout (and layout variant). In addition, the system supports a fixed set of mutable per-device properties such as device usages (that is, [`InputSystem.SetDeviceUsage()`](xref:UnityEngine.InputSystem.InputSystem.SetDeviceUsage(UnityEngine.InputSystem.InputDevice,System.String)) and related methods). This allows the system to easily recreate Devices after domain reloads in the Editor, as well as to create replicas of remote Devices when connecting to a Player. To comply with this requirement, you must cast that information provided by the third-party API into an [`InputDeviceDescription`](xref:UnityEngine.InputSystem.Layouts.InputDeviceDescription) and then use an [`InputDeviceMatcher`](xref:UnityEngine.InputSystem.Layouts.InputDeviceMatcher) to match the description to our custom `MyDevice` layout.
This example assumes that the third-party API has two callbacks, like this:
diff --git a/Packages/com.unity.inputsystem/Documentation~/EditorFeatures.md b/Packages/com.unity.inputsystem/Documentation~/EditorFeatures.md
index d640a9c621..f7aa31087d 100644
--- a/Packages/com.unity.inputsystem/Documentation~/EditorFeatures.md
+++ b/Packages/com.unity.inputsystem/Documentation~/EditorFeatures.md
@@ -5,14 +5,14 @@ uid: input-system-editor-features
This section describes how the Input System integrates with the Unity Editor, which allows you to read input in edit mode, debug input values, and set up automated input tests.
-### [Using Input in the Editor](UseInEditor.md)
+### [Using Input in the Editor](xref:input-system-use-in-editor)
-Unlike Unity's old Input Manager, the Input System package allows you to read input from within [Editor window code](https://docs.unity3d.com/Manual/editor-EditorWindows.html) as well. ([Read more](UseInEditor.md))
+Unlike Unity's old Input Manager, the Input System package allows you to read input from within [Editor window code](https://docs.unity3d.com/Manual/editor-EditorWindows.html) as well. ([Read more](xref:input-system-use-in-editor))
-### [The Input Debugger](Debugging.md)
+### [The Input Debugger](xref:input-system-debugging)
-When something isn't working as expected, the quickest way to troubleshoot what's wrong is the Input Debugger in the Unity Editor. The Input Debugger provides access to the activity of the Input System in both the Editor and the connected Players. ([Read more](Debugging.md))
+When something isn't working as expected, the quickest way to troubleshoot what's wrong is the Input Debugger in the Unity Editor. The Input Debugger provides access to the activity of the Input System in both the Editor and the connected Players. ([Read more](xref:input-system-debugging))
-### [Automated Input Testing](Testing.md)
+### [Automated Input Testing](xref:input-system-testing)
-The Input System has built-in support for writing automated input tests. You can drive input entirely from code, without any dependencies on platform backends and physical hardware devices. The automated input tests you write consider the generated input to be the same as input generated at runtime by actual platform code. ([Read more](Testing.md))
+The Input System has built-in support for writing automated input tests. You can drive input entirely from code, without any dependencies on platform backends and physical hardware devices. The automated input tests you write consider the generated input to be the same as input generated at runtime by actual platform code. ([Read more](xref:input-system-testing))
diff --git a/Packages/com.unity.inputsystem/Documentation~/Events.md b/Packages/com.unity.inputsystem/Documentation~/Events.md
index 1953f6da3e..ff48af0ade 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Events.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Events.md
@@ -3,37 +3,26 @@ uid: input-system-events
---
# Input events
-* [Types of events](#types-of-events)
- * [State events](#state-events)
- * [Device events](#device-events)
- * [Text events](#text-events)
-* [Working with events](#working-with-events)
- * [Listening to events](#listening-to-events)
- * [Reading state events](#reading-state-events)
- * [Creating events](#creating-events)
- * [Capturing events](#capturing-events)
-* [Processing events](#processing-events)
- * [Merging of events](#merging-of-events)
-
The Input System is event-driven. All input is delivered as events, and you can generate custom input by injecting events. You can also observe all source input by listening in on the events flowing through the system.
->__Note__: Events are an advanced, mostly internal feature of the Input System. Knowledge of the event system is mostly useful if you want to support custom Devices, or change the behavior of existing Devices.
+> [!NOTE]
+> Events are an advanced, mostly internal feature of the Input System. Knowledge of the event system is mostly useful if you want to support custom Devices, or change the behavior of existing Devices.
Input events are a low-level mechanism. Usually, you don't need to deal with events if all you want to do is receive input for your app. Events are stored in unmanaged memory buffers and not converted to C# heap objects. The Input System provides wrapper APIs, but unsafe code is required for more involved event manipulations.
Note that there are no routing mechanism. The runtime delivers events straight to the Input System, which then incorporates them directly into the Device state.
-Input events are represented by the [`InputEvent`](../api/UnityEngine.InputSystem.LowLevel.InputEvent.html) struct. Each event has a set of common properties:
+Input events are represented by the [`InputEvent`](xref:UnityEngine.InputSystem.LowLevel.InputEvent) struct. Each event has a set of common properties:
|Property|Description|
|--------|-----------|
-|[`type`](../api/UnityEngine.InputSystem.LowLevel.InputEvent.html#UnityEngine_InputSystem_LowLevel_InputEvent_type)|[`FourCC`](../api/UnityEngine.InputSystem.Utilities.FourCC.html) code that indicates what type of event it is.|
-|[`eventId`](../api/UnityEngine.InputSystem.LowLevel.InputEvent.html#UnityEngine_InputSystem_LowLevel_InputEvent_eventId)|Unique numeric ID of the event.|
-|[`time`](../api/UnityEngine.InputSystem.LowLevel.InputEvent.html#UnityEngine_InputSystem_LowLevel_InputEvent_time)|Timestamp of when the event was generated. This is on the same timeline as [`Time.realtimeSinceStartup`](https://docs.unity3d.com/ScriptReference/Time-realtimeSinceStartup.html).|
-|[`deviceId`](../api/UnityEngine.InputSystem.LowLevel.InputEvent.html#UnityEngine_InputSystem_LowLevel_InputEvent_deviceId)|ID of the Device that the event targets.|
-|[`sizeInBytes`](../api/UnityEngine.InputSystem.LowLevel.InputEvent.html#UnityEngine_InputSystem_LowLevel_InputEvent_sizeInBytes)|Total size of the event in bytes.|
+|[`type`](xref:UnityEngine.InputSystem.LowLevel.InputEvent.type)|[`FourCC`](xref:UnityEngine.InputSystem.Utilities.FourCC) code that indicates what type of event it is.|
+|[`eventId`](xref:UnityEngine.InputSystem.LowLevel.InputEvent.eventId)|Unique numeric ID of the event.|
+|[`time`](xref:UnityEngine.InputSystem.LowLevel.InputEvent.time)|Timestamp of when the event was generated. This is on the same timeline as [`Time.realtimeSinceStartup`](xref:UnityEngine.Time.realtimeSinceStartup).|
+|[`deviceId`](xref:UnityEngine.InputSystem.LowLevel.InputEvent.deviceId)|ID of the Device that the event targets.|
+|[`sizeInBytes`](xref:UnityEngine.InputSystem.LowLevel.InputEvent.sizeInBytes)|Total size of the event in bytes.|
-You can observe the events received for a specific input device in the [input debugger](Debugging.md#debugging-devices).
+You can observe the events received for a specific input device in the [input debugger](xref:input-system-debugging#debugging-devices).
## Types of events
@@ -43,43 +32,43 @@ A state event contains the input state for a Device. The Input System uses these
There are two types of state events:
-* [`StateEvent`](../api/UnityEngine.InputSystem.LowLevel.StateEvent.html) (`'STAT'`)
-* [`DeltaStateEvent`](../api/UnityEngine.InputSystem.LowLevel.StateEvent.html) (`'DLTA'`)
+* [`StateEvent`](xref:UnityEngine.InputSystem.LowLevel.StateEvent) (`'STAT'`)
+* [`DeltaStateEvent`](xref:UnityEngine.InputSystem.LowLevel.StateEvent) (`'DLTA'`)
-[`StateEvent`](../api/UnityEngine.InputSystem.LowLevel.StateEvent.html) contains a full snapshot of the entire state of a Device in the format specific to that Device. The [`stateFormat`](../api/UnityEngine.InputSystem.LowLevel.StateEvent.html#UnityEngine_InputSystem_LowLevel_StateEvent_stateFormat) field identifies the type of the data in the event. You can access the raw data using the [`state`](../api/UnityEngine.InputSystem.LowLevel.StateEvent.html#UnityEngine_InputSystem_LowLevel_StateEvent_state) pointer and [`stateSizeInBytes`](../api/UnityEngine.InputSystem.LowLevel.StateEvent.html#UnityEngine_InputSystem_LowLevel_StateEvent_stateSizeInBytes).
+[`StateEvent`](xref:UnityEngine.InputSystem.LowLevel.StateEvent) contains a full snapshot of the entire state of a Device in the format specific to that Device. The [`stateFormat`](xref:UnityEngine.InputSystem.LowLevel.StateEvent.stateFormat) field identifies the type of the data in the event. You can access the raw data using the [`state`](xref:UnityEngine.InputSystem.LowLevel.StateEvent.state) pointer and [`stateSizeInBytes`](xref:UnityEngine.InputSystem.LowLevel.StateEvent.stateSizeInBytes).
-A [`DeltaStateEvent`](../api/UnityEngine.InputSystem.LowLevel.DeltaStateEvent.html) is like a [`StateEvent`](../api/UnityEngine.InputSystem.LowLevel.StateEvent.html), but only contains a partial snapshot of the state of a Device. The Input System usually sends this for Devices that require a large state record, to reduce the amount of memory it needs to update if only some of the Controls change their state. To access the raw data, you can use the [`deltaState`](../api/UnityEngine.InputSystem.LowLevel.DeltaStateEvent.html#UnityEngine_InputSystem_LowLevel_DeltaStateEvent_deltaState) pointer and [`deltaStateSizeInBytes`](../api/UnityEngine.InputSystem.LowLevel.DeltaStateEvent.html#UnityEngine_InputSystem_LowLevel_DeltaStateEvent_deltaStateSizeInBytes). The Input System should apply the data to the Device's state at the offset defined by [`stateOffset`](../api/UnityEngine.InputSystem.LowLevel.DeltaStateEvent.html#UnityEngine_InputSystem_LowLevel_DeltaStateEvent_stateOffset).
+A [`DeltaStateEvent`](xref:UnityEngine.InputSystem.LowLevel.DeltaStateEvent) is like a [`StateEvent`](xref:UnityEngine.InputSystem.LowLevel.StateEvent), but only contains a partial snapshot of the state of a Device. The Input System usually sends this for Devices that require a large state record, to reduce the amount of memory it needs to update if only some of the Controls change their state. To access the raw data, you can use the [`deltaState`](xref:UnityEngine.InputSystem.LowLevel.DeltaStateEvent.deltaState) pointer and [`deltaStateSizeInBytes`](xref:UnityEngine.InputSystem.LowLevel.DeltaStateEvent.deltaStateSizeInBytes). The Input System should apply the data to the Device's state at the offset defined by [`stateOffset`](xref:UnityEngine.InputSystem.LowLevel.DeltaStateEvent.stateOffset).
### Device events
-Device events indicate a change that is relevant to a Device as a whole. If you're interested in these events, it is usually more convenient to subscribe to the higher-level [`InputSystem.onDeviceChange`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_onDeviceChange) event rather then processing [`InputEvents`](../api/UnityEngine.InputSystem.LowLevel.InputEvent.html) yourself.
+Device events indicate a change that is relevant to a Device as a whole. If you're interested in these events, it is usually more convenient to subscribe to the higher-level [`InputSystem.onDeviceChange`](xref:UnityEngine.InputSystem.InputSystem.onDeviceChange) event rather then processing [`InputEvents`](xref:UnityEngine.InputSystem.LowLevel.InputEvent) yourself.
There are three types of Device events:
-* [`DeviceRemoveEvent`](../api/UnityEngine.InputSystem.LowLevel.DeviceRemoveEvent.html) (`'DREM'`)
-* [`DeviceConfigurationEvent`](../api/UnityEngine.InputSystem.LowLevel.DeviceConfigurationEvent.html) (`'DCFG'`)
-* [`DeviceResetEvent`](../api/UnityEngine.InputSystem.LowLevel.DeviceResetEvent.html) (`'DRST'`)
+* [`DeviceRemoveEvent`](xref:UnityEngine.InputSystem.LowLevel.DeviceRemoveEvent) (`'DREM'`)
+* [`DeviceConfigurationEvent`](xref:UnityEngine.InputSystem.LowLevel.DeviceConfigurationEvent) (`'DCFG'`)
+* [`DeviceResetEvent`](xref:UnityEngine.InputSystem.LowLevel.DeviceResetEvent) (`'DRST'`)
-`DeviceRemovedEvent` indicates that a Device has been removed or disconnected. To query the device that has been removed, you can use the common [`deviceId`](../api/UnityEngine.InputSystem.LowLevel.InputEvent.html#UnityEngine_InputSystem_LowLevel_InputEvent_deviceId) field. This event doesn't have any additional data.
+`DeviceRemovedEvent` indicates that a Device has been removed or disconnected. To query the device that has been removed, you can use the common [`deviceId`](xref:UnityEngine.InputSystem.LowLevel.InputEvent.deviceId) field. This event doesn't have any additional data.
-`DeviceConfigurationEvent` indicates that the configuration of a Device has changed. The meaning of this is Device-specific. This might signal, for example, that the layout used by the keyboard has changed or that, on a console, a gamepad has changed which player ID(s) it is assigned to. You can query the changed device from the common [`deviceId`](../api/UnityEngine.InputSystem.LowLevel.InputEvent.html#UnityEngine_InputSystem_LowLevel_InputEvent_deviceId) field. This event doesn't have any additional data.
+`DeviceConfigurationEvent` indicates that the configuration of a Device has changed. The meaning of this is Device-specific. This might signal, for example, that the layout used by the keyboard has changed or that, on a console, a gamepad has changed which player ID(s) it is assigned to. You can query the changed device from the common [`deviceId`](xref:UnityEngine.InputSystem.LowLevel.InputEvent.deviceId) field. This event doesn't have any additional data.
-`DeviceResetEvent` indicates that a device should get reset. This will trigger [`InputSystem.ResetDevice`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_ResetDevice_UnityEngine_InputSystem_InputDevice_System_Boolean_) to be called on the Device.
+`DeviceResetEvent` indicates that a device should get reset. This will trigger [`InputSystem.ResetDevice`](xref:UnityEngine.InputSystem.InputSystem.ResetDevice(UnityEngine.InputSystem.InputDevice,System.Boolean)) to be called on the Device.
### Text events
-[Keyboard](Keyboard.md) devices send these events to handle text input. If you're interested in these events, it's usually more convenient to subscribe to the higher-level [callbacks on the Keyboard class](Keyboard.md#text-input) rather than processing [`InputEvents`](../api/UnityEngine.InputSystem.LowLevel.InputEvent.html) yourself.
+[Keyboard](xref:input-system-keyboard) devices send these events to handle text input. If you're interested in these events, it's usually more convenient to subscribe to the higher-level [callbacks on the Keyboard class](xref:input-system-keyboard#text-input) rather than processing [`InputEvents`](xref:UnityEngine.InputSystem.LowLevel.InputEvent) yourself.
There are two types of text events:
-* [`TextEvent`](../api/UnityEngine.InputSystem.LowLevel.TextEvent.html) (`'TEXT'`)
-* [`IMECompositionEvent`](../api/UnityEngine.InputSystem.LowLevel.IMECompositionEvent.html) (`'IMES'`)
+* [`TextEvent`](xref:UnityEngine.InputSystem.LowLevel.TextEvent) (`'TEXT'`)
+* [`IMECompositionEvent`](xref:UnityEngine.InputSystem.LowLevel.IMECompositionEvent) (`'IMES'`)
## Working with events
### Listening to events
-If you want to do any monitoring or processing on incoming events yourself, subscribe to the [`InputSystem.onEvent`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_onEvent) callback.
+If you want to do any monitoring or processing on incoming events yourself, subscribe to the [`InputSystem.onEvent`](xref:UnityEngine.InputSystem.InputSystem.onEvent) callback.
```CSharp
InputSystem.onEvent +=
@@ -99,7 +88,7 @@ InputSystem.onEvent
.CallOnce(ctrl => Debug.Log($"Button {ctrl} pressed"));
```
-To enumerate the controls that have value changes in an event, you can use [`InputControlExtensions.EnumerateChangedControls`](../api/UnityEngine.InputSystem.InputControlExtensions.html#UnityEngine_InputSystem_InputControlExtensions_EnumerateChangedControls_UnityEngine_InputSystem_LowLevel_InputEventPtr_UnityEngine_InputSystem_InputDevice_System_Single_).
+To enumerate the controls that have value changes in an event, you can use [`InputControlExtensions.EnumerateChangedControls`](xref:UnityEngine.InputSystem.InputControlExtensions.EnumerateChangedControls(UnityEngine.InputSystem.LowLevel.InputEventPtr,UnityEngine.InputSystem.InputDevice,System.Single)).
```CSharp
InputSystem.onEvent
@@ -110,7 +99,7 @@ InputSystem.onEvent
});
```
-This is significantly more efficient than manually iterating over [`InputDevice.allControls`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_allControls) and reading out the value of each control from the event.
+This is significantly more efficient than manually iterating over [`InputDevice.allControls`](xref:UnityEngine.InputSystem.InputDevice.allControls) and reading out the value of each control from the event.
### Reading state events
@@ -118,7 +107,7 @@ State events contain raw memory snapshots for Devices. As such, interpreting the
The easiest way to access state contained in a state event is to rely on the Device that the state is meant for. You can ask any Control to read its value from a given event rather than from its own internally stored state.
-For example, the following code demonstrates how to read a value for [`Gamepad.leftStick`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_leftStick) from a state event targeted at a [`Gamepad`](../api/UnityEngine.InputSystem.Gamepad.html).
+For example, the following code demonstrates how to read a value for [`Gamepad.leftStick`](xref:UnityEngine.InputSystem.Gamepad.leftStick) from a state event targeted at a [`Gamepad`](xref:UnityEngine.InputSystem.Gamepad).
```CSharp
InputSystem.onEvent +=
@@ -143,9 +132,10 @@ InputSystem.onEvent +=
Anyone can create and queue new input events against any existing Device. Queueing an input event is thread-safe, which means that event generation can happen in background threads.
->__Note__: Unity allocates limited memory to events that come from background threads. If background threads produce too many events, queueing an event from a thread blocks the thread until the main thread flushes out the background event queue.
+> [!NOTE]
+> Unity allocates limited memory to events that come from background threads. If background threads produce too many events, queueing an event from a thread blocks the thread until the main thread flushes out the background event queue.
-Note that queuing an event doesn't immediately consume the event. Event processing happens on the next update (depending on [`InputSettings.updateMode`](Settings.md#update-mode), it is triggered either manually via [`InputSystem.Update`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_Update), or automatically as part of the Player loop).
+Note that queuing an event doesn't immediately consume the event. Event processing happens on the next update (depending on [`InputSettings.updateMode`](xref:input-system-settings#update-mode), it is triggered either manually via [`InputSystem.Update`](xref:UnityEngine.InputSystem.InputSystem.Update), or automatically as part of the Player loop).
#### Sending state events
@@ -159,7 +149,7 @@ InputSystem.QueueStateEvent(Mouse.current, new MouseState { position = new Vecto
InputSystem.QueueStateEvent(Keyboard.current, new KeyboardState(Key.LeftCtrl, Key.A));
```
-`Touchscreen` is somewhat special in that it expects its input to be in [`TouchState`](../api/UnityEngine.InputSystem.LowLevel.TouchState.html) format.
+`Touchscreen` is somewhat special in that it expects its input to be in [`TouchState`](xref:UnityEngine.InputSystem.LowLevel.TouchState) format.
```CSharp
// Start touch.
@@ -175,9 +165,10 @@ InputSystem.QueueStateEvent(Touchscreen.current,
new TouchState { touchId = 1, phase = TouchPhase.Ended, position = new Vector2(123, 234) });
```
->__IMPORTANT:__ [Touch IDs](../api/UnityEngine.InputSystem.Controls.TouchControl.html#UnityEngine_InputSystem_Controls_TouchControl_touchId) cannot be 0! A valid touch must have a non-zero touch ID. Concurrent touches must each have a unique ID. After a touch has ended, its ID can be reused – although it is recommended to not do so.
+> [!IMPORTANT]
+> [Touch IDs](xref:UnityEngine.InputSystem.Controls.TouchControl.touchId) cannot be 0! A valid touch must have a non-zero touch ID. Concurrent touches must each have a unique ID. After a touch has ended, its ID can be reused – although it is recommended to not do so.
-If the exact format of the state used by a given Device is not known, the easiest way to send input to it is to simply create a [`StateEvent`](../api/UnityEngine.InputSystem.LowLevel.StateEvent.html) from the Device itself:
+If the exact format of the state used by a given Device is not known, the easiest way to send input to it is to simply create a [`StateEvent`](xref:UnityEngine.InputSystem.LowLevel.StateEvent) from the Device itself:
```CSharp
// `StateEvent.From` creates a temporary buffer in unmanaged memory that holds
@@ -203,9 +194,10 @@ Note that delta state events only work for Controls that are both byte-aligned a
### Capturing Events
->NOTE: To download a sample project which contains a reusable MonoBehaviour called `InputRecorder`, which can capture and replay input from arbitrary devices, open the Package Manager, select the Input System Package, and choose the sample project "Input Recorder" to download.
+> [!NOTE]
+> To download a sample project which contains a reusable MonoBehaviour called `InputRecorder`, which can capture and replay input from arbitrary devices, open the Package Manager, select the Input System Package, and choose the sample project "Input Recorder" to download.
-You can use the [`InputEventTrace`](../api/UnityEngine.InputSystem.LowLevel.InputEventTrace.html) class to record input events for later processing:
+You can use the [`InputEventTrace`](xref:UnityEngine.InputSystem.LowLevel.InputEventTrace) class to record input events for later processing:
```CSharp
var trace = new InputEventTrace(); // Can also give device ID to only
@@ -247,7 +239,7 @@ trace.WriteTo("mytrace.inputtrace.");
var loadedTrace = InputEventTrace.LoadFrom("mytrace.inputtrace");
```
-You can replay captured traces directly from [`InputEventTrace`](../api/UnityEngine.InputSystem.LowLevel.InputEventTrace.html) instances using the [`Replay`](../api/UnityEngine.InputSystem.LowLevel.InputEventTrace.html#UnityEngine_InputSystem_LowLevel_InputEventTrace_Replay_) method.
+You can replay captured traces directly from [`InputEventTrace`](xref:UnityEngine.InputSystem.LowLevel.InputEventTrace) instances using the [`Replay`](xref:UnityEngine.InputSystem.LowLevel.InputEventTrace.Replay*) method.
```CSharp
// The Replay method returns a ReplayController that can be used to
@@ -267,23 +259,24 @@ controller.PlayAllEventsAccordingToTimestamps();
## Processing events
-[Events](../api/UnityEngine.InputSystem.LowLevel.InputEvent.html) are collected on a queue by the Unity runtime. This queue is regularly flushed out and the events on it processed. Events can be added to the queue manually by calling [`InputSystem.QueueEvent`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_QueueEvent_UnityEngine_InputSystem_LowLevel_InputEventPtr_).
+[Events](xref:UnityEngine.InputSystem.LowLevel.InputEvent) are collected on a queue by the Unity runtime. This queue is regularly flushed out and the events on it processed. Events can be added to the queue manually by calling [`InputSystem.QueueEvent`](xref:UnityEngine.InputSystem.InputSystem.QueueEvent(UnityEngine.InputSystem.LowLevel.InputEventPtr)).
-Each time input is processed, [`InputSystem.Update`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_Update_) is called implicitly by the Unity runtime.
+Each time input is processed, [`InputSystem.Update`](xref:UnityEngine.InputSystem.InputSystem.Update*) is called implicitly by the Unity runtime.
-The interval at which this happens is determined by the ["Update Mode"](Settings.md#update-mode) configured in the settings. By default, input is processed in each frame __before__ MonoBehaviour.Update methods are called. If the setting is changed to process input in fixed updates, then this changes to input being processed each time before MonoBehaviour.FixedUpdate methods are called.
+The interval at which this happens is determined by the ["Update Mode"](xref:input-system-settings#update-mode) configured in the settings. By default, input is processed in each frame __before__ MonoBehaviour.Update methods are called. If the setting is changed to process input in fixed updates, then this changes to input being processed each time before MonoBehaviour.FixedUpdate methods are called.
Normally, when input is processed, __all__ outstanding input events on the queue will be consumed. There are two exceptions to this, however.
-When using [`UpdateMode.ProcessEventsInFixedUpdate`](../api/UnityEngine.InputSystem.InputSettings.UpdateMode.html#UnityEngine_InputSystem_InputSettings_UpdateMode_ProcessEventsInFixedUpdate), the Input System attempts to associate events with the timeslice of the corresponding FixedUpdate . This is based on the [timestamps](../api/UnityEngine.InputSystem.LowLevel.InputEvent.html#UnityEngine_InputSystem_LowLevel_InputEvent_time) of the events and a "best effort" at calculating the corresponding timeslice of the current FixedUpdated .
+When using [`UpdateMode.ProcessEventsInFixedUpdate`](xref:UnityEngine.InputSystem.InputSettings.UpdateMode.ProcessEventsInFixedUpdate), the Input System attempts to associate events with the timeslice of the corresponding FixedUpdate . This is based on the [timestamps](xref:UnityEngine.InputSystem.LowLevel.InputEvent.time) of the events and a "best effort" at calculating the corresponding timeslice of the current FixedUpdated .
-The other exception are [`BeforeRender`](../api/UnityEngine.InputSystem.LowLevel.InputUpdateType.html#UnityEngine_InputSystem_LowLevel_InputUpdateType_BeforeRender) updates. These updates are run after fixed or dynamic updates but before rendering and used used exclusively to update devices such as VR headsets that need the most up-to-date tracking data. Other input is not consumed from such updates and these updates are only enabled if such devices are actually present. `BeforeRender` updates are not considered separate frames as far as input is concerned.
+The other exception are [`BeforeRender`](xref:UnityEngine.InputSystem.LowLevel.InputUpdateType.BeforeRender) updates. These updates are run after fixed or dynamic updates but before rendering and used used exclusively to update devices such as VR headsets that need the most up-to-date tracking data. Other input is not consumed from such updates and these updates are only enabled if such devices are actually present. `BeforeRender` updates are not considered separate frames as far as input is concerned.
->__Note__: Manually calling [`InputSystem.Update`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_Update_) is strongly advised against except within tests employing [`InputTestFixture`](../api/UnityEngine.InputSystem.InputTestFixture.html) or when explicitly setting the system to [manual update mode](../api/UnityEngine.InputSystem.InputSettings.UpdateMode.html#UnityEngine_InputSystem_InputSettings_UpdateMode_ProcessEventsManually).
+> [!NOTE]
+> Manually calling [`InputSystem.Update`](xref:UnityEngine.InputSystem.InputSystem.Update*) is strongly advised against except within tests employing [`InputTestFixture`](xref:UnityEngine.InputSystem.InputTestFixture) or when explicitly setting the system to [manual update mode](xref:UnityEngine.InputSystem.InputSettings.UpdateMode.ProcessEventsManually).
-Methods such as [`InputAction.WasPerformedThisFrame`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasPerformedThisFrame) and [`InputAction.WasPerformedThisFrame`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasPerformedThisFrame) operate implicitly based on the [`InputSystem.Update`] cadence described above. Meaning, that they refer to the state as per the __last__ fixed/dynamic/manual update happened.
+Methods such as [`InputAction.WasPerformedThisFrame`](xref:UnityEngine.InputSystem.InputAction.WasPerformedThisFrame) and [`InputAction.WasPerformedThisFrame`](xref:UnityEngine.InputSystem.InputAction.WasPerformedThisFrame) operate implicitly based on the [`InputSystem.Update`] cadence described above. Meaning, that they refer to the state as per the __last__ fixed/dynamic/manual update happened.
-You can query the [current/last update type](../api/UnityEngine.InputSystem.LowLevel.InputState.html#UnityEngine_InputSystem_LowLevel_InputState_currentUpdateType) and [count](../api/UnityEngine.InputSystem.LowLevel.InputState.html#UnityEngine_InputSystem_LowLevel_InputState_updateCount) from [`InputState`](../api/UnityEngine.InputSystem.LowLevel.InputState.html).
+You can query the [current/last update type](xref:UnityEngine.InputSystem.LowLevel.InputState.currentUpdateType) and [count](xref:UnityEngine.InputSystem.LowLevel.InputState.updateCount) from [`InputState`](xref:UnityEngine.InputSystem.LowLevel.InputState).
### Merging of events
diff --git a/Packages/com.unity.inputsystem/Documentation~/Gamepad.md b/Packages/com.unity.inputsystem/Documentation~/Gamepad.md
index 9462e4cf6c..9e6e3cd709 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Gamepad.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Gamepad.md
@@ -3,26 +3,16 @@ uid: input-system-gamepad
---
# Gamepad Support
-- [Controls](#controls)
- - [Deadzones](#deadzones)
-- [Polling](#polling)
-- [Rumble](#rumble)
- - [Pausing, resuming, and stopping haptics](#pausing-resuming-and-stopping-haptics)
-- [PlayStation controllers](#playstation-controllers)
-- [Xbox controllers](#xbox-controllers)
-- [Switch controllers](#switch-controllers)
-- [Cursor Control](#cursor-control)
-- [Discover all connected devices](#discover-all-connected-devices)
-
-A [`Gamepad`](../api/UnityEngine.InputSystem.Gamepad.html) is narrowly defined as a Device with two thumbsticks, a D-pad, and four face buttons. Additionally, gamepads usually have two shoulder and two trigger buttons. Most gamepads also have two buttons in the middle.
+A [`Gamepad`](xref:UnityEngine.InputSystem.Gamepad) is narrowly defined as a Device with two thumbsticks, a D-pad, and four face buttons. Additionally, gamepads usually have two shoulder and two trigger buttons. Most gamepads also have two buttons in the middle.
A gamepad can have additional Controls, such as a gyro, which the Device can expose. However, all gamepads are guaranteed to have at least the minimum set of Controls described above.
Gamepad support guarantees the correct location and functioning of Controls across platforms and hardware. For example, a PS4 DualShock controller layout should look identical regardless of which platform it is supported on. A gamepad's south face button should always be the lowermost face button.
->NOTE: Generic [HID](./HID.md) gamepads will __not__ be surfaced as [`Gamepad`](../api/UnityEngine.InputSystem.Gamepad.html) devices but rather be created as generic [joysticks](./Joystick.md). This is because the Input System cannot guarantee correct mapping of buttons and axes on the controller (the information is simply not available at the HID level). Only HID gamepads that are explicitly supported by the Input System (like the PS4 controller) will come out as gamepads. Note that you can set up the same kind of support for specific HID gamepads yourself (see ["Overriding the HID Fallback"](./HID.md#creating-a-custom-device-layout)).
-
->NOTE: In case you want to use the gamepad for driving mouse input, there is a sample called `Gamepad Mouse Cursor` you can install from the package manager UI when selecting the Input System package. The sample demonstrates how to set up gamepad input to drive a virtual mouse cursor.
+> [!NOTE]
+> Generic [HID](xref:input-system-hid) gamepads will __not__ be surfaced as [`Gamepad`](xref:UnityEngine.InputSystem.Gamepad) devices but rather be created as generic [joysticks](xref:input-system-joystick). This is because the Input System cannot guarantee correct mapping of buttons and axes on the controller (the information is simply not available at the HID level). Only HID gamepads that are explicitly supported by the Input System (like the PS4 controller) will come out as gamepads. Note that you can set up the same kind of support for specific HID gamepads yourself (see ["Overriding the HID Fallback"](xref:input-system-hid#creating-a-custom-device-layout)).
+>
+> In case you want to use the gamepad for driving mouse input, there is a sample called `Gamepad Mouse Cursor` you can install from the package manager UI when selecting the Input System package. The sample demonstrates how to set up gamepad input to drive a virtual mouse cursor.
## Controls
@@ -30,25 +20,26 @@ Every gamepad has the following Controls:
|Control|Type|Description|
|-------|----|-----------|
-|[`leftStick`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_leftStick)|[`StickControl`](../api/UnityEngine.InputSystem.Controls.StickControl.html)|Thumbstick on the left side of the gamepad. Deadzoned. Provides a normalized 2D motion vector. X is [-1..1] from left to right, Y is [-1..1] from bottom to top. Has up/down/left/right buttons for use like a D-pad.|
-|[`rightStick`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_rightStick)|[`StickControl`](../api/UnityEngine.InputSystem.Controls.StickControl.html)|Thumbstick on the right side of the gamepad. Deadzoned. Provides a normalized 2D motion vector. X is [-1..1] from left to right, Y is [-1..1] from bottom to top. Has up/down/left/right buttons for use like a D-pad.|
-|[`dpad`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_dpad)|[`DpadControl`](../api/UnityEngine.InputSystem.Controls.DpadControl.html)|The D-pad on the gamepad.|
-|[`buttonNorth`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_buttonNorth)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|The upper button of the four action buttons, which are usually located on the right side of the gamepad. Labelled "Y" on Xbox controllers and "Triangle" on PlayStation controllers.|
-|[`buttonSouth`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_buttonSouth)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|The lower button of the four action buttons, which are usually located on the right side of the gamepad. Labelled "A" on Xbox controllers and "Cross" on PlayStation controllers.|
-|[`buttonWest`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_buttonWest)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|The left button of the four action buttons, which are usually located on the right side of the gamepad. Labelled "X" on Xbox controllers and "Square" on PlayStation controllers.|
-|[`buttonEast`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_buttonEast)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|The right button of the four action buttons, which are usually located on the right side of the gamepad. Labelled "B" on Xbox controllers and "Circle" on PlayStation controllers.|
-|[`leftShoulder`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_leftShoulder)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|The left shoulder button.|
-|[`rightShoulder`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_rightShoulder)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|The right shoulder button.|
-|[`leftTrigger`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_leftTrigger)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|The left trigger button.|
-|[`rightTrigger`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_rightTrigger)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|The right trigger button.|
-|[`startButton`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_startButton)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|The start button.|
-|[`selectButton`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_selectButton)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|The select button.|
-|[`leftStickButton`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_leftStickButton)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|The button pressed when the user presses down the left stick.|
-|[`rightStickButton`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_rightStickButton)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|The button pressed when the user presses down the right stick.|
-
->__Note__: Buttons are also full floating-point axes. For example, the left and right triggers can function as buttons as well as full floating-point axes.
-
-You can also access gamepad buttons using the indexer property on [`Gamepad`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_Item_UnityEngine_InputSystem_LowLevel_GamepadButton_) and the [`GamepadButton`](../api/UnityEngine.InputSystem.LowLevel.GamepadButton.html) enumeration:
+|[`leftStick`](xref:UnityEngine.InputSystem.Gamepad.leftStick)|[`StickControl`](xref:UnityEngine.InputSystem.Controls.StickControl)|Thumbstick on the left side of the gamepad. Deadzoned. Provides a normalized 2D motion vector. X is [-1..1] from left to right, Y is [-1..1] from bottom to top. Has up/down/left/right buttons for use like a D-pad.|
+|[`rightStick`](xref:UnityEngine.InputSystem.Gamepad.rightStick)|[`StickControl`](xref:UnityEngine.InputSystem.Controls.StickControl)|Thumbstick on the right side of the gamepad. Deadzoned. Provides a normalized 2D motion vector. X is [-1..1] from left to right, Y is [-1..1] from bottom to top. Has up/down/left/right buttons for use like a D-pad.|
+|[`dpad`](xref:UnityEngine.InputSystem.Gamepad.dpad)|[`DpadControl`](xref:UnityEngine.InputSystem.Controls.DpadControl)|The D-pad on the gamepad.|
+|[`buttonNorth`](xref:UnityEngine.InputSystem.Gamepad.buttonNorth)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|The upper button of the four action buttons, which are usually located on the right side of the gamepad. Labelled "Y" on Xbox controllers and "Triangle" on PlayStation controllers.|
+|[`buttonSouth`](xref:UnityEngine.InputSystem.Gamepad.buttonSouth)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|The lower button of the four action buttons, which are usually located on the right side of the gamepad. Labelled "A" on Xbox controllers and "Cross" on PlayStation controllers.|
+|[`buttonWest`](xref:UnityEngine.InputSystem.Gamepad.buttonWest)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|The left button of the four action buttons, which are usually located on the right side of the gamepad. Labelled "X" on Xbox controllers and "Square" on PlayStation controllers.|
+|[`buttonEast`](xref:UnityEngine.InputSystem.Gamepad.buttonEast)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|The right button of the four action buttons, which are usually located on the right side of the gamepad. Labelled "B" on Xbox controllers and "Circle" on PlayStation controllers.|
+|[`leftShoulder`](xref:UnityEngine.InputSystem.Gamepad.leftShoulder)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|The left shoulder button.|
+|[`rightShoulder`](xref:UnityEngine.InputSystem.Gamepad.rightShoulder)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|The right shoulder button.|
+|[`leftTrigger`](xref:UnityEngine.InputSystem.Gamepad.leftTrigger)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|The left trigger button.|
+|[`rightTrigger`](xref:UnityEngine.InputSystem.Gamepad.rightTrigger)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|The right trigger button.|
+|[`startButton`](xref:UnityEngine.InputSystem.Gamepad.startButton)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|The start button.|
+|[`selectButton`](xref:UnityEngine.InputSystem.Gamepad.selectButton)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|The select button.|
+|[`leftStickButton`](xref:UnityEngine.InputSystem.Gamepad.leftStickButton)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|The button pressed when the user presses down the left stick.|
+|[`rightStickButton`](xref:UnityEngine.InputSystem.Gamepad.rightStickButton)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|The button pressed when the user presses down the right stick.|
+
+> [!NOTE]
+> Buttons are also full floating-point axes. For example, the left and right triggers can function as buttons as well as full floating-point axes.
+
+You can also access gamepad buttons using the indexer property on [`Gamepad`](xref:UnityEngine.InputSystem.Gamepad.Item(UnityEngine.InputSystem.LowLevel.GamepadButton)) and the [`GamepadButton`](xref:UnityEngine.InputSystem.LowLevel.GamepadButton) enumeration:
```CSharp
Gamepad.current[GamepadButton.LeftShoulder];
@@ -98,7 +89,7 @@ You can do the same in your C# state structs.
}
```
-The gamepad layout already adds stick deadzone processors which take their min and max values from [`InputSettings.defaultDeadzoneMin`](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_defaultDeadzoneMin) and [`InputSettings.defaultDeadzoneMax`](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_defaultDeadzoneMax).
+The gamepad layout already adds stick deadzone processors which take their min and max values from [`InputSettings.defaultDeadzoneMin`](xref:UnityEngine.InputSystem.InputSettings.defaultDeadzoneMin) and [`InputSettings.defaultDeadzoneMax`](xref:UnityEngine.InputSystem.InputSettings.defaultDeadzoneMax).
@@ -106,7 +97,7 @@ The gamepad layout already adds stick deadzone processors which take their min a
On Windows (XInput controllers only), Universal Windows Platform (UWP), and Switch, Unity polls gamepads explicitly rather than deliver updates as events.
-You can control polling frequency manually. The default polling frequency is 60 Hz. Use [`InputSystem.pollingFrequency`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_pollingFrequency) to get or set the frequency.
+You can control polling frequency manually. The default polling frequency is 60 Hz. Use [`InputSystem.pollingFrequency`](xref:UnityEngine.InputSystem.InputSystem.pollingFrequency) to get or set the frequency.
```CSharp
// Poll gamepads at 120 Hz.
@@ -117,7 +108,7 @@ Increased frequency should lead to an increased number of events on the respecti
## Rumble
-The [`Gamepad`](../api/UnityEngine.InputSystem.Gamepad.html) class implements the [`IDualMotorRumble`](../api/UnityEngine.InputSystem.Haptics.IDualMotorRumble.html) interface that allows you to control the left and right motor speeds. In most common gamepads, the left motor emits a low-frequency rumble, and the right motor emits a high-frequency rumble.
+The [`Gamepad`](xref:UnityEngine.InputSystem.Gamepad) class implements the [`IDualMotorRumble`](xref:UnityEngine.InputSystem.Haptics.IDualMotorRumble) interface that allows you to control the left and right motor speeds. In most common gamepads, the left motor emits a low-frequency rumble, and the right motor emits a high-frequency rumble.
```CSharp
// Rumble the low-frequency (left) motor at 1/4 speed and the high-frequency
@@ -125,7 +116,8 @@ The [`Gamepad`](../api/UnityEngine.InputSystem.Gamepad.html) class implements th
Gamepad.current.SetMotorSpeeds(0.25f, 0.75f);
```
->__Note__: Only the following combinations of Devices/OSes currently support rumble:
+> [!NOTE]
+> Only the following combinations of Devices/OSes currently support rumble:
>* PS4, Xbox, and Switch controllers, when connected to their respective consoles. Only supported if you install console-specific input packages in your Project.
>* PS4 controllers, when connected to Mac or Windows/UWP computers.
>* Xbox controllers on Windows.
@@ -134,9 +126,9 @@ Gamepad.current.SetMotorSpeeds(0.25f, 0.75f);
### Pausing, resuming, and stopping haptics
-[`IDualMotorRumble`](../api/UnityEngine.InputSystem.Haptics.IDualMotorRumble.html) is based on [`IHaptics`](../api/UnityEngine.InputSystem.Haptics.IHaptics.html), which is the base interface for any haptics support on any Device. You can pause, resume, and reset haptic feedback using the [`PauseHaptics`](../api/UnityEngine.InputSystem.Haptics.IHaptics.html#UnityEngine_InputSystem_Haptics_IHaptics_PauseHaptics), [`ResumeHaptics`](../api/UnityEngine.InputSystem.Haptics.IHaptics.html#UnityEngine_InputSystem_Haptics_IHaptics_ResumeHaptics), and [`ResetHaptics`](../api/UnityEngine.InputSystem.Haptics.IHaptics.html#UnityEngine_InputSystem_Haptics_IHaptics_ResetHaptics) methods respectively.
+[`IDualMotorRumble`](xref:UnityEngine.InputSystem.Haptics.IDualMotorRumble) is based on [`IHaptics`](xref:UnityEngine.InputSystem.Haptics.IHaptics), which is the base interface for any haptics support on any Device. You can pause, resume, and reset haptic feedback using the [`PauseHaptics`](xref:UnityEngine.InputSystem.Haptics.IHaptics.PauseHaptics), [`ResumeHaptics`](xref:UnityEngine.InputSystem.Haptics.IHaptics.ResumeHaptics), and [`ResetHaptics`](xref:UnityEngine.InputSystem.Haptics.IHaptics.ResetHaptics) methods respectively.
-In certain situations, you might want to globally pause or stop haptics for all Devices. For example, if the player enters an in-game menu, you can pause haptics while the player is in the menu, and then resume haptics once the player resumes the game. You can use the corresponding methods on [`InputSystem`](../api/UnityEngine.InputSystem.InputSystem.html) to achieve this result. These methods work the same way as Device-specific methods, but affect all Devices:
+In certain situations, you might want to globally pause or stop haptics for all Devices. For example, if the player enters an in-game menu, you can pause haptics while the player is in the menu, and then resume haptics once the player resumes the game. You can use the corresponding methods on [`InputSystem`](xref:UnityEngine.InputSystem.InputSystem) to achieve this result. These methods work the same way as Device-specific methods, but affect all Devices:
```CSharp
// Pause haptics globally.
@@ -149,57 +141,59 @@ InputSystem.ResumeHaptics();
InputSystem.ResetHaptics();
```
-The difference between [`PauseHaptics`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_PauseHaptics) and [`ResetHaptics`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_ResetHaptics) is that the latter resets haptics playback state on each Device to its initial state, whereas [`PauseHaptics`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_PauseHaptics) preserves playback state in memory and only stops playback on the hardware.
+The difference between [`PauseHaptics`](xref:UnityEngine.InputSystem.InputSystem.PauseHaptics) and [`ResetHaptics`](xref:UnityEngine.InputSystem.InputSystem.ResetHaptics) is that the latter resets haptics playback state on each Device to its initial state, whereas [`PauseHaptics`](xref:UnityEngine.InputSystem.InputSystem.PauseHaptics) preserves playback state in memory and only stops playback on the hardware.
## PlayStation controllers
-PlayStation controllers are well supported on different Devices. The Input System implements these as different derived types of the [`DualShockGamepad`](../api/UnityEngine.InputSystem.DualShock.DualShockGamepad.html) base class, which derives from [`Gamepad`](../api/UnityEngine.InputSystem.Gamepad.html)):
+PlayStation controllers are well supported on different Devices. The Input System implements these as different derived types of the [`DualShockGamepad`](xref:UnityEngine.InputSystem.DualShock.DualShockGamepad) base class, which derives from [`Gamepad`](xref:UnityEngine.InputSystem.Gamepad)):
-* [`DualShock3GamepadHID`](../api/UnityEngine.InputSystem.DualShock.DualShock3GamepadHID.html): A DualShock 3 controller connected to a desktop computer using the HID interface. Currently only supported on macOS. Doesn't support [rumble](#rumble).
+* [`DualShock3GamepadHID`](xref:UnityEngine.InputSystem.DualShock.DualShock3GamepadHID): A DualShock 3 controller connected to a desktop computer using the HID interface. Currently only supported on macOS. Doesn't support [rumble](#rumble).
-* [`DualShock4GamepadHID`](../api/UnityEngine.InputSystem.DualShock.DualShock4GamepadHID.html): A DualShock 4 controller connected to a desktop computer using the HID interface. Supported on macOS, Windows, UWP, and Linux.
+* [`DualShock4GamepadHID`](xref:UnityEngine.InputSystem.DualShock.DualShock4GamepadHID): A DualShock 4 controller connected to a desktop computer using the HID interface. Supported on macOS, Windows, UWP, and Linux.
*
-* [`DualSenseGamepadHID`](../api/UnityEngine.InputSystem.DualShock.DualSenseGamepadHID.html): A DualSense controller connected to a desktop computer using the HID interface. Supported on macOS, Windows.
+* [`DualSenseGamepadHID`](xref:UnityEngine.InputSystem.DualShock.DualSenseGamepadHID): A DualSense controller connected to a desktop computer using the HID interface. Supported on macOS, Windows.
-* [`DualShock4GampadiOS`](../api/UnityEngine.InputSystem.iOS.DualShock4GampadiOS.html): A DualShock 4 controller connected to an iOS Device via Bluetooth. Requires iOS 13 or higher.
+* [`DualShock4GampadiOS`](xref:UnityEngine.InputSystem.iOS.DualShock4GampadiOS): A DualShock 4 controller connected to an iOS Device via Bluetooth. Requires iOS 13 or higher.
-* [`SetLightBarColor(Color)`](../api/UnityEngine.InputSystem.DualShock.DualShockGamepad.html#UnityEngine_InputSystem_DualShock_DualShockGamepad_SetLightBarColor_UnityEngine_Color_): Used to set the color of the light bar on the controller.
+* [`SetLightBarColor(Color)`](xref:UnityEngine.InputSystem.DualShock.DualShockGamepad.SetLightBarColor(UnityEngine.Color)): Used to set the color of the light bar on the controller.
-Note that, due to limitations in the USB driver and/or the hardware, only one IOCTL (input/output control) command can be serviced at a time. [`SetLightBarColor(Color)`](../api/UnityEngine.InputSystem.DualShock.DualShockGamepad.html#UnityEngine_InputSystem_DualShock_DualShockGamepad_SetLightBarColor_UnityEngine_Color_) and [`SetMotorSpeeds(Single, Single)`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_SetMotorSpeeds_System_Single_System_Single_) functionality on Dualshock 4 is implemented using IOCTL commands, and so if either method is called in quick succession, it is likely that only the first command will successfully complete. The other commands will be dropped. If there is a need to set both lightbar color and rumble motor speeds at the same time, use the [`SetMotorSpeedsAndLightBarColor(Single, Single, Color)`](../api/UnityEngine.InputSystem.DualShock.DualShock4GamepadHID.html#UnityEngine_InputSystem_DualShock_DualShock4GamepadHID_SetMotorSpeedsAndLightBarColor_System_Single_System_Single_UnityEngine_Color_) method.
+Note that, due to limitations in the USB driver and/or the hardware, only one IOCTL (input/output control) command can be serviced at a time. [`SetLightBarColor(Color)`](xref:UnityEngine.InputSystem.DualShock.DualShockGamepad.SetLightBarColor(UnityEngine.Color)) and [`SetMotorSpeeds(Single, Single)`](xref:UnityEngine.InputSystem.Gamepad.SetMotorSpeeds(System.Single,System.Single)) functionality on Dualshock 4 is implemented using IOCTL commands, and so if either method is called in quick succession, it is likely that only the first command will successfully complete. The other commands will be dropped. If there is a need to set both lightbar color and rumble motor speeds at the same time, use the [`SetMotorSpeedsAndLightBarColor(Single, Single, Color)`](xref:UnityEngine.InputSystem.DualShock.DualShock4GamepadHID.SetMotorSpeedsAndLightBarColor(System.Single,System.Single,UnityEngine.Color)) method.
->__Note__:
->* Unity supports PlayStation controllers on WebGL in some browser and OS configurations, but treats them as basic [`Gamepad`](../api/UnityEngine.InputSystem.Gamepad.html) or [`Joystick`](../api/UnityEngine.InputSystem.Joystick.html) Devices, and doesn't support rumble or any other DualShock-specific functionality.
+> [!NOTE]
+>* Unity supports PlayStation controllers on WebGL in some browser and OS configurations, but treats them as basic [`Gamepad`](xref:UnityEngine.InputSystem.Gamepad) or [`Joystick`](xref:UnityEngine.InputSystem.Joystick) Devices, and doesn't support rumble or any other DualShock-specific functionality.
>* Unity doesn't support connecting a PlayStation controller to a desktop machine using the DualShock 4 USB Wireless Adaptor. Use USB or Bluetooth to connect it.
## Xbox controllers
-Xbox controllers are well supported on different Devices. The Input System implements these using the [`XInputController`](../api/UnityEngine.InputSystem.XInput.XInputController.html) class, which derives from [`Gamepad`](../api/UnityEngine.InputSystem.Gamepad.html). On Windows and UWP, Unity uses the XInput API to connect to any type of supported XInput controller, including all Xbox One or Xbox 360-compatible controllers. These controllers are represented as an [`XInputController`](../api/UnityEngine.InputSystem.XInput.XInputController.html) instance. You can query the [`XInputController.subType`](../api/UnityEngine.InputSystem.XInput.XInputController.html#UnityEngine_InputSystem_XInput_XInputController_subType) property to get information about the type of controller (for example, a wheel or a gamepad).
+Xbox controllers are well supported on different Devices. The Input System implements these using the [`XInputController`](xref:UnityEngine.InputSystem.XInput.XInputController) class, which derives from [`Gamepad`](xref:UnityEngine.InputSystem.Gamepad). On Windows and UWP, Unity uses the XInput API to connect to any type of supported XInput controller, including all Xbox One or Xbox 360-compatible controllers. These controllers are represented as an [`XInputController`](xref:UnityEngine.InputSystem.XInput.XInputController) instance. You can query the [`XInputController.subType`](xref:UnityEngine.InputSystem.XInput.XInputController.subType) property to get information about the type of controller (for example, a wheel or a gamepad).
On other platforms Unity, uses derived classes to represent Xbox controllers:
-* [`XboxGamepadMacOS`](../api/UnityEngine.InputSystem.XInput.XboxGamepadMacOS.html): Any Xbox or compatible gamepad connected to a Mac via USB using the [Xbox Controller Driver for macOS](https://github.com/360Controller/360Controller). This class is only used when the `360Controller` driver is in use, and as such you shouldn't see it in use on modern versions of macOS - it is provided primarily for legacy reasons, and for scenarios where macOS 10.15 may still be used.
+* [`XboxGamepadMacOS`](xref:UnityEngine.InputSystem.XInput.XboxGamepadMacOS): Any Xbox or compatible gamepad connected to a Mac via USB using the [Xbox Controller Driver for macOS](https://github.com/360Controller/360Controller). This class is only used when the `360Controller` driver is in use, and as such you shouldn't see it in use on modern versions of macOS - it is provided primarily for legacy reasons, and for scenarios where macOS 10.15 may still be used.
-* [`XboxGamepadMacOSNative`](../api/UnityEngine.InputSystem.XInput.XboxGamepadMacOSNative.html): Any Xbox gamepad connected to a Mac (macOS 11.0 or higher) via USB. On modern macOS versions, you will get this class instead of `XboxGamepadMacOS`
+* [`XboxGamepadMacOSNative`](xref:UnityEngine.InputSystem.XInput.XboxGamepadMacOSNative): Any Xbox gamepad connected to a Mac (macOS 11.0 or higher) via USB. On modern macOS versions, you will get this class instead of `XboxGamepadMacOS`
-* [`XboxOneGampadMacOSWireless`](../api/UnityEngine.InputSystem.XInput.XboxOneGampadMacOSWireless.html): An Xbox One controller connected to a Mac via Bluetooth. Only the latest generation of Xbox One controllers supports Bluetooth. These controllers don't require any additional drivers in this scenario.
+* [`XboxOneGampadMacOSWireless`](xref:UnityEngine.InputSystem.XInput.XboxOneGampadMacOSWireless): An Xbox One controller connected to a Mac via Bluetooth. Only the latest generation of Xbox One controllers supports Bluetooth. These controllers don't require any additional drivers in this scenario.
-* [`XboxOneGampadiOS`](../api/UnityEngine.InputSystem.iOS.XboxOneGampadiOS.html): An Xbox One controller connected to an iOS Device via Bluetooth. Requires iOS 13 or higher.
+* [`XboxOneGampadiOS`](xref:UnityEngine.InputSystem.iOS.XboxOneGampadiOS): An Xbox One controller connected to an iOS Device via Bluetooth. Requires iOS 13 or higher.
->__Note__:
->* XInput controllers on Mac currently require the installation of the [Xbox Controller Driver for macOS](https://github.com/360Controller/360Controller). This driver only supports USB connections, and doesn't support wireless dongles. However, the latest generation of Xbox One controllers natively support Bluetooth. Macs natively support these controllers as HIDs without any additional drivers when connected via Bluetooth.
->* Unity supports Xbox controllers on WebGL in some browser and OS configurations, but treats them as basic [`Gamepad`](../api/UnityEngine.InputSystem.Gamepad.html) or [`Joystick`](../api/UnityEngine.InputSystem.Joystick.html) Devices, and doesn't support rumble or any other Xbox-specific functionality.
+> [!NOTE]
+> * XInput controllers on Mac currently require the installation of the [Xbox Controller Driver for macOS](https://github.com/360Controller/360Controller). This driver only supports USB connections, and doesn't support wireless dongles. However, the latest generation of Xbox One controllers natively support Bluetooth. Macs natively support these controllers as HIDs without any additional drivers when connected via Bluetooth.
+> * Unity supports Xbox controllers on WebGL in some browser and OS configurations, but treats them as basic [`Gamepad`](xref:UnityEngine.InputSystem.Gamepad) or [`Joystick`](xref:UnityEngine.InputSystem.Joystick) Devices, and doesn't support rumble or any other Xbox-specific functionality.
## Switch controllers
-The Input System support Switch Pro controllers on desktop computers via the [`SwitchProControllerHID`](../api/UnityEngine.InputSystem.Switch.SwitchProControllerHID.html) class, which implements basic gamepad functionality.
+The Input System support Switch Pro controllers on desktop computers via the [`SwitchProControllerHID`](xref:UnityEngine.InputSystem.Switch.SwitchProControllerHID) class, which implements basic gamepad functionality.
->__Note__: This support does not currently work for Switch Pro controllers connected via wired USB. Instead, the Switch Pro controller *must* be connected via Bluetooth. This is due to the controller using a prioprietary communication protocol on top of HID which does not allow treating the controller like any other HID.
+> [!NOTE]
+> This support does not currently work for Switch Pro controllers connected via wired USB. Instead, the Switch Pro controller *must* be connected via Bluetooth. This is due to the controller using a prioprietary communication protocol on top of HID which does not allow treating the controller like any other HID.
->__Note__: Switch Joy-Cons are not currently supported on desktop.
+> [!NOTE]
+> Switch Joy-Cons are not currently supported on desktop.
## Cursor Control
-To give gamepads and joysticks control over a hardware or software cursor, you can use the [`VirtualMouseInput`](../api/UnityEngine.InputSystem.UI.VirtualMouseInput.html) component. See [`VirtualMouseInput` component](UISupport.md#virtual-mouse-cursor-control) in the UI section of the manual.
+To give gamepads and joysticks control over a hardware or software cursor, you can use the [`VirtualMouseInput`](xref:UnityEngine.InputSystem.UI.VirtualMouseInput) component. See [`VirtualMouseInput` component](xref:input-system-ui-support#virtual-mouse-cursor-control) in the UI section of the manual.
## Discover all connected devices
diff --git a/Packages/com.unity.inputsystem/Documentation~/HID.md b/Packages/com.unity.inputsystem/Documentation~/HID.md
index b6908ff12c..83b5ef8bd6 100644
--- a/Packages/com.unity.inputsystem/Documentation~/HID.md
+++ b/Packages/com.unity.inputsystem/Documentation~/HID.md
@@ -18,9 +18,9 @@ The Input System handles HIDs in one of two ways:
## Auto-generated layouts
-By default, the Input System creates layouts and Device representations for any HID which reports its usage as `GenericDesktop/Joystick`, `GenericDesktop/Gamepad`, or `GenericDesktop/MultiAxisController` (see the [HID usage table specifications](https://www.usb.org/document-library/hid-usage-tables-112) for more information). To change the list of supported usages, set [`HIDSupport.supportedHIDUsages`](../api/UnityEngine.InputSystem.HID.HIDSupport.html#UnityEngine_InputSystem_HID_HIDSupport_supportedHIDUsages).
+By default, the Input System creates layouts and Device representations for any HID which reports its usage as `GenericDesktop/Joystick`, `GenericDesktop/Gamepad`, or `GenericDesktop/MultiAxisController` (see the [HID usage table specifications](https://www.usb.org/document-library/hid-usage-tables-112) for more information). To change the list of supported usages, set [`HIDSupport.supportedHIDUsages`](xref:UnityEngine.InputSystem.HID.HIDSupport.supportedHIDUsages).
-When the Input System automatically creates a layout for an HID, it always reports these Devices as [`Joysticks`](Joystick.md), represented by the [`Joystick` device class](../api/UnityEngine.InputSystem.Joystick.html). The first elements with a reported HID usage of `GenericDesktop/X` and `GenericDesktop/Y` together form the joystick's [`stick`](../api/UnityEngine.InputSystem.Joystick.html#UnityEngine_InputSystem_Joystick_stick) Control. The system then adds Controls for all further HID axis or button elements, using the Control names reported by the HID specification. The Input System assigns the first control with an HID usage of `Button/Button 1` to the joystick's [`trigger`](../api/UnityEngine.InputSystem.Joystick.html#UnityEngine_InputSystem_Joystick_trigger) Control.
+When the Input System automatically creates a layout for an HID, it always reports these Devices as [`Joysticks`](xref:input-system-joystick), represented by the [`Joystick` device class](xref:UnityEngine.InputSystem.Joystick). The first elements with a reported HID usage of `GenericDesktop/X` and `GenericDesktop/Y` together form the joystick's [`stick`](xref:UnityEngine.InputSystem.Joystick.stick) Control. The system then adds Controls for all further HID axis or button elements, using the Control names reported by the HID specification. The Input System assigns the first control with an HID usage of `Button/Button 1` to the joystick's [`trigger`](xref:UnityEngine.InputSystem.Joystick.trigger) Control.
The auto-generated layouts represent a "best effort" on the part of the Input System. The way Human Interface Devices describe themselves in accordance with the HID standard is too ambiguous in practice, so generated layouts might lead to Controls that don't work as expected. For example, while the layout builder can identify hat switches and D-pads, it can often only make guesses as to which direction represents which. The same goes for individual buttons, which generally aren't assigned any meaning in HID.
@@ -28,7 +28,7 @@ The best way to resolve the situation of HIDs not working as expected is to add
## HID output
-HIDs can support output (for example, to toggle lights or force feedback motors on a gamepad). Unity controls output by sending HID Output Report commands to a Device. Output reports use Device-specific data formats. To use HID Output Reports, call [`InputDevice.ExecuteCommand`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_ExecuteCommand__1___0__) to send a command struct with the [`typeStatic`](../api/UnityEngine.InputSystem.LowLevel.IInputDeviceCommandInfo.html#properties) property set as `"HIDO"` to a Device. The command struct contains the Device-specific data sent out to the HID.
+HIDs can support output (for example, to toggle lights or force feedback motors on a gamepad). Unity controls output by sending HID Output Report commands to a Device. Output reports use Device-specific data formats. To use HID Output Reports, call [`InputDevice.ExecuteCommand`](xref:UnityEngine.InputSystem.InputDevice.ExecuteCommand``1(``0@)) to send a command struct with the [`typeStatic`](xref:UnityEngine.InputSystem.LowLevel.IInputDeviceCommandInfo.typeStatic) property set as `"HIDO"` to a Device. The command struct contains the Device-specific data sent out to the HID.
## Creating a custom device layout
@@ -44,7 +44,7 @@ Below are three example workflows showing different ways to achieve this.
### Custom Device Workflow Example 1 - Use an existing C# InputDevice
-If you want to use one of the existing C# [`InputDevice`](../api/UnityEngine.InputSystem.InputDevice.html) classes in code to interface with your Device, you can build on an existing layout using JSON:
+If you want to use one of the existing C# [`InputDevice`](xref:UnityEngine.InputSystem.InputDevice) classes in code to interface with your Device, you can build on an existing layout using JSON:
```
{
@@ -84,7 +84,7 @@ You then register your layout with the system and then instantiate it:
### Custom Device Workflow Example 2 - Create your own InputDevice class
-Alternatively, you can create your own [`InputDevice`](../api/UnityEngine.InputSystem.InputDevice.html) class and state layouts in C#.
+Alternatively, you can create your own [`InputDevice`](xref:UnityEngine.InputSystem.InputDevice) class and state layouts in C#.
```C#
public struct MyDeviceState : IInputStateTypeInfo
@@ -129,13 +129,14 @@ This example workflow uses the same technique as the previous example, but provi
The following example assumes that the Input System doesn't already have a custom layout for the PS4 DualShock controller, and that you want to add such a layout.
-In this example, you want to expose the controller as a [`Gamepad`](Gamepad.md) and you roughly know the HID data format used by the Device.
+In this example, you want to expose the controller as a [`Gamepad`](xref:input-system-gamepad) and you roughly know the HID data format used by the Device.
->__Tip__: If you don't know the format of a given HID you want to support, you can open the Input Debugger with the Device plugged in and pop up both the debugger view for the Device and the window showing the HID descriptor. Then, you can go through the Controls one by one, see what happens in the debug view, and correlate that to the Controls in the HID descriptor. You can also double-click individual events and compare the raw data coming in from the Device. If you select two events in the event trace, you can then right-click them and choose __Compare__ to open a window that shows only the differences between the two events.
+> [!TIP]
+> If you don't know the format of a given HID you want to support, you can open the Input Debugger with the Device plugged in and pop up both the debugger view for the Device and the window showing the HID descriptor. Then, you can go through the Controls one by one, see what happens in the debug view, and correlate that to the Controls in the HID descriptor. You can also double-click individual events and compare the raw data coming in from the Device. If you select two events in the event trace, you can then right-click them and choose __Compare__ to open a window that shows only the differences between the two events.
#### Step 1: The state struct
-The first step is to describe in detail what format that input data for the Device comes in, as well as the [`InputControl`](../api/UnityEngine.InputSystem.InputControl.html) instances that should read out individual pieces of information from that data.
+The first step is to describe in detail what format that input data for the Device comes in, as well as the [`InputControl`](xref:UnityEngine.InputSystem.InputControl) instances that should read out individual pieces of information from that data.
The HID input reports from the PS4 controller look approximately like this:
@@ -276,7 +277,7 @@ public DualShock4GamepadHID : Gamepad
The last step is to register your new type of Device and set up the Input System so that when a PS4 controller is connected, the Input System generates your custom Device instead of using the default HID fallback.
-This only requires a call to [`InputSystem.RegisterLayout`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_RegisterLayout__1_System_String_System_Nullable_UnityEngine_InputSystem_Layouts_InputDeviceMatcher__), giving it an [`InputDeviceMatcher`](../api/UnityEngine.InputSystem.Layouts.InputDeviceMatcher.html) that matches the description for a PS4 DualShock HID. In theory, you can place this call anywhere, but the best point for registering layouts is generally during startup. Doing so ensures that your custom layout is visible to the Unity Editor and therefore exposed, for example, in the Input Control picker.
+This only requires a call to [`InputSystem.RegisterLayout`](xref:UnityEngine.InputSystem.InputSystem.RegisterLayout``1(System.String,System.Nullable{UnityEngine.InputSystem.Layouts.InputDeviceMatcher})), giving it an [`InputDeviceMatcher`](xref:UnityEngine.InputSystem.Layouts.InputDeviceMatcher) that matches the description for a PS4 DualShock HID. In theory, you can place this call anywhere, but the best point for registering layouts is generally during startup. Doing so ensures that your custom layout is visible to the Unity Editor and therefore exposed, for example, in the Input Control picker.
You can insert your registration into the startup sequence by modifying the code for your `DualShock4GamepadHID` Device as follows:
@@ -314,4 +315,4 @@ public DualShock4GamepadHID : Gamepad
Your custom layout now picks up any Device that matches the manufacturer and product name strings, or the vendor and product IDs in its HID descriptor. The Input System now represents a `DualShock4GamepadHID` Device instance.
-For more information, you can also read the [Device matching](Devices.md#matching) documentation.
+For more information, you can also read the [Device matching](xref:input-system-devices#matching) documentation.
diff --git a/Packages/com.unity.inputsystem/Documentation~/HowDoI.md b/Packages/com.unity.inputsystem/Documentation~/HowDoI.md
index d0490f0546..244cb7f6cf 100644
--- a/Packages/com.unity.inputsystem/Documentation~/HowDoI.md
+++ b/Packages/com.unity.inputsystem/Documentation~/HowDoI.md
@@ -5,52 +5,51 @@ uid: input-system-how-do-i
A collection of frequently asked questions, and where to find their answers in the documentation.
-> **Note:**
->
-> If you're new to the Input System and have landed on this page looking for documentation, it's best to read the [QuickStart Guide](QuickStartGuide.md), and the [Concepts](Concepts.md) and [Workflows](Workflows.md) pages, so that you can make sure you're choosing the best workflow for your project's input requirements.
+> [!NOTE]
+> If you're new to the Input System and have landed on this page looking for documentation, it's best to read the [QuickStart Guide](xref:input-system-quickstart), and the [Concepts](xref:basic-concepts) and [Workflows](xref:input-system-workflows) pages, so that you can make sure you're choosing the best workflow for your project's input requirements.
>
> This is because there are a number of different ways to read input using the Input System, and many of the answers on this page give you the quickest but least flexible solution, and may not be suitable for a project with more complex requirements.
How do I...?
-- [check if a specific key or button was pressed this frame?](../api/UnityEngine.InputSystem.Controls.ButtonControl.html#UnityEngine_InputSystem_Controls_ButtonControl_wasPressedThisFrame)
+- [check if a specific key or button was pressed this frame?](xref:UnityEngine.InputSystem.Controls.ButtonControl.wasPressedThisFrame)
-- [check if any key or button was pressed](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_onAnyButtonPress)
+- [check if any key or button was pressed](xref:UnityEngine.InputSystem.InputSystem.onAnyButtonPress)
-- [find all connected gamepads?](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_all)
+- [find all connected gamepads?](xref:UnityEngine.InputSystem.Gamepad.all)
-- [find the gamepad that the player is currently using?](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_current)
+- [find the gamepad that the player is currently using?](xref:UnityEngine.InputSystem.Gamepad.current)
-- [know when a new device was plugged in?](Devices.md#monitoring-devices)
+- [know when a new device was plugged in?](xref:input-system-devices#monitoring-devices)
-- [create my own custom devices?](HID.md#creating-a-custom-device-layout)
+- [create my own custom devices?](xref:input-system-hid#creating-a-custom-device-layout)
- create a simple "Fire" type action?
-Use the same techniques shown for the "Jump" action in the [Workflows section](Workflows.md)
+Use the same techniques shown for the "Jump" action in the [Workflows section](xref:input-system-workflows)
- [require a button to be held down for some duration before triggering an action?](Interactions.html#hold)
- [use a "positive" and a "negative" button to drive an axis?](ActionBindings.html#1d-axis)
-- [create a UI to rebind input in my game?](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.html)
+- [create a UI to rebind input in my game?](xref:UnityEngine.InputSystem.InputActionRebindingExtensions)
-- [set up an Action to specifically target the left-hand XR controller?](../api/UnityEngine.InputSystem.XR.XRController.html#UnityEngine_InputSystem_XR_XRController_leftHand)
+- [set up an Action to specifically target the left-hand XR controller?](xref:UnityEngine.InputSystem.XR.XRController.leftHand)
-- [make my left-hand XR controller my right-hand one?](../api/UnityEngine.InputSystem.XR.XRController.html#UnityEngine_InputSystem_XR_XRController_leftHand)
+- [make my left-hand XR controller my right-hand one?](xref:UnityEngine.InputSystem.XR.XRController.leftHand)
-- [get all current touches from the touchscreen?](Touch.md#reading-all-touches)
+- [get all current touches from the touchscreen?](xref:input-system-touch#reading-all-touches)
-- [deal with my gamepad data arriving in a format different from `GamepadState`?](../api/UnityEngine.InputSystem.LowLevel.GamepadState.html)
+- [deal with my gamepad data arriving in a format different from `GamepadState`?](xref:UnityEngine.InputSystem.LowLevel.GamepadState)
-- [force the Input System to use my own layout when the native backend discovers a specific Device?](Devices.md#native-devices)
+- [force the Input System to use my own layout when the native backend discovers a specific Device?](xref:input-system-devices#native-devices)
-- [add deadzoning to my gamepad sticks?](Gamepad.md#deadzones)
+- [add deadzoning to my gamepad sticks?](xref:input-system-gamepad#deadzones)
-- [give my head tracking an extra update before rendering?](../api/UnityEngine.InputSystem.XR.XRHMD.html)
+- [give my head tracking an extra update before rendering?](xref:UnityEngine.InputSystem.XR.XRHMD)
-- [record events flowing through the system?](Debugging.md#other-tips)
+- [record events flowing through the system?](xref:input-system-debugging#other-tips)
-- [see events as they're processed?](Debugging.md#other-tips)
+- [see events as they're processed?](xref:input-system-debugging#other-tips)
- [see what Devices I have and what state they're in?](Debugging.html#debugging-devices)
diff --git a/Packages/com.unity.inputsystem/Documentation~/HowToApplyProcessors.md b/Packages/com.unity.inputsystem/Documentation~/HowToApplyProcessors.md
index 7785014a4b..a7f4b19d9c 100644
--- a/Packages/com.unity.inputsystem/Documentation~/HowToApplyProcessors.md
+++ b/Packages/com.unity.inputsystem/Documentation~/HowToApplyProcessors.md
@@ -11,9 +11,9 @@ The following are the three different ways of applying Processors to input event
## Processors on Bindings
-When you create Bindings for your [actions](Actions.md), you can choose to add Processors to the Bindings. These process the values from the controls they bind to, before the system applies them to the Action value. For instance, you might want to invert the `Vector2` values from the controls along the Y-axis before passing these values to the Action that drives the input logic for your application. To do this, you can add an [Invert Vector2](ProcessorTypes.md#invert-vector-2) Processor to your Binding.
+When you create Bindings for your [actions](xref:input-system-actions), you can choose to add Processors to the Bindings. These process the values from the controls they bind to, before the system applies them to the Action value. For instance, you might want to invert the `Vector2` values from the controls along the Y-axis before passing these values to the Action that drives the input logic for your application. To do this, you can add an [Invert Vector2](ProcessorTypes.md#invert-vector-2) Processor to your Binding.
-If you're using Actions defined in the [Input Actions Editor](ActionsEditor.md), or in an [Action Asset](ActionAssets.md), you can add any Processor to your Bindings in the Input Action editor:
+If you're using Actions defined in the [Input Actions Editor](xref:input-system-configuring-input), or in an [Action Asset](xref:input-system-action-assets), you can add any Processor to your Bindings in the Input Action editor:
1. Select the Binding you want to add Processors to so that the Binding Properties panel shows up on the right side.
2. Select the **Add (+)** icon on the __Processors__ foldout to open a list of all available Processors that match your control type.
@@ -36,7 +36,7 @@ action.AddBinding("/leftStick")
Processors on Actions work in the same way as Processors on Bindings, but they affect all controls bound to an Action, rather than just the controls from a specific Binding. If there are Processors on both the Binding and the Action, the system processes the ones from the Binding first.
-You can add and edit Processors on Actions in the [Input Actions Editor](ActionsEditor.md), or in an [Action Asset](ActionAssets.md) the [same way](#processors-on-bindings) as you would for Bindings: select an Action to edit, then add one or more Processors in the right window pane.
+You can add and edit Processors on Actions in the [Input Actions Editor](xref:input-system-configuring-input), or in an [Action Asset](xref:input-system-action-assets) the [same way](#processors-on-bindings) as you would for Bindings: select an Action to edit, then add one or more Processors in the right window pane.
If you create your Actions in code, you can add Processors like this:
@@ -46,11 +46,11 @@ var action = new InputAction(processors: "invertVector2(invertX=false)");
## Processors on Controls
-You can have any number of Processors directly on an [`InputControl`](../api/UnityEngine.InputSystem.InputControl.html), which then process the values read from the Control. Whenever you call [`ReadValue`](../api/UnityEngine.InputSystem.InputControl-1.html#UnityEngine_InputSystem_InputControl_1_ReadValue) on a Control, all Processors on that Control process the value before it gets returned to you. You can use [`ReadUnprocessedValue`](../api/UnityEngine.InputSystem.InputControl-1.html#UnityEngine_InputSystem_InputControl_1_ReadUnprocessedValue) on a Control to bypass the Processors.
+You can have any number of Processors directly on an [`InputControl`](xref:UnityEngine.InputSystem.InputControl), which then process the values read from the Control. Whenever you call [`ReadValue`](xref:UnityEngine.InputSystem.InputControl`1.ReadValue) on a Control, all Processors on that Control process the value before it gets returned to you. You can use [`ReadUnprocessedValue`](xref:UnityEngine.InputSystem.InputControl`1.ReadUnprocessedValue) on a Control to bypass the Processors.
-The Input System adds Processors to a Control during device creation, if they're specified in the Control's [layout](Layouts.md). You can't add Processors to existing Controls after they've been created, so you can only add Processors to Controls when you're [creating custom devices](Devices.md#creating-custom-devices). The devices that the Input System supports out of the box already have some useful Processors added on their Controls. For instance, sticks on gamepads have a [Stick Deadzone](ProcessorTypes.md#stick-deadzone) Processor.
+The Input System adds Processors to a Control during device creation, if they're specified in the Control's [layout](xref:input-system-layouts). You can't add Processors to existing Controls after they've been created, so you can only add Processors to Controls when you're [creating custom devices](xref:input-system-devices#creating-custom-devices). The devices that the Input System supports out of the box already have some useful Processors added on their Controls. For instance, sticks on gamepads have a [Stick Deadzone](ProcessorTypes.md#stick-deadzone) Processor.
-If you're using a layout generated by the Input System from a [state struct](Devices.md#step-1-the-state-struct) using [`InputControlAttributes`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html), you can specify the Processors you want to use via the [`processors`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_processors) property of the attribute, like this:
+If you're using a layout generated by the Input System from a [state struct](xref:input-system-devices#step-1-the-state-struct) using [`InputControlAttributes`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute), you can specify the Processors you want to use via the [`processors`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.processors) property of the attribute, like this:
```CSharp
public struct MyDeviceState : IInputStateTypeInfo
@@ -65,7 +65,7 @@ public struct MyDeviceState : IInputStateTypeInfo
}
```
-If you [create a layout from JSON](Layouts.md#layout-from-json), you can specify Processors on your Controls like this:
+If you [create a layout from JSON](xref:input-system-layouts#layout-from-json), you can specify Processors on your Controls like this:
```CSharp
{
diff --git a/Packages/com.unity.inputsystem/Documentation~/Images/InputSettings.png b/Packages/com.unity.inputsystem/Documentation~/Images/InputSettings.png
deleted file mode 100644
index 6ba72a2713..0000000000
Binary files a/Packages/com.unity.inputsystem/Documentation~/Images/InputSettings.png and /dev/null differ
diff --git a/Packages/com.unity.inputsystem/Documentation~/Images/InputSystemPackage.png b/Packages/com.unity.inputsystem/Documentation~/Images/InputSystemPackage.png
deleted file mode 100644
index fe4dcc6958..0000000000
Binary files a/Packages/com.unity.inputsystem/Documentation~/Images/InputSystemPackage.png and /dev/null differ
diff --git a/Packages/com.unity.inputsystem/Documentation~/Images/InputSystemUIInputModule.png b/Packages/com.unity.inputsystem/Documentation~/Images/InputSystemUIInputModule.png
deleted file mode 100644
index af82e74541..0000000000
Binary files a/Packages/com.unity.inputsystem/Documentation~/Images/InputSystemUIInputModule.png and /dev/null differ
diff --git a/Packages/com.unity.inputsystem/Documentation~/Images/LayoutsInDebugger.png b/Packages/com.unity.inputsystem/Documentation~/Images/LayoutsInDebugger.png
deleted file mode 100644
index 13192a8cd1..0000000000
Binary files a/Packages/com.unity.inputsystem/Documentation~/Images/LayoutsInDebugger.png and /dev/null differ
diff --git a/Packages/com.unity.inputsystem/Documentation~/Images/SupportedDevices.png b/Packages/com.unity.inputsystem/Documentation~/Images/SupportedDevices.png
deleted file mode 100644
index 4251a7c22c..0000000000
Binary files a/Packages/com.unity.inputsystem/Documentation~/Images/SupportedDevices.png and /dev/null differ
diff --git a/Packages/com.unity.inputsystem/Documentation~/Images/UsersInputDebugger.png b/Packages/com.unity.inputsystem/Documentation~/Images/UsersInputDebugger.png
deleted file mode 100644
index 62ed3cf61e..0000000000
Binary files a/Packages/com.unity.inputsystem/Documentation~/Images/UsersInputDebugger.png and /dev/null differ
diff --git a/Packages/com.unity.inputsystem/Documentation~/Installation.md b/Packages/com.unity.inputsystem/Documentation~/Installation.md
index 58874908b5..188d6e035b 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Installation.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Installation.md
@@ -3,22 +3,30 @@ uid: input-system-installation
---
# Installation guide
-- [Installation guide](#installation-guide)
- - [Installing the package](#installing-the-package)
- - [Enabling the new input backends](#enabling-the-new-input-backends)
- - [Installing samples](#installing-samples)
+This page describes how to install and activate the Input System package for your Unity Project.
-This guide describes how to install and activate the Input System package for your Unity Project.
+> [!NOTE]
+> This version of the new Input System requires the .NET 4 runtime. It doesn't work in projects using the old .NET 3.5 runtime.
+>
+> This package is only compatible with Unity Editor release versions 2021.3 and later. If you are working in a release version of the Editor prior to 2021.3, you need to use the package version that works with that version of the Editor, indicated by the **Release** tag in the [Unity Package Manager](https://docs.unity3d.com/Manual/upm-ui.html) window.
->__Note__: The new Input System requires Unity 2019.4+ and the .NET 4 runtime. It doesn't work in projects using the old .NET 3.5 runtime.
+## Install the package
-## Installing the package
+To install the new Input System:
-To install the new Input System, open Unity's package manager (menu: __Window > Package Manager__). Select the __Input System__ package from the list, then click __Install__.
+1. In the main menu of the Unity Editor, go to __Window__ > __Package Manager__ to open the Unity Package Manager.
-
+2. Select **Unity Registry** from the navigation panel.
-## Enabling the new input backends
+3. Select the __Input System__ package from the list.
+
+ The Package Manager automatically selects that version to install by default.
+
+4. Select __Install__, follow any prompts to [enable the backends](#) for the new Input System.
+
+This package also provides several samples that demonstrate how to work with the new Input System, which are also available on the [Unity Package Manager](https://docs.unity3d.com/Manual/upm-ui.html) window. Refer to [Install samples](#install-samples).
+
+## Enable the new input backends
By default, Unity's classic Input Manager (`UnityEngine.Input`) is active, and support for the new Input System is inactive. This allows existing Unity Projects to keep working as they are.
@@ -28,13 +36,14 @@ When you install the Input System package, Unity will ask whether you want to en
You can find the corresponding setting in __Edit__ > __Project Settings__ > __Player__ > __Other Settings__ > __Active Input Handling__. If you change this setting you must restart the Editor for it to take effect.
->**Note:** You can enable __both__ the old __and__ the new system at the same time. To do so, set **Active Input Handling** to **Both**.
+> [!NOTE]
+> You can enable __both__ the old __and__ the new system at the same time. To do so, set **Active Input Handling** to **Both**.

When the new input backends are enabled, the `ENABLE_INPUT_SYSTEM=1` C# `#define` is added to builds. Similarly, when the old input backends are enabled, the `ENABLE_LEGACY_INPUT_MANAGER=1` C# `#define` is added. Because both can be enabled at the same time, it is possible for __both__ defines to be 1 at the same time.
-## Installing samples
+## Install samples
The Input System package comes with a number of samples. You can install these directly from the Package Manager window in Unity (__Window > Package Manager__). To see the list of samples, select the Input System package in the Package Manager window and click the __Samples__ tab. Then click __Import__ next to any sample name to import it into the current Project.
diff --git a/Packages/com.unity.inputsystem/Documentation~/Interactions.md b/Packages/com.unity.inputsystem/Documentation~/Interactions.md
index a7451585a2..9d2541929c 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Interactions.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Interactions.md
@@ -3,28 +3,11 @@ uid: input-system-interactions
---
# Interactions
-- [Interactions](#interactions)
- - [Operation](#operation)
- - [Multiple Controls on an Action](#multiple-controls-on-an-action)
- - [Multiple Interactions on a Binding](#multiple-interactions-on-a-binding)
- - [Timeouts](#timeouts)
- - [Using Interactions](#using-interactions)
- - [Interactions applied to Bindings](#interactions-applied-to-bindings)
- - [Interactions applied to Actions](#interactions-applied-to-actions)
- - [Predefined Interactions](#predefined-interactions)
- - [Default Interaction](#default-interaction)
- - [Press](#press)
- - [Hold](#hold)
- - [Tap](#tap)
- - [SlowTap](#slowtap)
- - [MultiTap](#multitap)
- - [Writing custom Interactions](#writing-custom-interactions)
-
An Interaction represents a specific input pattern. For example, a [hold](#hold) is an Interaction that requires a Control to be held for at least a minimum amount of time.
Interactions drive responses on Actions. You can place them on individual Bindings or an Action as a whole, in which case they apply to every Binding on the Action. At runtime, when a particular interaction completes, this triggers the Action.
-
+![The Binding Path displays the buttonSouth [Gamepad] value set on the Interaction Properties window.](Images/InteractionProperties.png){width="486" height="585"}
## Operation
@@ -72,44 +55,60 @@ fireAction.Enable();
### Multiple Controls on an Action
-If you have multiple Controls bound to a Binding or an Action which has an Interaction, then the Input System first applies the [Control conflict resolution](ActionBindings.md#conflicting-inputs) logic to get a single value for the Action, which it then feeds to the Interaction logic. Any of the bound Controls can perform the Interaction.
+If you have multiple Controls bound to a Binding or an Action which has an Interaction, then the Input System first applies the [Control conflict resolution](xref:input-system-action-bindings#conflicting-inputs) logic to get a single value for the Action, which it then feeds to the Interaction logic. Any of the bound Controls can perform the Interaction.
### Multiple Interactions on a Binding
-If multiple Interactions are present on a single Binding or Action, then the Input System checks the Interactions in the order they are present on the Binding. The code example [above](#operation) illustrates this example. The Binding on the `fireAction` Action has two Interactions: `WithInteractions("tap;slowTap")`. The [tap](#tap) Interaction gets a first chance at interpreting the input from the Action. If the button is pressed, the Action calls the `Started` callback on the tap Interaction. If the user keeps holding the button, the tap Interaction times out, and the Action calls the [`Canceled`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_canceled) callback for the tap Interaction and starts processing the [slow tap](#slowtap) Interaction (which now receives a `Started` callback).
+If multiple Interactions are present on a single Binding or Action, then the Input System checks the Interactions in the order they are present on the Binding. The code example [above](#operation) illustrates this example. The Binding on the `fireAction` Action has two Interactions: `WithInteractions("tap;slowTap")`. The [tap](#tap) Interaction gets a first chance at interpreting the input from the Action. If the button is pressed, the Action calls the `Started` callback on the tap Interaction. If the user keeps holding the button, the tap Interaction times out, and the Action calls the [`Canceled`](xref:UnityEngine.InputSystem.InputAction.canceled) callback for the tap Interaction and starts processing the [slow tap](#slowtap) Interaction (which now receives a `Started` callback).
-At any one time, only one Interaction can be "driving" the action (that is, it gets to determine the action's current [`phase`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_phase)). If an Interaction higher up in the stack cancels, Interactions lower down in the stack can take over.
+At any one time, only one Interaction can be "driving" the action (that is, it gets to determine the action's current [`phase`](xref:UnityEngine.InputSystem.InputAction.phase)). If an Interaction higher up in the stack cancels, Interactions lower down in the stack can take over.
Note that the order of interactions can affect which interaction is passed to your callback function. For example, an action with [Tap](#tap), [MultiTap](#multitap) and [Hold](#hold) interactions will have different behaviour when the interactions are in a different order, such as [Hold](#hold), [MultiTap](#multitap) and [Tap](#tap). If you get unexpected behaviour, you may need to experiment with a different ordering.
### Timeouts
-Interactions might need to wait a certain time for a specific input to occur or to not occur. An example of this is the [Hold](#hold) interaction which, after a button is pressed, has to wait for a set [duration](../api/UnityEngine.InputSystem.Interactions.HoldInteraction.html#UnityEngine_InputSystem_Interactions_HoldInteraction_duration) until the "hold" is complete. To do this, an interaction installs a timeout using [`SetTimeout`](../api/UnityEngine.InputSystem.InputInteractionContext.html#UnityEngine_InputSystem_InputInteractionContext_SetTimeout_System_Single_).
+Interactions might need to wait a certain time for a specific input to occur or to not occur. An example of this is the [Hold](#hold) interaction which, after a button is pressed, has to wait for a set [duration](xref:UnityEngine.InputSystem.Interactions.HoldInteraction.duration) until the "hold" is complete. To do this, an interaction installs a timeout using [`SetTimeout`](xref:UnityEngine.InputSystem.InputInteractionContext.SetTimeout(System.Single)).
-It can be useful to know how much of a timeout is left for an interaction to complete. For example, you might want to display a bar in the UI that is charging up while the interaction is waiting to complete. To query the percentage to which a timeout has completed, use [`GetTimeoutCompletionPercentage`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_GetTimeoutCompletionPercentage_).
+It can be useful to know how much of a timeout is left for an interaction to complete. For example, you might want to display a bar in the UI that is charging up while the interaction is waiting to complete. To query the percentage to which a timeout has completed, use [`GetTimeoutCompletionPercentage`](xref:UnityEngine.InputSystem.InputAction.GetTimeoutCompletionPercentage*).
```CSharp
// Returns a value between 0 (inclusive) and 1 (inclusive).
var warpActionCompletion = playerInput.actions["warp"].GetTimeoutCompletionPercentage();
```
-Note that each Interaction can have its own separate timeout (but only a single one at any one time). If [multiple interactions](#multiple-interactions-on-a-binding) are in effect, then [`GetTimeoutCompletionPercentage`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_GetTimeoutCompletionPercentage_) will only use the timeout of the one interaction that is currently driving the action.
+Note that each Interaction can have its own separate timeout (but only a single one at any one time). If [multiple interactions](#multiple-interactions-on-a-binding) are in effect, then [`GetTimeoutCompletionPercentage`](xref:UnityEngine.InputSystem.InputAction.GetTimeoutCompletionPercentage*) will only use the timeout of the one interaction that is currently driving the action.
-Some Interactions might involve multiple timeouts in succession. In this case, knowing only the completion of the currently running timeout (if any) is often not useful. An example is [`MultiTapInteraction`](../api/UnityEngine.InputSystem.Interactions.MultiTapInteraction.html), which involves a timeout on each individual tap, as well as a timeout in-between taps. The Interaction is complete only after a full tap sequence has been performed.
+Some Interactions might involve multiple timeouts in succession. In this case, knowing only the completion of the currently running timeout (if any) is often not useful. An example is [`MultiTapInteraction`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction), which involves a timeout on each individual tap, as well as a timeout in-between taps. The Interaction is complete only after a full tap sequence has been performed.
-An Interaction can use [`SetTotalTimeoutCompletionTime`](../api/UnityEngine.InputSystem.InputInteractionContext.html#UnityEngine_InputSystem_InputInteractionContext_SetTotalTimeoutCompletionTime_System_Single_) to inform the Input System of the total time it will run timeouts for.
+An Interaction can use [`SetTotalTimeoutCompletionTime`](xref:UnityEngine.InputSystem.InputInteractionContext.SetTotalTimeoutCompletionTime(System.Single)) to inform the Input System of the total time it will run timeouts for.
## Using Interactions
-You can install Interactions on [Bindings](ActionBindings.md) or [Actions](Actions.md).
+You can install Interactions on [Bindings](xref:input-system-action-bindings) or [Actions](xref:input-system-actions).
### Interactions applied to Bindings
-When you create Bindings for your [Actions](Actions.md), you can choose to add Interactions to the Bindings.
+When you create Bindings for your [Actions](xref:input-system-actions), you can choose to add Interactions to the Bindings.
+
+If you're using [project-wide actions](xref:input-system-configuring-input), or [Input Action Assets](xref:input-system-action-assets), you can add any Interaction to your Bindings in the Input Action editor.
+
+To add an Interaction:
+
+1. [Create some Bindings](xref:input-system-configuring-input#bindings).
+
+2. Select the Binding you want to add Interactions to.
+
+ The right pane of the window shows the properties for that Binding.
-If you're using [project-wide actions](ActionsEditor.md), or [Input Action Assets](ActionAssets.md), you can add any Interaction to your Bindings in the Input Action editor. Once you [created some Bindings](ActionsEditor.md#bindings), select the Binding you want to add Interactions to, so that the right pane of the window shows the properties for that Binding. Next, click on the plus icon on the __Interactions__ foldout to open a list of all available Interactions types. Choose an Interaction type to add an Interaction instance of that type. The Interaction now appears in the __Interactions__ foldout. If the Interaction has any parameters, you can edit them, as well.
+3. Click on the plus icon on the __Interactions__ foldout to open a list of all available Interactions types.
-To remove an Interaction, click the minus button next to it. To change the [order of Interactions](#multiple-interactions-on-a-binding), click the up and down arrows.
+4. Choose an Interaction type to add an Interaction instance of that type.
+
+ The Interaction now appears in the __Interactions__ foldout. If the Interaction has any parameters, you can edit them, as well.
+
+To remove an Interaction, click the minus button next to it.
+
+To change the [order of Interactions](#multiple-interactions-on-a-binding), click the up and down arrows.
If you create your Bindings in code, you can add Interactions like this:
@@ -123,9 +122,9 @@ action.AddBinding("/leftStick")
Applying Interactions directly to an Action is equivalent to applying them to all Bindings for the Action. It is thus more or less a shortcut that avoids manually adding the same Interaction(s) to each of the Bindings.
-If Interactions are applied __both__ to an Action and to its Bindings, then the effect is the same as if the Action's Interactions are *appended* to the list of Interactions on each of the Bindings. This means that the Binding's Interactions are applied *first*, and then the Action's Interactions are applied *after*.
+If Interactions are applied __both__ to an Action and to its Bindings, then the effect is the same as if the Action's Interactions are appended to the list of Interactions on each of the Bindings. This means that the Binding's Interactions are applied first, and then the Action's Interactions are applied after.
-You can add and edit Interactions on Actions in the [Input Action Assets](ActionAssets.md) editor window the [same way](#interactions-applied-to-bindings) as you would do for Bindings: select an Action to Edit, then add the Interactions in the right window pane.
+You can add and edit Interactions on Actions in the [Input Action Assets](xref:input-system-action-assets) editor window the [same way](#interactions-applied-to-bindings) as you would do for Bindings: select an Action to Edit, then add the Interactions in the right window pane.
If you create your Actions in code, you can add Interactions like this:
@@ -137,7 +136,8 @@ var Action = new InputAction(Interactions: "tap(duration=0.8)");
The Input System package comes with a set of basic Interactions you can use. If an Action has no Interactions set, the system uses its [default Interaction](#default-interaction).
->__Note__: The built-in Interactions operate on Control actuation and don't use Control values directly. The Input System evaluates the `pressPoint` parameters against the magnitude of the Control actuation. This means you can use these Interactions on any Control which has a magnitude, such as sticks, and not just on buttons.
+> [!NOTE]
+> The built-in Interactions operate on Control actuation and don't use Control values directly. The Input System evaluates the `pressPoint` parameters against the magnitude of the Control actuation. This means you can use these Interactions on any Control which has a magnitude, such as sticks, and not just on buttons.
The following diagram shows the behavior of the built-in Interactions for a simple button press.
@@ -147,54 +147,54 @@ The following diagram shows the behavior of the built-in Interactions for a simp
If you haven't specifically added an Interaction to a Binding or its Action, the default Interaction applies to the Binding.
-[`Value`](RespondingToActions.md#value) type Actions have the following behavior:
+[`Value`](xref:input-system-responding#value) type Actions have the following behavior:
-1. As soon as a bound Control becomes [actuated](Controls.md#control-actuation), the Action goes from `Waiting` to `Started`, and then immediately to `Performed` and back to `Started`. One callback occurs on [`InputAction.started`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_started), followed by one callback on [`InputAction.performed`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_performed).
-2. For as long as the bound Control remains actuated, the Action stays in `Started` and triggers `Performed` whenever the value of the Control changes (that is, one call occurs to [`InputAction.performed`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_performed)).
-3. When the bound Control stops being actuated, the Action goes to `Canceled` and then back to `Waiting`. One call occurs to [`InputAction.canceled`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_canceled).
+1. As soon as a bound Control becomes [actuated](xref:input-system-controls#control-actuation), the Action goes from `Waiting` to `Started`, and then immediately to `Performed` and back to `Started`. One callback occurs on [`InputAction.started`](xref:UnityEngine.InputSystem.InputAction.started), followed by one callback on [`InputAction.performed`](xref:UnityEngine.InputSystem.InputAction.performed).
+2. For as long as the bound Control remains actuated, the Action stays in `Started` and triggers `Performed` whenever the value of the Control changes (that is, one call occurs to [`InputAction.performed`](xref:UnityEngine.InputSystem.InputAction.performed)).
+3. When the bound Control stops being actuated, the Action goes to `Canceled` and then back to `Waiting`. One call occurs to [`InputAction.canceled`](xref:UnityEngine.InputSystem.InputAction.canceled).
-[`Button`](RespondingToActions.md#button) type Actions have the following behavior:
+[`Button`](xref:input-system-responding#button) type Actions have the following behavior:
-1. As soon as a bound Control becomes [actuated](Controls.md#control-actuation), the Action goes from `Waiting` to `Started`. One callback occurs on [`InputAction.started`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_started).
-2. If a Control then reaches or exceeds the button press threshold, the Action goes from `Started` to `Performed`. One callback occurs on [`InputAction.performed`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_performed). The default value of the button press threshold is defined in the [input settings](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_defaultButtonPressPoint). However, an individual control can [override](../api/UnityEngine.InputSystem.Controls.ButtonControl.html#UnityEngine_InputSystem_Controls_ButtonControl_pressPoint) this value.
-3. Once the Action has `Performed`, if all Controls then go back to a level of actuation at or below the [release threshold](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_buttonReleaseThreshold), the Action goes from `Performed` to `Canceled`. One call occurs to [`InputAction.canceled`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_canceled).
-4. If the Action never went to `Performed`, it will go to `Canceled` as soon as all Controls are released. One call occurs to [`InputAction.canceled`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_canceled).
+1. As soon as a bound Control becomes [actuated](xref:input-system-controls#control-actuation), the Action goes from `Waiting` to `Started`. One callback occurs on [`InputAction.started`](xref:UnityEngine.InputSystem.InputAction.started).
+2. If a Control then reaches or exceeds the button press threshold, the Action goes from `Started` to `Performed`. One callback occurs on [`InputAction.performed`](xref:UnityEngine.InputSystem.InputAction.performed). The default value of the button press threshold is defined in the [input settings](xref:UnityEngine.InputSystem.InputSettings.defaultButtonPressPoint). However, an individual control can [override](xref:UnityEngine.InputSystem.Controls.ButtonControl.pressPoint) this value.
+3. Once the Action has `Performed`, if all Controls then go back to a level of actuation at or below the [release threshold](xref:UnityEngine.InputSystem.InputSettings.buttonReleaseThreshold), the Action goes from `Performed` to `Canceled`. One call occurs to [`InputAction.canceled`](xref:UnityEngine.InputSystem.InputAction.canceled).
+4. If the Action never went to `Performed`, it will go to `Canceled` as soon as all Controls are released. One call occurs to [`InputAction.canceled`](xref:UnityEngine.InputSystem.InputAction.canceled).
-[`PassThrough`](RespondingToActions.md#pass-through) type Actions have a simpler behavior. The Input System doesn't try to track bound Controls as a single source of input. Instead, it triggers a `Performed` callback for each value change.
+[`PassThrough`](xref:input-system-responding#pass-through) type Actions have a simpler behavior. The Input System doesn't try to track bound Controls as a single source of input. Instead, it triggers a `Performed` callback for each value change.
-|__Callback__|[`InputActionType.Value`](RespondingToActions.md#value)|[`InputActionType.Button`](RespondingToActions.md#button)|[`InputActionType.PassThrough`](RespondingToActions.md#pass-through)|
+|__Callback__|[`InputActionType.Value`](xref:input-system-responding#value)|[`InputActionType.Button`](xref:input-system-responding#button)|[`InputActionType.PassThrough`](xref:input-system-responding#pass-through)|
|-----------|-------------|------------|-----------------|
-|[`started`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_started)|Control(s) changed value away from the default value.|Button started being pressed but has not necessarily crossed the press threshold yet.|not used|
-|[`performed`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_performed)|Control(s) changed value.|Button was pressed to at least the button [press threshold](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_defaultButtonPressPoint).|Control changed value.|
-|[`canceled`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_canceled)|Control(s) are no longer actuated.|Button was released. If the button was pressed above the press threshold, the button has now fallen to or below the [release threshold](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_buttonReleaseThreshold). If the button was never fully pressed, the button is now back to completely unpressed.|Action is disabled.|
+|[`started`](xref:UnityEngine.InputSystem.InputAction.started)|Control(s) changed value away from the default value.|Button started being pressed but has not necessarily crossed the press threshold yet.|not used|
+|[`performed`](xref:UnityEngine.InputSystem.InputAction.performed)|Control(s) changed value.|Button was pressed to at least the button [press threshold](xref:UnityEngine.InputSystem.InputSettings.defaultButtonPressPoint).|Control changed value.|
+|[`canceled`](xref:UnityEngine.InputSystem.InputAction.canceled)|Control(s) are no longer actuated.|Button was released. If the button was pressed above the press threshold, the button has now fallen to or below the [release threshold](xref:UnityEngine.InputSystem.InputSettings.buttonReleaseThreshold). If the button was never fully pressed, the button is now back to completely unpressed.|Action is disabled.|
### Press
-You can use a [`PressInteraction`](../api/UnityEngine.InputSystem.Interactions.PressInteraction.html) to explicitly force button-like interactions. Use the [`behavior`](../api/UnityEngine.InputSystem.Interactions.PressInteraction.html#UnityEngine_InputSystem_Interactions_PressInteraction_behavior) parameter to select if the Interaction should trigger on button press, release, or both.
+You can use a [`PressInteraction`](xref:UnityEngine.InputSystem.Interactions.PressInteraction) to explicitly force button-like interactions. Use the [`behavior`](xref:UnityEngine.InputSystem.Interactions.PressInteraction.behavior) parameter to select if the Interaction should trigger on button press, release, or both.
|__Parameters__|Type|Default value|
|---|---|---|
-|[`pressPoint`](../api/UnityEngine.InputSystem.Interactions.PressInteraction.html#UnityEngine_InputSystem_Interactions_PressInteraction_pressPoint)|`float`|[`InputSettings.defaultButtonPressPoint`](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_defaultButtonPressPoint)|
-|[`behavior`](../api/UnityEngine.InputSystem.Interactions.PressInteraction.html#UnityEngine_InputSystem_Interactions_PressInteraction_behavior)|[`PressBehavior`](../api/UnityEngine.InputSystem.Interactions.PressBehavior.html)|`PressOnly`|
+|[`pressPoint`](xref:UnityEngine.InputSystem.Interactions.PressInteraction.pressPoint)|`float`|[`InputSettings.defaultButtonPressPoint`](xref:UnityEngine.InputSystem.InputSettings.defaultButtonPressPoint)|
+|[`behavior`](xref:UnityEngine.InputSystem.Interactions.PressInteraction.behavior)|[`PressBehavior`](xref:UnityEngine.InputSystem.Interactions.PressBehavior)|`PressOnly`|
-|__Callbacks__/[`behavior`](../api/UnityEngine.InputSystem.Interactions.PressInteraction.html#UnityEngine_InputSystem_Interactions_PressInteraction_behavior)|`PressOnly`|`ReleaseOnly`|`PressAndRelease`|
+|__Callbacks__/[`behavior`](xref:UnityEngine.InputSystem.Interactions.PressInteraction.behavior)|`PressOnly`|`ReleaseOnly`|`PressAndRelease`|
|---|-----------|-------------|-----------------|
-|[`started`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_started)|Control magnitude crosses [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.PressInteraction.html#UnityEngine_InputSystem_Interactions_PressInteraction_pressPoint)|Control magnitude crosses [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.PressInteraction.html#UnityEngine_InputSystem_Interactions_PressInteraction_pressPoint)|Control magnitude crosses [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.PressInteraction.html#UnityEngine_InputSystem_Interactions_PressInteraction_pressPoint)|
-|[`performed`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_performed)|Control magnitude crosses [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.PressInteraction.html#UnityEngine_InputSystem_Interactions_PressInteraction_pressPoint)|Control magnitude goes back below [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.PressInteraction.html#UnityEngine_InputSystem_Interactions_PressInteraction_pressPoint)|- Control magnitude crosses [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.PressInteraction.html#UnityEngine_InputSystem_Interactions_PressInteraction_pressPoint) or - Control magnitude goes back below [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.PressInteraction.html#UnityEngine_InputSystem_Interactions_PressInteraction_pressPoint)|
-|[`canceled`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_canceled)|not used|not used|not used|
+|[`started`](xref:UnityEngine.InputSystem.InputAction.started)|Control magnitude crosses [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.PressInteraction.pressPoint)|Control magnitude crosses [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.PressInteraction.pressPoint)|Control magnitude crosses [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.PressInteraction.pressPoint)|
+|[`performed`](xref:UnityEngine.InputSystem.InputAction.performed)|Control magnitude crosses [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.PressInteraction.pressPoint)|Control magnitude goes back below [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.PressInteraction.pressPoint)|- Control magnitude crosses [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.PressInteraction.pressPoint) or - Control magnitude goes back below [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.PressInteraction.pressPoint)|
+|[`canceled`](xref:UnityEngine.InputSystem.InputAction.canceled)|not used|not used|not used|
### Hold
-A [`HoldInteraction`](../api/UnityEngine.InputSystem.Interactions.HoldInteraction.html) requires the user to hold a Control for [`duration`](../api/UnityEngine.InputSystem.Interactions.HoldInteraction.html#UnityEngine_InputSystem_Interactions_HoldInteraction_duration) seconds before the Input System triggers the Action.
+A [`HoldInteraction`](xref:UnityEngine.InputSystem.Interactions.HoldInteraction) requires the user to hold a Control for [`duration`](xref:UnityEngine.InputSystem.Interactions.HoldInteraction.duration) seconds before the Input System triggers the Action.
|__Parameters__|Type|Default value|
|---|---|---|
-|[`duration`](../api/UnityEngine.InputSystem.Interactions.HoldInteraction.html#UnityEngine_InputSystem_Interactions_HoldInteraction_duration)|`float`|[`InputSettings.defaultHoldTime`](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_defaultHoldTime)|
-|[`pressPoint`](../api/UnityEngine.InputSystem.Interactions.HoldInteraction.html#UnityEngine_InputSystem_Interactions_HoldInteraction_pressPoint)|`float`|[`InputSettings.defaultButtonPressPoint`](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_defaultButtonPressPoint)|
+|[`duration`](xref:UnityEngine.InputSystem.Interactions.HoldInteraction.duration)|`float`|[`InputSettings.defaultHoldTime`](xref:UnityEngine.InputSystem.InputSettings.defaultHoldTime)|
+|[`pressPoint`](xref:UnityEngine.InputSystem.Interactions.HoldInteraction.pressPoint)|`float`|[`InputSettings.defaultButtonPressPoint`](xref:UnityEngine.InputSystem.InputSettings.defaultButtonPressPoint)|
-To display UI feedback when a button starts being held, use the [`started`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_started) callback.
+To display UI feedback when a button starts being held, use the [`started`](xref:UnityEngine.InputSystem.InputAction.started) callback.
```C#
@@ -206,60 +206,62 @@ To display UI feedback when a button starts being held, use the [`started`](../a
|__Callbacks__||
|---|---|
-|[`started`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_started)|Control magnitude crosses [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.HoldInteraction.html#UnityEngine_InputSystem_Interactions_HoldInteraction_pressPoint).|
-|[`performed`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_performed)|Control magnitude held above [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.HoldInteraction.html#UnityEngine_InputSystem_Interactions_HoldInteraction_pressPoint) for >= [`duration`](../api/UnityEngine.InputSystem.Interactions.HoldInteraction.html#UnityEngine_InputSystem_Interactions_HoldInteraction_duration).|
-|[`canceled`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_canceled)|Control magnitude goes back below [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.HoldInteraction.html#UnityEngine_InputSystem_Interactions_HoldInteraction_pressPoint) before [`duration`](../api/UnityEngine.InputSystem.Interactions.HoldInteraction.html#UnityEngine_InputSystem_Interactions_HoldInteraction_duration) (that is, the button was not held long enough).|
+|[`started`](xref:UnityEngine.InputSystem.InputAction.started)|Control magnitude crosses [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.HoldInteraction.pressPoint).|
+|[`performed`](xref:UnityEngine.InputSystem.InputAction.performed)|Control magnitude held above [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.HoldInteraction.pressPoint) for >= [`duration`](xref:UnityEngine.InputSystem.Interactions.HoldInteraction.duration).|
+|[`canceled`](xref:UnityEngine.InputSystem.InputAction.canceled)|Control magnitude goes back below [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.HoldInteraction.pressPoint) before [`duration`](xref:UnityEngine.InputSystem.Interactions.HoldInteraction.duration) (that is, the button was not held long enough).|
### Tap
-A [`TapInteraction`](../api/UnityEngine.InputSystem.Interactions.TapInteraction.html) requires the user to press and release a Control within [`duration`](../api/UnityEngine.InputSystem.Interactions.TapInteraction.html#UnityEngine_InputSystem_Interactions_TapInteraction_duration) seconds to trigger the Action.
+A [`TapInteraction`](xref:UnityEngine.InputSystem.Interactions.TapInteraction) requires the user to press and release a Control within [`duration`](xref:UnityEngine.InputSystem.Interactions.TapInteraction.duration) seconds to trigger the Action.
|__Parameters__|Type|Default value|
|---|---|---|
-|[`duration`](../api/UnityEngine.InputSystem.Interactions.TapInteraction.html#UnityEngine_InputSystem_Interactions_TapInteraction_duration)|`float`|[`InputSettings.defaultTapTime`](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_defaultTapTime)|
-|[`pressPoint`](../api/UnityEngine.InputSystem.Interactions.TapInteraction.html#UnityEngine_InputSystem_Interactions_TapInteraction_pressPoint)|`float`|[`InputSettings.defaultButtonPressPoint`](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_defaultButtonPressPoint)|
+|[`duration`](xref:UnityEngine.InputSystem.Interactions.TapInteraction.duration)|`float`|[`InputSettings.defaultTapTime`](xref:UnityEngine.InputSystem.InputSettings.defaultTapTime)|
+|[`pressPoint`](xref:UnityEngine.InputSystem.Interactions.TapInteraction.pressPoint)|`float`|[`InputSettings.defaultButtonPressPoint`](xref:UnityEngine.InputSystem.InputSettings.defaultButtonPressPoint)|
|__Callbacks__||
|---|---|
-|[`started`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_started)|Control magnitude crosses [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.TapInteraction.html#UnityEngine_InputSystem_Interactions_TapInteraction_pressPoint).|
-|[`performed`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_performed)|Control magnitude goes back below [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.TapInteraction.html#UnityEngine_InputSystem_Interactions_TapInteraction_pressPoint) before [`duration`](../api/UnityEngine.InputSystem.Interactions.TapInteraction.html#UnityEngine_InputSystem_Interactions_TapInteraction_duration).|
-|[`canceled`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_canceled)|Control magnitude held above [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.TapInteraction.html#UnityEngine_InputSystem_Interactions_TapInteraction_pressPoint) for >= [`duration`](../api/UnityEngine.InputSystem.Interactions.TapInteraction.html#UnityEngine_InputSystem_Interactions_TapInteraction_duration) (that is, the tap was too slow).|
+|[`started`](xref:UnityEngine.InputSystem.InputAction.started)|Control magnitude crosses [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.TapInteraction.pressPoint).|
+|[`performed`](xref:UnityEngine.InputSystem.InputAction.performed)|Control magnitude goes back below [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.TapInteraction.pressPoint) before [`duration`](xref:UnityEngine.InputSystem.Interactions.TapInteraction.duration).|
+|[`canceled`](xref:UnityEngine.InputSystem.InputAction.canceled)|Control magnitude held above [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.TapInteraction.pressPoint) for >= [`duration`](xref:UnityEngine.InputSystem.Interactions.TapInteraction.duration) (that is, the tap was too slow).|
### SlowTap
-A [`SlowTapInteraction`](../api/UnityEngine.InputSystem.Interactions.SlowTapInteraction.html) requires the user to press and hold a Control for a minimum duration of [`duration`](../api/UnityEngine.InputSystem.Interactions.SlowTapInteraction.html#UnityEngine_InputSystem_Interactions_SlowTapInteraction_duration) seconds, and then release it, to trigger the Action.
+A [`SlowTapInteraction`](xref:UnityEngine.InputSystem.Interactions.SlowTapInteraction) requires the user to press and hold a Control for a minimum duration of [`duration`](xref:UnityEngine.InputSystem.Interactions.SlowTapInteraction.duration) seconds, and then release it, to trigger the Action.
|__Parameters__|Type|Default value|
|---|---|---|
-|[`duration`](../api/UnityEngine.InputSystem.Interactions.SlowTapInteraction.html#UnityEngine_InputSystem_Interactions_SlowTapInteraction_duration)|`float`|[`InputSettings.defaultSlowTapTime`](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_defaultSlowTapTime)|
-|[`pressPoint`](../api/UnityEngine.InputSystem.Interactions.SlowTapInteraction.html#UnityEngine_InputSystem_Interactions_SlowTapInteraction_pressPoint)|`float`|[`InputSettings.defaultButtonPressPoint`](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_defaultButtonPressPoint)|
+|[`duration`](xref:UnityEngine.InputSystem.Interactions.SlowTapInteraction.duration)|`float`|[`InputSettings.defaultSlowTapTime`](xref:UnityEngine.InputSystem.InputSettings.defaultSlowTapTime)|
+|[`pressPoint`](xref:UnityEngine.InputSystem.Interactions.SlowTapInteraction.pressPoint)|`float`|[`InputSettings.defaultButtonPressPoint`](xref:UnityEngine.InputSystem.InputSettings.defaultButtonPressPoint)|
|__Callbacks__||
|---|---|
-|[`started`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_started)|Control magnitude crosses [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.SlowTapInteraction.html#UnityEngine_InputSystem_Interactions_SlowTapInteraction_pressPoint).|
-|[`performed`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_performed)|Control magnitude goes back below [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.SlowTapInteraction.html#UnityEngine_InputSystem_Interactions_SlowTapInteraction_pressPoint) after [`duration`](../api/UnityEngine.InputSystem.Interactions.SlowTapInteraction.html#UnityEngine_InputSystem_Interactions_SlowTapInteraction_duration).|
-|[`canceled`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_canceled)|Control magnitude goes back below [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.SlowTapInteraction.html#UnityEngine_InputSystem_Interactions_SlowTapInteraction_pressPoint) before [`duration`](../api/UnityEngine.InputSystem.Interactions.SlowTapInteraction.html#UnityEngine_InputSystem_Interactions_SlowTapInteraction_duration) (that is, the tap was too fast).|
+|[`started`](xref:UnityEngine.InputSystem.InputAction.started)|Control magnitude crosses [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.SlowTapInteraction.pressPoint).|
+|[`performed`](xref:UnityEngine.InputSystem.InputAction.performed)|Control magnitude goes back below [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.SlowTapInteraction.pressPoint) after [`duration`](xref:UnityEngine.InputSystem.Interactions.SlowTapInteraction.duration).|
+|[`canceled`](xref:UnityEngine.InputSystem.InputAction.canceled)|Control magnitude goes back below [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.SlowTapInteraction.pressPoint) before [`duration`](xref:UnityEngine.InputSystem.Interactions.SlowTapInteraction.duration) (that is, the tap was too fast).|
### MultiTap
-A [`MultiTapInteraction`](../api/UnityEngine.InputSystem.Interactions.MultiTapInteraction.html) requires the user to press and release a Control within [`tapTime`](../api/UnityEngine.InputSystem.Interactions.MultiTapInteraction.html#UnityEngine_InputSystem_Interactions_MultiTapInteraction_tapTime) seconds [`tapCount`](../api/UnityEngine.InputSystem.Interactions.MultiTapInteraction.html#UnityEngine_InputSystem_Interactions_MultiTapInteraction_tapCount) times, with no more then [`tapDelay`](../api/UnityEngine.InputSystem.Interactions.MultiTapInteraction.html#UnityEngine_InputSystem_Interactions_MultiTapInteraction_tapDelay) seconds passing between taps, for the Interaction to trigger. You can use this to detect double-click or multi-click gestures.
+A [`MultiTapInteraction`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction) requires the user to press and release a Control within [`tapTime`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction.tapTime) seconds [`tapCount`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction.tapCount) times, with no more then [`tapDelay`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction.tapDelay) seconds passing between taps, for the Interaction to trigger. You can use this to detect double-click or multi-click gestures.
|__Parameters__|Type|Default value|
|---|---|---|
-|[`tapTime`](../api/UnityEngine.InputSystem.Interactions.MultiTapInteraction.html#UnityEngine_InputSystem_Interactions_MultiTapInteraction_tapTime)|`float`|[`InputSettings.defaultTapTime`](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_defaultTapTime)|
-|[`tapDelay`](../api/UnityEngine.InputSystem.Interactions.MultiTapInteraction.html#UnityEngine_InputSystem_Interactions_MultiTapInteraction_tapDelay)|`float`|2 * [`tapTime`](../api/UnityEngine.InputSystem.Interactions.MultiTapInteraction.html#UnityEngine_InputSystem_Interactions_MultiTapInteraction_tapTime)|
-|[`tapCount`](../api/UnityEngine.InputSystem.Interactions.MultiTapInteraction.html#UnityEngine_InputSystem_Interactions_MultiTapInteraction_tapCount)|`int`|2|
-|[`pressPoint`](../api/UnityEngine.InputSystem.Interactions.MultiTapInteraction.html#UnityEngine_InputSystem_Interactions_MultiTapInteraction_pressPoint)|`float`|[`InputSettings.defaultButtonPressPoint`](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_defaultButtonPressPoint)|
+|[`tapTime`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction.tapTime)|`float`|[`InputSettings.defaultTapTime`](xref:UnityEngine.InputSystem.InputSettings.defaultTapTime)|
+|[`tapDelay`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction.tapDelay)|`float`|2 * [`tapTime`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction.tapTime)|
+|[`tapCount`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction.tapCount)|`int`|2|
+|[`pressPoint`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction.pressPoint)|`float`|[`InputSettings.defaultButtonPressPoint`](xref:UnityEngine.InputSystem.InputSettings.defaultButtonPressPoint)|
|__Callbacks__||
|---|---|
-|[`started`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_started)|Control magnitude crosses [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.MultiTapInteraction.html#UnityEngine_InputSystem_Interactions_MultiTapInteraction_pressPoint).|
-|[`performed`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_performed)|Control magnitude went back below [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.MultiTapInteraction.html#UnityEngine_InputSystem_Interactions_MultiTapInteraction_pressPoint) and back up above it repeatedly for [`tapCount`](../api/UnityEngine.InputSystem.Interactions.MultiTapInteraction.html#UnityEngine_InputSystem_Interactions_MultiTapInteraction_tapCount) times.|
-|[`canceled`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_canceled)|- After going back below [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.MultiTapInteraction.html#UnityEngine_InputSystem_Interactions_MultiTapInteraction_pressPoint), Control magnitude did not go back above [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.MultiTapInteraction.html#UnityEngine_InputSystem_Interactions_MultiTapInteraction_pressPoint) within [`tapDelay`](../api/UnityEngine.InputSystem.Interactions.MultiTapInteraction.html#UnityEngine_InputSystem_Interactions_MultiTapInteraction_tapDelay) time (that is, taps were spaced out too far apart). or - After going back above [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.MultiTapInteraction.html#UnityEngine_InputSystem_Interactions_MultiTapInteraction_pressPoint), Control magnitude did not go back below [`pressPoint`](../api/UnityEngine.InputSystem.Interactions.MultiTapInteraction.html#UnityEngine_InputSystem_Interactions_MultiTapInteraction_pressPoint) within [`tapTime`](../api/UnityEngine.InputSystem.Interactions.MultiTapInteraction.html#UnityEngine_InputSystem_Interactions_MultiTapInteraction_tapTime) time (that is, taps were too long).|
+|[`started`](xref:UnityEngine.InputSystem.InputAction.started)|Control magnitude crosses [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction.pressPoint).|
+|[`performed`](xref:UnityEngine.InputSystem.InputAction.performed)|Control magnitude went back below [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction.pressPoint) and back up above it repeatedly for [`tapCount`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction.tapCount) times.|
+|[`canceled`](xref:UnityEngine.InputSystem.InputAction.canceled)|- After going back below [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction.pressPoint), Control magnitude did not go back above [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction.pressPoint) within [`tapDelay`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction.tapDelay) time (that is, taps were spaced out too far apart). or - After going back above [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction.pressPoint), Control magnitude did not go back below [`pressPoint`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction.pressPoint) within [`tapTime`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction.tapTime) time (that is, taps were too long).|
## Writing custom Interactions
-You can also write a custom Interaction to use in your Project. You can use custom Interactions in the UI and code the same way you use built-in Interactions. Add a class implementing the [`IInputInteraction`](../api/UnityEngine.InputSystem.IInputInteraction.html) interface, like this:
+You can also write a custom Interaction to use in your project. You can use custom Interactions in the UI and code the same way you use built-in Interactions.
+
+Add a class implementing the [`IInputInteraction`](xref:UnityEngine.InputSystem.IInputInteraction) interface, like this:
```CSharp
// Interaction which performs when you quickly move an
@@ -303,13 +305,15 @@ public class MyWiggleInteraction : IInputInteraction
}
```
-Now, you need to tell the Input System about your Interaction. Call this method in your initialization code:
+Register your interaction with the Input System in your initialization code:
```CSharp
InputSystem.RegisterInteraction();
```
-Your new Interaction is now available in the [Input Action Asset Editor window](ActionAssets.md). You can also add it in code like this:
+Your new Interaction is now available in the [Input Action Asset Editor window](xref:input-system-action-assets).
+
+You can also add it in code using this call:
```CSharp
var Action = new InputAction(Interactions: "MyWiggle(duration=0.5)");
diff --git a/Packages/com.unity.inputsystem/Documentation~/Joystick.md b/Packages/com.unity.inputsystem/Documentation~/Joystick.md
index ebbca142a4..f0d8c9ed37 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Joystick.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Joystick.md
@@ -3,15 +3,15 @@ uid: input-system-joystick
---
# Joystick support
-The Input System currently has limited support for joysticks as generic [HIDs](HID.md) only. The system attempts to identify Controls based on the information provided in the HID descriptor of the Device, but it might not always be accurate. These Devices often work best when you allow the user to [manually remap the Controls](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.html).
+The Input System currently has limited support for joysticks as generic [HIDs](xref:input-system-hid) only. The system attempts to identify Controls based on the information provided in the HID descriptor of the Device, but it might not always be accurate. These Devices often work best when you allow the user to [manually remap the Controls](xref:UnityEngine.InputSystem.InputActionRebindingExtensions).
-To better support specific joysticks Devices, you can also [provide your own custom mappings for those Devices](HID.md#creating-a-custom-device-layout). Unity might extend the Input System to include some mappings for common devices in the future. See the [manual page on HID](HID.md) for more information.
+To better support specific joysticks Devices, you can also [provide your own custom mappings for those Devices](xref:input-system-hid#creating-a-custom-device-layout). Unity might extend the Input System to include some mappings for common devices in the future. See the [manual page on HID](xref:input-system-hid) for more information.
## Controls
-The Input System supports Generic HID Input Devices which are recognized as joysticks via the [`Joystick`](../api/UnityEngine.InputSystem.Joystick.html) class. Joystick Devices can have any number of Controls as reported by the Device's HID descriptor, but the Input System always tries to at least match these common Controls:
+The Input System supports Generic HID Input Devices which are recognized as joysticks via the [`Joystick`](xref:UnityEngine.InputSystem.Joystick) class. Joystick Devices can have any number of Controls as reported by the Device's HID descriptor, but the Input System always tries to at least match these common Controls:
|Control|Type|Description|
|-------|----|-----------|
-|[`stick`](../api/UnityEngine.InputSystem.Joystick.html#UnityEngine_InputSystem_Joystick_stick)|[`StickControl`](../api/UnityEngine.InputSystem.Controls.StickControl.html)|The main stick of the joystick.|
-|[`trigger`](../api/UnityEngine.InputSystem.Joystick.html#UnityEngine_InputSystem_Joystick_trigger)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|The primary trigger of the joystick.|
+|[`stick`](xref:UnityEngine.InputSystem.Joystick.stick)|[`StickControl`](xref:UnityEngine.InputSystem.Controls.StickControl)|The main stick of the joystick.|
+|[`trigger`](xref:UnityEngine.InputSystem.Joystick.trigger)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|The primary trigger of the joystick.|
diff --git a/Packages/com.unity.inputsystem/Documentation~/Keyboard.md b/Packages/com.unity.inputsystem/Documentation~/Keyboard.md
index 4805961eb6..929bfc1bbb 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Keyboard.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Keyboard.md
@@ -3,65 +3,65 @@ uid: input-system-keyboard
---
# Keyboard support
-The [`Keyboard`](../api/UnityEngine.InputSystem.Keyboard.html) class defines a [Device](Devices.md) with a set of key Controls defined by the [`Key`](../api/UnityEngine.InputSystem.Key.html) enumeration.
+The [`Keyboard`](xref:UnityEngine.InputSystem.Keyboard) class defines a [Device](xref:input-system-devices) with a set of key Controls defined by the [`Key`](xref:UnityEngine.InputSystem.Key) enumeration.
The location of individual keys is agnostic to keyboard layout. This means that, for example, the `A` key is always the key to the right of the `Caps Lock` key, regardless of where the currently active keyboard layout places the key that generates an `a` character, or whether or not the layout doesn't have a key assigned to that character.
-To query which (if any) character is generated by a given key, use the key Control's [`displayName`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_displayName) property. The value of this property changes automatically when the OS changes the keyboard layout.
+To query which (if any) character is generated by a given key, use the key Control's [`displayName`](xref:UnityEngine.InputSystem.InputControl.displayName) property. The value of this property changes automatically when the OS changes the keyboard layout.
-You can look up keys based on the character they produce using [Control paths](Controls.md#control-paths). For example, you can query the key that produces the producing the `a` character from [`Keyboard`](../api/UnityEngine.InputSystem.Keyboard.html) using [`Keyboard.current["#(a)"]`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_Item_UnityEngine_InputSystem_Key_).
+You can look up keys based on the character they produce using [Control paths](xref:input-system-controls#control-paths). For example, you can query the key that produces the producing the `a` character from [`Keyboard`](xref:UnityEngine.InputSystem.Keyboard) using [`Keyboard.current["#(a)"]`](xref:UnityEngine.InputSystem.Keyboard.Item(UnityEngine.InputSystem.Key)).
->__Note__
->* Keyboards usually have hardware limitations on both the number of simultaneous keypresses they report, and the combinations of keys they support. This means that certain simultaneous keypresses may not register correctly. For example, a given keyboard might report a simultaneous press of the "QWERT" keys correctly, but might not report "QWERA" correctly.
->* At the moment, the new Input System doesn't support on-screen keyboards. For now, please Unity's existing API in `UnityEngine.TouchScreenKeyboard`.
->* At the moment, Unity platform backends generally do not support distinguishing between multiple keyboards. While the Input System supports having many [`Keyboard`](../api/UnityEngine.InputSystem.Keyboard.html) devices at any point, platform backends generally only report a single keyboard and route input from all attached keyboards to the one keyboard device.
+> [!NOTE]
+> * Keyboards usually have hardware limitations on both the number of simultaneous keypresses they report, and the combinations of keys they support. This means that certain simultaneous keypresses may not register correctly. For example, a given keyboard might report a simultaneous press of the "QWERT" keys correctly, but might not report "QWERA" correctly.
+> * At the moment, the new Input System doesn't support on-screen keyboards. For now, please Unity's existing API in `UnityEngine.TouchScreenKeyboard`.
+> * At the moment, Unity platform backends generally do not support distinguishing between multiple keyboards. While the Input System supports having many [`Keyboard`](xref:UnityEngine.InputSystem.Keyboard) devices at any point, platform backends generally only report a single keyboard and route input from all attached keyboards to the one keyboard device.
## Controls
-To retrieve a key from [`Keyboard`](../api/UnityEngine.InputSystem.Keyboard.html), you can use one of these methods:
+To retrieve a key from [`Keyboard`](xref:UnityEngine.InputSystem.Keyboard), you can use one of these methods:
-* Use the key's accessor property, such [`Keyboard.spaceKey`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_spaceKey).
-* Use [`Keyboard`](../api/UnityEngine.InputSystem.Keyboard.html)'s indexer and the [`Key`](../api/UnityEngine.InputSystem.Key.html) enumeration (for example, `keyboard[Key.Space]`).
+* Use the key's accessor property, such [`Keyboard.spaceKey`](xref:UnityEngine.InputSystem.Keyboard.spaceKey).
+* Use [`Keyboard`](xref:UnityEngine.InputSystem.Keyboard)'s indexer and the [`Key`](xref:UnityEngine.InputSystem.Key) enumeration (for example, `keyboard[Key.Space]`).
-The [scripting API reference for the `Keyboard` class](../api/UnityEngine.InputSystem.Keyboard.html) lists all the properties for the individual key Controls.
+The [scripting API reference for the `Keyboard` class](xref:UnityEngine.InputSystem.Keyboard) lists all the properties for the individual key Controls.
-Two special Controls, [`anyKey`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_anyKey) and [`imeSelected`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_imeSelected), don't directly map to individual keys. [`anyKey`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_anyKey) is a [synthetic](Controls.md#synthetic-controls) button Control which reports whether any key on the keyboard is pressed, and [`imeSelected`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_imeSelected) reports whether or not [IME](#ime) text processing is enabled.
+Two special Controls, [`anyKey`](xref:UnityEngine.InputSystem.Keyboard.anyKey) and [`imeSelected`](xref:UnityEngine.InputSystem.Keyboard.imeSelected), don't directly map to individual keys. [`anyKey`](xref:UnityEngine.InputSystem.Keyboard.anyKey) is a [synthetic](xref:input-system-controls#synthetic-controls) button Control which reports whether any key on the keyboard is pressed, and [`imeSelected`](xref:UnityEngine.InputSystem.Keyboard.imeSelected) reports whether or not [IME](#ime) text processing is enabled.
-In addition, [`Keyboard`](../api/UnityEngine.InputSystem.Keyboard.html)'s indexer and the [`Key`](../api/UnityEngine.InputSystem.Key.html) has three [synthetic](Controls.md#synthetic-controls) controls that represent combinations of modifier keys:
+In addition, [`Keyboard`](xref:UnityEngine.InputSystem.Keyboard)'s indexer and the [`Key`](xref:UnityEngine.InputSystem.Key) has three [synthetic](xref:input-system-controls#synthetic-controls) controls that represent combinations of modifier keys:
|Control|Description|
|-------|-----------|
-|[`shiftKey`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_shiftKey)|A button that is pressed if [`leftShiftKey`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_leftShiftKey) and/or [`rightShiftKey`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_rightShiftKey) is pressed.|
-|[`ctrlKey`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_ctrlKey)|A button that is pressed if [`leftCtrlKey`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_leftCtrlKey) and/or [`rightCtrlKey`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_rightCtrlKey) is pressed.|
-|[`altKey`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_altKey)|A button that is pressed if [`leftAltKey`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_leftAltKey) and/or [`rightAltKey`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_rightAltKey) is pressed.|
+|[`shiftKey`](xref:UnityEngine.InputSystem.Keyboard.shiftKey)|A button that is pressed if [`leftShiftKey`](xref:UnityEngine.InputSystem.Keyboard.leftShiftKey) and/or [`rightShiftKey`](xref:UnityEngine.InputSystem.Keyboard.rightShiftKey) is pressed.|
+|[`ctrlKey`](xref:UnityEngine.InputSystem.Keyboard.ctrlKey)|A button that is pressed if [`leftCtrlKey`](xref:UnityEngine.InputSystem.Keyboard.leftCtrlKey) and/or [`rightCtrlKey`](xref:UnityEngine.InputSystem.Keyboard.rightCtrlKey) is pressed.|
+|[`altKey`](xref:UnityEngine.InputSystem.Keyboard.altKey)|A button that is pressed if [`leftAltKey`](xref:UnityEngine.InputSystem.Keyboard.leftAltKey) and/or [`rightAltKey`](xref:UnityEngine.InputSystem.Keyboard.rightAltKey) is pressed.|
## Text input
-As a best practice, you shouldn't manually translate text input from key presses by trying to string together the characters corresponding to the keys. Instead, to listen to text input, hook into [`Keyboard.onTextInput`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_onTextInput). This delivers character-by-character input as reported by the platform, including input from on-screen keyboards.
+As a best practice, you shouldn't manually translate text input from key presses by trying to string together the characters corresponding to the keys. Instead, to listen to text input, hook into [`Keyboard.onTextInput`](xref:UnityEngine.InputSystem.Keyboard.onTextInput). This delivers character-by-character input as reported by the platform, including input from on-screen keyboards.
Note that the text input API doesn't allocate GC memory because it doesn't deliver fully composed strings.
### IME
-Some writing systems, such as some East-Asian scripts, are too complex to represent all characters as individual keys on a keyboard. For these layouts, operating systems implement IMEs (Input Method Editors) to allow composing input strings by other methods, for instance by typing several keys to produce a single character. Unity's UI frameworks for text input support IME without any additional configuration. If you want to build your own UI for text input, the [`Keyboard`](../api/UnityEngine.InputSystem.Keyboard.html) class allows you to work with input from IMEs using the following APIs:
+Some writing systems, such as some East-Asian scripts, are too complex to represent all characters as individual keys on a keyboard. For these layouts, operating systems implement IMEs (Input Method Editors) to allow composing input strings by other methods, for instance by typing several keys to produce a single character. Unity's UI frameworks for text input support IME without any additional configuration. If you want to build your own UI for text input, the [`Keyboard`](xref:UnityEngine.InputSystem.Keyboard) class allows you to work with input from IMEs using the following APIs:
-* [`imeSelected`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_imeSelected) is a virtual input Control that reports whether IME text processing is enabled.
+* [`imeSelected`](xref:UnityEngine.InputSystem.Keyboard.imeSelected) is a virtual input Control that reports whether IME text processing is enabled.
-* [`SetIMEEnabled()`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_SetIMEEnabled_System_Boolean_) is a method which lets you turn IME processing on or off. Typically, IME processing is useful when the user wants to edit text, but not so much when the user is using the keyboard to control a game.
+* [`SetIMEEnabled()`](xref:UnityEngine.InputSystem.Keyboard.SetIMEEnabled(System.Boolean)) is a method which lets you turn IME processing on or off. Typically, IME processing is useful when the user wants to edit text, but not so much when the user is using the keyboard to control a game.
-* [`SetIMECursorPosition()`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_SetIMECursorPosition_UnityEngine_Vector2_). IMEs might open system windows that let users interactively edit the text they want to input. Typically, these open next to the text editing UI. You can use the [`SetIMECursorPosition()`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_SetIMECursorPosition_UnityEngine_Vector2_) method to tell the OS where that is.
+* [`SetIMECursorPosition()`](xref:UnityEngine.InputSystem.Keyboard.SetIMECursorPosition(UnityEngine.Vector2)). IMEs might open system windows that let users interactively edit the text they want to input. Typically, these open next to the text editing UI. You can use the [`SetIMECursorPosition()`](xref:UnityEngine.InputSystem.Keyboard.SetIMECursorPosition(UnityEngine.Vector2)) method to tell the OS where that is.
-* [`onIMECompositionChange`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_onIMECompositionChange) is an event you can subscribe to in order to receive all updates to the IME composition string. The composition string is the text input the user is currently editing using an IME. Typically, any UI dealing with text input displays this text (with some visual indication of it being actively edited, usually an underline) at the current text input cursor position.
+* [`onIMECompositionChange`](xref:UnityEngine.InputSystem.Keyboard.onIMECompositionChange) is an event you can subscribe to in order to receive all updates to the IME composition string. The composition string is the text input the user is currently editing using an IME. Typically, any UI dealing with text input displays this text (with some visual indication of it being actively edited, usually an underline) at the current text input cursor position.
## Keyboard layouts
-You can query the name of the current keyboard layout using [`Keyboard.keyboardLayout`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_keyboardLayout). Layout names are platform-specific.
+You can query the name of the current keyboard layout using [`Keyboard.keyboardLayout`](xref:UnityEngine.InputSystem.Keyboard.keyboardLayout). Layout names are platform-specific.
There is no support for setting keyboard layouts from your application.
-To monitor keyboard layout changes, hook into [`InputSystem.onDeviceChange`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_onDeviceChange) and check for [`InputDeviceChange.ConfigurationChanged`](../api/UnityEngine.InputSystem.InputDeviceChange.html) on a [`Keyboard`](../api/UnityEngine.InputSystem.Keyboard.html) device.
+To monitor keyboard layout changes, hook into [`InputSystem.onDeviceChange`](xref:UnityEngine.InputSystem.InputSystem.onDeviceChange) and check for [`InputDeviceChange.ConfigurationChanged`](xref:UnityEngine.InputSystem.InputDeviceChange) on a [`Keyboard`](xref:UnityEngine.InputSystem.Keyboard) device.
-To find the key control that corresponds to a specific display character sequence, call [`Keyboard.FindKeyOnCurrentKeyboardLayout`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_FindKeyOnCurrentKeyboardLayout_).
+To find the key control that corresponds to a specific display character sequence, call [`Keyboard.FindKeyOnCurrentKeyboardLayout`](xref:UnityEngine.InputSystem.Keyboard.FindKeyOnCurrentKeyboardLayout*).
```CSharp
// Find key that generates a 'q' character according to the current keyboard layout.
diff --git a/Packages/com.unity.inputsystem/Documentation~/KnownLimitations.md b/Packages/com.unity.inputsystem/Documentation~/KnownLimitations.md
index 43ee449dad..770dfae231 100644
--- a/Packages/com.unity.inputsystem/Documentation~/KnownLimitations.md
+++ b/Packages/com.unity.inputsystem/Documentation~/KnownLimitations.md
@@ -29,7 +29,8 @@ The following is a list of known limitations that the Input System currently has
* (Android) We only support a single Touchscreen at the moment.
* Joy-Cons are only supported on Switch.
* Sensors in the PS4 controller are currently only supported on PS4.
- >NOTE: Support for NDA platforms is distributed as separate packages due to licensing restrictions. The packages, at this point, are made available separately to licensees for download and installation.
+ > [!NOTE]
+ > Support for NDA platforms is distributed as separate packages due to licensing restrictions. The packages, at this point, are made available separately to licensees for download and installation.
## Features Supported by Old Input Manager
diff --git a/Packages/com.unity.inputsystem/Documentation~/Layouts.md b/Packages/com.unity.inputsystem/Documentation~/Layouts.md
index 2a239a6605..9944c7d4c5 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Layouts.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Layouts.md
@@ -3,38 +3,25 @@ uid: input-system-layouts
---
# Layouts
-* [Layout formats](#layout-formats)
- * [Layout from type](#layout-from-type)
- * [Layout from JSON](#layout-from-json)
- * [Generated layouts](#generated-layouts)
-* [Layout inheritance](#layout-inheritance)
-* [Control items](#control-items)
-* [Layout overrides](#layout-overrides)
-* [Precompiled layouts](#precompiled-layouts)
- * [Creating a precompiled layout](#creating-a-precompiled-layout)
-
Layouts are the central mechanism by which the Input System learns about types of Input Devices and Input Controls. Each layout represents a specific composition of Input Controls. By matching the description of a Device to a layout, the Input System is able to create the correct type of Device and interpret the incoming input data correctly.
->__Note__: Layouts are an advanced, mostly internal feature of the Input System. Knowledge of the layout system is mostly useful if you want to support custom Devices or change the behavior of existing Devices.
+> [!NOTE]
+> Layouts are an advanced, mostly internal feature of the Input System. Knowledge of the layout system is mostly useful if you want to support custom Devices or change the behavior of existing Devices.
A layout describes a memory format for input, and the Input Controls to build in order to read and write data to or from that memory.
The Input System ships with a large set of layouts for common Control types and common Devices. For other Device types, the system automatically generates layouts based on the Device description that the Device's interface reports.
-You can browse the set of currently understood layouts from the Input Debugger.
-
-
-
-A layout has two primary functions:
+Open the Input Debugger to browse the set of currently available layouts. A layout has two primary functions:
* Describe a certain memory layout containing input data.
* Assign names, structure, and meaning to the Controls operating on the data.
-A layout can either be for a Control on a Device (for example, `Stick`), or for a Device itself (that is, anything based on [`InputDevice`](../api/UnityEngine.InputSystem.InputDevice.html)).
+A layout can either be for a Control on a Device (for example, `Stick`), or for a Device itself (that is, anything based on [`InputDevice`](xref:UnityEngine.InputSystem.InputDevice)).
-The Input System only loads layouts when they are needed (usually, when creating a new Device). To manually load a layout, you can use [`InputSystem.LoadLayout`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_LoadLayout_System_String_). This returns an [`InputControlLayout`](../api/UnityEngine.InputSystem.Layouts.InputControlLayout.html) instance, which contains the final, fully merged (that is, containing any information inherited from base layouts and/or affected by layout overrides) structure of the layout.
+The Input System only loads layouts when they are needed (usually, when creating a new Device). To manually load a layout, you can use [`InputSystem.LoadLayout`](xref:UnityEngine.InputSystem.InputSystem.LoadLayout(System.String)). This returns an [`InputControlLayout`](xref:UnityEngine.InputSystem.Layouts.InputControlLayout) instance, which contains the final, fully merged (that is, containing any information inherited from base layouts and/or affected by layout overrides) structure of the layout.
-You can register new layouts through [`InputSystem.RegisterLayout`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_RegisterLayout_System_String_System_String_System_Nullable_UnityEngine_InputSystem_Layouts_InputDeviceMatcher__).
+You can register new layouts through [`InputSystem.RegisterLayout`](xref:UnityEngine.InputSystem.InputSystem.RegisterLayout(System.String,System.String,System.Nullable{UnityEngine.InputSystem.Layouts.InputDeviceMatcher})).
## Layout formats
@@ -48,8 +35,8 @@ You can add new layouts layouts in one of three ways.
In its most basic form, a layout can be expressed by a C# class derived from:
-* [`InputControl`](../api/UnityEngine.InputSystem.InputControl.html) for a Control layout.
-* [`InputDevice`](../api/UnityEngine.InputSystem.InputDevice.html) for a Device layout.
+* [`InputControl`](xref:UnityEngine.InputSystem.InputControl) for a Control layout.
+* [`InputDevice`](xref:UnityEngine.InputSystem.InputDevice) for a Device layout.
```CSharp
// The InputControlLayout attribute is not strictly necessary here.
@@ -71,7 +58,7 @@ public class MyDevice : InputDevice
}
```
-You can then register the layout with [`InputSystem.RegisterLayout`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_RegisterLayout_System_String_System_String_System_Nullable_UnityEngine_InputSystem_Layouts_InputDeviceMatcher__). This works the same for Control and for Device layouts.
+You can then register the layout with [`InputSystem.RegisterLayout`](xref:UnityEngine.InputSystem.InputSystem.RegisterLayout(System.String,System.String,System.Nullable{UnityEngine.InputSystem.Layouts.InputDeviceMatcher})). This works the same for Control and for Device layouts.
```CSharp
// Note: This should generally be done from InitializeOnLoad/
@@ -81,16 +68,16 @@ InputSystem.RegisterLayout();
When the layout is instantiated, the system looks at every field and property defined directly in the type to potentially turn it into one or more [Control items](#control-items).
-1. If the field or property is annotated with [`InputControlAttribute`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html), the system applies the attribute's properties to the Control item. Some special defaults apply in this case:
- * If no [`offset`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_offset) is set, and the attribute is applied to a field, [`offset`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_offset) defaults to the offset of the field.
- * If no [`name`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_name) is set, it defaults to the name of the property/field.
- * If no [`layout`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_layout) is set, the system infers it from the type of the field/property.
-2. If the field or property has a struct type which implements [`IInputStateTypeInfo`](../api/UnityEngine.InputSystem.LowLevel.IInputStateTypeInfo.html), the field is considered to be an embedded [state struct](#using-a-state-structure) and the system recurses into the field or property to gather Controls from it.
-3. Otherwise, if the type of the field or property is based on [`InputControl`](../api/UnityEngine.InputSystem.InputControl.html), the system adds a [Control item](#control-items) similar to case 1, where the member is annotated with [`InputControlAttribute`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html).
+1. If the field or property is annotated with [`InputControlAttribute`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute), the system applies the attribute's properties to the Control item. Some special defaults apply in this case:
+ * If no [`offset`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.offset) is set, and the attribute is applied to a field, [`offset`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.offset) defaults to the offset of the field.
+ * If no [`name`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.name) is set, it defaults to the name of the property/field.
+ * If no [`layout`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.layout) is set, the system infers it from the type of the field/property.
+2. If the field or property has a struct type which implements [`IInputStateTypeInfo`](xref:UnityEngine.InputSystem.LowLevel.IInputStateTypeInfo), the field is considered to be an embedded [state struct](#using-a-state-structure) and the system recurses into the field or property to gather Controls from it.
+3. Otherwise, if the type of the field or property is based on [`InputControl`](xref:UnityEngine.InputSystem.InputControl), the system adds a [Control item](#control-items) similar to case 1, where the member is annotated with [`InputControlAttribute`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute).
#### Using a state structure
-When you implement support for a new Input Device, there's usually an existing data format in which the Input System receives input for the Device. The easiest way to add support for the data format is to describe it with a C# struct annotated with [`InputControlAttribute`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html).
+When you implement support for a new Input Device, there's usually an existing data format in which the Input System receives input for the Device. The easiest way to add support for the data format is to describe it with a C# struct annotated with [`InputControlAttribute`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute).
```CSharp
public struct MyDeviceState : IInputStateTypeInfo
@@ -122,7 +109,7 @@ public class MyDevice : InputDevice
### Layout from JSON
-You can also create a layout from a JSON string that contains the same information. This is mostly useful if you want to be able to store and transfer layout information separate from your code - for instance, if you want to be able to add support for new Devices dynamically without making a new build of your application. You can use [`InputControlLayout.ToJson()`](../api/UnityEngine.InputSystem.Layouts.InputControlLayout.html#UnityEngine_InputSystem_Layouts_InputControlLayout_ToJson) and [`InputControlLayout.FromJson()`](../api/UnityEngine.InputSystem.Layouts.InputControlLayout.html#UnityEngine_InputSystem_Layouts_InputControlLayout_FromJson_System_String_) to convert layouts to and from the format.
+You can also create a layout from a JSON string that contains the same information. This is mostly useful if you want to be able to store and transfer layout information separate from your code - for instance, if you want to be able to add support for new Devices dynamically without making a new build of your application. You can use [`InputControlLayout.ToJson()`](xref:UnityEngine.InputSystem.Layouts.InputControlLayout.ToJson) and [`InputControlLayout.FromJson()`](xref:UnityEngine.InputSystem.Layouts.InputControlLayout.FromJson(System.String)) to convert layouts to and from the format.
The same layout as above looks like this in JSON format:
@@ -189,9 +176,9 @@ The same layout as above looks like this in JSON format:
### Generated layouts
-Finally, the Input System can also build layouts on the fly in code. This is useful for Device interfaces such as [HID](HID.md) that supply descriptive information for each Device.
+Finally, the Input System can also build layouts on the fly in code. This is useful for Device interfaces such as [HID](xref:input-system-hid) that supply descriptive information for each Device.
-To build layouts dynamically in code, you can use the [`InputControlLayout.Builder`](../api/UnityEngine.InputSystem.Layouts.InputControlLayout.Builder.html) API.
+To build layouts dynamically in code, you can use the [`InputControlLayout.Builder`](xref:UnityEngine.InputSystem.Layouts.InputControlLayout.Builder) API.
Here's the same layout from the previous examples constructed programmatically:
@@ -251,7 +238,7 @@ You can derive a layout from an existing layout. This process is based on mergin
* For layouts defined as types, the base layout is the layout of the base type (if any).
* For layouts defined in JSON, you can specify the base layout in the `extends` property of the root node.
-* For layouts created in code using [`InputControlLayout.Builder`](../api/UnityEngine.InputSystem.Layouts.InputControlLayout.Builder.html), you can specify a base layout using [`InputControlLayout.Builder.Extend()`](../api/UnityEngine.InputSystem.Layouts.InputControlLayout.Builder.html#UnityEngine_InputSystem_Layouts_InputControlLayout_Builder_Extend_System_String_).
+* For layouts created in code using [`InputControlLayout.Builder`](xref:UnityEngine.InputSystem.Layouts.InputControlLayout.Builder), you can specify a base layout using [`InputControlLayout.Builder.Extend()`](xref:UnityEngine.InputSystem.Layouts.InputControlLayout.Builder.Extend(System.String)).
## Control items
@@ -266,34 +253,34 @@ Each layout is comprised of zero or more Control items. Each item either describ
public int buttons;
```
-The following table details the properties that a Control item can have. These can be set as properties on [`InputControlAttribute`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html), as properties on the Control in JSON, or through methods on [`InputControlLayout.Builder.ControlBuilder`](../api/UnityEngine.InputSystem.Layouts.InputControlLayout.Builder.ControlBuilder.html).
+The following table details the properties that a Control item can have. These can be set as properties on [`InputControlAttribute`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute), as properties on the Control in JSON, or through methods on [`InputControlLayout.Builder.ControlBuilder`](xref:UnityEngine.InputSystem.Layouts.InputControlLayout.Builder.ControlBuilder).
|Property|Description|
|--------|-----------|
-|[`name`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_name)|Name of the Control. By default, this is the name of the field/property that [`InputControlAttribute`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html) is applied to.|
-|[`displayName`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_displayName)|Display name of the Control (for use in UI strings).|
-|[`shortDisplayName`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_shortDisplayName)|Short display name of the Control (for use in UI strings).|
-|[`layout`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_layout)|Layout to use for the Control.|
-|[`variants`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_variants)|Variants of the Control.|
-|[`aliases`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_aliases)|Aliases for the Control. These are alternative names the Control can be referred by.|
-|[`usages`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_usages)|[Usages](Controls.md#control-usages) of the Control.|
-|[`offset`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_offset)|The byte offset at which the state for the Control is found.|
-|[`bit`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_bit)|The bit offset at which the state of the Control is found within its byte.|
-|[`sizeInBits`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_sizeInBits)|The total size of the Control's state, in bits.|
-|[`arraySize`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_arraySize)|If this is set to a non-zero value, the system will create an array of Controls of this size.|
-|[`parameters`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_parameters)|Any parameters to be passed to the Control. The system will apply these to any fields the Control type might have, such as [`AxisControl.scaleFactor`](../api/UnityEngine.InputSystem.Controls.AxisControl.html#UnityEngine_InputSystem_Controls_AxisControl_scaleFactor).|
-|[`processors`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_processors)|[Processors](UsingProcessors.md) to apply to the Control.|
-|[`noisy`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_noisy)|Whether the Control is to be considered [noisy](Controls.md#noisy-controls).|
-|[`synthetic`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_synthetic)|Whether the Control is to be considered [synthetic](Controls.md#synthetic-controls).|
-|[`defaultState`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_defaultState)|Default initial value of the state __memory__ Control.|
-|[`useStateFrom`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_useStateFrom)|For [synthetic](Controls.md#synthetic-controls) Controls, used to synthesize Control state.|
-|[`minValue`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_minValue)|The minimum value the Control can report. Used for evaluating [Control magnitude](Controls.md#control-actuation).|
-|[`maxValue`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_maxValue)|The maximum value the Control can report. Used for evaluating [Control magnitude](Controls.md#control-actuation).|
-|[`dontReset`](../api/UnityEngine.InputSystem.Layouts.InputControlAttribute.html#UnityEngine_InputSystem_Layouts_InputControlAttribute_dontReset)|When a device ["soft" reset](Devices.md#device-resets) is performed, the state of this control will not be reset. This is useful for controls such as pointer positions which should not go to `(0,0)` on a reset. When a "hard" reset is performed, the control will still be reset to its default value.|
+|[`name`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.name)|Name of the Control. By default, this is the name of the field/property that [`InputControlAttribute`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute) is applied to.|
+|[`displayName`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.displayName)|Display name of the Control (for use in UI strings).|
+|[`shortDisplayName`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.shortDisplayName)|Short display name of the Control (for use in UI strings).|
+|[`layout`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.layout)|Layout to use for the Control.|
+|[`variants`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.variants)|Variants of the Control.|
+|[`aliases`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.aliases)|Aliases for the Control. These are alternative names the Control can be referred by.|
+|[`usages`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.usages)|[Usages](xref:input-system-controls#control-usages) of the Control.|
+|[`offset`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.offset)|The byte offset at which the state for the Control is found.|
+|[`bit`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.bit)|The bit offset at which the state of the Control is found within its byte.|
+|[`sizeInBits`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.sizeInBits)|The total size of the Control's state, in bits.|
+|[`arraySize`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.arraySize)|If this is set to a non-zero value, the system will create an array of Controls of this size.|
+|[`parameters`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.parameters)|Any parameters to be passed to the Control. The system will apply these to any fields the Control type might have, such as [`AxisControl.scaleFactor`](xref:UnityEngine.InputSystem.Controls.AxisControl.scaleFactor).|
+|[`processors`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.processors)|[Processors](UsingProcessors.md) to apply to the Control.|
+|[`noisy`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.noisy)|Whether the Control is to be considered [noisy](xref:input-system-controls#noisy-controls).|
+|[`synthetic`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.synthetic)|Whether the Control is to be considered [synthetic](xref:input-system-controls#synthetic-controls).|
+|[`defaultState`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.defaultState)|Default initial value of the state __memory__ Control.|
+|[`useStateFrom`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.useStateFrom)|For [synthetic](xref:input-system-controls#synthetic-controls) Controls, used to synthesize Control state.|
+|[`minValue`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.minValue)|The minimum value the Control can report. Used for evaluating [Control magnitude](xref:input-system-controls#control-actuation).|
+|[`maxValue`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.maxValue)|The maximum value the Control can report. Used for evaluating [Control magnitude](xref:input-system-controls#control-actuation).|
+|[`dontReset`](xref:UnityEngine.InputSystem.Layouts.InputControlAttribute.dontReset)|When a device ["soft" reset](xref:input-system-devices#device-resets) is performed, the state of this control will not be reset. This is useful for controls such as pointer positions which should not go to `(0,0)` on a reset. When a "hard" reset is performed, the control will still be reset to its default value.|
## Layout overrides
-You can non-destructively change aspects of an existing layout using layout overrides. You can call [`InputSystem.RegisterLayoutOverride`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_RegisterLayoutOverride_System_String_System_String_) to register a layout as an override of its [base layout](#layout-inheritance). The system then adds any property present in the override to the base layout or to existing properties.
+You can non-destructively change aspects of an existing layout using layout overrides. You can call [`InputSystem.RegisterLayoutOverride`](xref:UnityEngine.InputSystem.InputSystem.RegisterLayoutOverride(System.String,System.String)) to register a layout as an override of its [base layout](#layout-inheritance). The system then adds any property present in the override to the base layout or to existing properties.
```CSharp
// Add an extra Control to the "Mouse" layout
@@ -312,27 +299,33 @@ InputSystem.RegisterLayoutOverride(json);
## Precompiled layouts
-Building a device at runtime from an [`InputControlLayout`](../api/UnityEngine.InputSystem.Layouts.InputControlLayout.html) is a slow process. The layout instance itself has to be built (which might involve reflection) and then interpreted in order to put the final [`InputDevice`](../api/UnityEngine.InputSystem.InputDevice.html) instance together. This process usually involves the loading of multiple [`InputControlLayout`](../api/UnityEngine.InputSystem.Layouts.InputControlLayout.html) instances, each of which might be the result of merging multiple layouts together (if the layout involves [inheritance](#layout-inheritance) or [overrides](#layout-overrides)).
+Building a device at runtime from an [`InputControlLayout`](xref:UnityEngine.InputSystem.Layouts.InputControlLayout) is a slow process. The layout instance itself has to be built (which might involve reflection) and then interpreted in order to put the final [`InputDevice`](xref:UnityEngine.InputSystem.InputDevice) instance together. This process usually involves the loading of multiple [`InputControlLayout`](xref:UnityEngine.InputSystem.Layouts.InputControlLayout) instances, each of which might be the result of merging multiple layouts together (if the layout involves [inheritance](#layout-inheritance) or [overrides](#layout-overrides)).
-You can speed up this process up by "baking" the final form of a layout into a "precompiled layout". A precompiled layout is generated C# code that, when run, will build the corresponding device without relying on loading and interpreting an [`InputControlLayout`](../api/UnityEngine.InputSystem.Layouts.InputControlLayout.html). Aside from running faster, this will also create far less garbage and will not involve C# reflection (which generally causes runtime overhead by inflating the number of objects internally kept by the C# runtime).
+You can speed up this process up by "baking" the final form of a layout into a "precompiled layout". A precompiled layout is generated C# code that, when run, will build the corresponding device without relying on loading and interpreting an [`InputControlLayout`](xref:UnityEngine.InputSystem.Layouts.InputControlLayout). Aside from running faster, this will also create far less garbage and will not involve C# reflection (which generally causes runtime overhead by inflating the number of objects internally kept by the C# runtime).
->__NOTE__: Precompiled layouts must be device layouts. It is not possible to precompile the layout for an [`InputControl`](../api/UnityEngine.InputSystem.InputControl.html).
+> [!NOTE]
+> Precompiled layouts must be device layouts. It is not possible to precompile the layout for an [`InputControl`](xref:UnityEngine.InputSystem.InputControl).
### Creating a precompiled layout
-The first step in setting up a precompiled layout is to generate it. To do so, open the [Input Debugger](./Debugging.md), navigate to the layout you want to precompile within the **Layouts** branch, right-click it, and select **Generate Precompiled Layout**.
+The first step in setting up a precompiled layout is to generate it.
+
+To generate a layout:
-
+1. Open the [Input Debugger](xref:input-system-debugging).
+2. Navigate to the layout you want to precompile within the **Layouts** branch and right-click it.
+3. Select **Generate Precompiled Layout**.
-Unity will ask you where to store the generated code. Pick a directory in your project, enter a file name, and click **Save**.
+ Unity will ask you where to store the generated code. Pick a directory in your project, enter a file name, and click **Save**.
- Once generated, you can register the precompiled layout with the Input System using [`InputSystem.RegisterPrecompiledLayout`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_RegisterPrecompiledLayout__1_System_String_). The method expects a string argument containing metadata for the precompiled layout. This string is automatically emitted as a `const` inside the generated class.
+Once generated, you can register the precompiled layout with the Input System using [`InputSystem.RegisterPrecompiledLayout`](xref:UnityEngine.InputSystem.InputSystem.RegisterPrecompiledLayout``1(System.String)). The method expects a string argument containing metadata for the precompiled layout. This string is automatically emitted as a `const` inside the generated class.
```CSharp
InputSystem.RegisterPrecompiledLayout(MyPrecompiledDevice.metadata);
```
->__IMPORTANT__: It is very important that this method is called with all relevant layout registrations being in the same state as at the time the layout was precompiled. There is no internal check whether the precompiled layout will still generate an identical result to the non-precompiled version.
+> [!IMPORTANT]
+> It is very important that this method is called with all relevant layout registrations being in the same state as at the time the layout was precompiled. There is no internal check whether the precompiled layout will still generate an identical result to the non-precompiled version.
Once registered, a precompiled layout is automatically used whenever the layout that the precompiled layout is based on is instantiated.
@@ -367,7 +360,7 @@ InputSystem.AddDevice();
A precompiled layout will automatically be unregistered in the following cases:
-* A [layout override](#layout-overrides) is applied to one of the layouts used by the precompiled Device. This also extends to [controls](Controls.md) used by the Device.
+* A [layout override](#layout-overrides) is applied to one of the layouts used by the precompiled Device. This also extends to [controls](xref:input-system-controls) used by the Device.
* A layout with the same name as one of the layouts used by the precompiled Device is registered (which replaces the layout already registered under the name).
* A [processor](UsingProcessors.md) is registered that replaces a processor used by the precompiled Device.
diff --git a/Packages/com.unity.inputsystem/Documentation~/Migration.md b/Packages/com.unity.inputsystem/Documentation~/Migration.md
index 1a65545a3c..4b642af63d 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Migration.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Migration.md
@@ -3,27 +3,17 @@ uid: input-system-migration
---
# Migrating from the old Input Manager
-- [Read the introductory documentation first](#read-the-introductory-documentation-first)
-- [Which system is enabled?](#which-system-is-enabled)
-- [Comparison of API in the old Input Manager and the new Input System package](#comparison-of-api-in-the-old-input-manager-and-the-new-input-system-package)
- - [Action-based input](#action-based-input)
- - [Directly reading Gamepad and Joystick controls](#directly-reading-gamepad-and-joystick-controls)
- - [Keyboard](#keyboard)
- - [Mouse](#mouse)
- - [Touch and Pen](#touch-and-pen)
- - [Sensors](#sensors)
-
This page is provided to help you match input-related API from Unity's old, built-in input (known as the [Input Manager](https://docs.unity3d.com/Manual/class-InputManager.html)) to the corresponding API in the new Input System package.
## Read the introductory documentation first
-If you're new to the Input System package and have landed on this page looking for documentation, it's best to read the [QuickStart Guide](QuickStartGuide.md), and the [Concepts](Concepts.md) and [Workflows](Workflows.md) pages from the introduction section of the documentation, so that you can make sure you're choosing the best workflow for your project's input requirements.
+If you're new to the Input System package and have landed on this page looking for documentation, it's best to read the [QuickStart Guide](xref:input-system-quickstart), and the [Concepts](xref:basic-concepts) and [Workflows](xref:input-system-workflows) pages from the introduction section of the documentation, so that you can make sure you're choosing the best workflow for your project's input requirements.
This is because there are a number of different ways to read input using the Input System, and some of the directly corresponding API methods on this page might give you the quickest - but least flexible - solution, and may not be suitable for a project with more complex requirements.
## Which system is enabled?
-When installing the new Input System, Unity prompts you to enable the new input system and disable the old one. You can change this setting at any time later, by going to **Edit > Project Settings > Player > Other Settings > Active Input Handling**, [as described here](./Installation.md#enabling-the-new-input-backends).
+When installing the new Input System, Unity prompts you to enable the new input system and disable the old one. You can change this setting at any time later, by going to **Edit > Project Settings > Player > Other Settings > Active Input Handling**, [as described here](xref:input-system-installation#enable-the-input-backends).
There are scripting symbols defined which allow you to use conditional compilation based on which system is enabled, as shown in the example below.
@@ -37,7 +27,8 @@ There are scripting symbols defined which allow you to use conditional compilati
#endif
```
-> **Note:** It is possible to have both systems enabled at the same time, in which case both sets of code in the example above above will be active.
+> [!NOTE]
+> It is possible to have both systems enabled at the same time, in which case both sets of code in the example above above will be active.
## Comparison of API in the old Input Manager and the new Input System package
@@ -46,16 +37,17 @@ All of the new Input System package APIs listed below are in the `UnityEngine.In
### Action-based input
-Action-based input refers to reading pre-configured named axes, buttons, or other controls. ([Read more about Action-based input](./Workflow-Actions.md))
+Action-based input refers to reading pre-configured named axes, buttons, or other controls. ([Read more about Action-based input](xref:input-system-workflow-project-wide-actions))
- In the old Input Manager, these are defined in the **Axes** list, in the **Input Manager** section of the **Project Settings** window. _(Below, left)_
-- In the new Input System, these are defined in the [Actions Editor](ActionsEditor.md), which can be found in the **Input System Package** section of the **Project Settings** window, or by opening an [Action Asset](ActionAssets.md). _(Below, right)_
+- In the new Input System, these are defined in the [Actions Editor](xref:input-system-configuring-input), which can be found in the **Input System Package** section of the **Project Settings** window, or by opening an [Action Asset](xref:input-system-action-assets). _(Below, right)_
-_On the left, the old Input Manager Axes Configuration window, in Project settings. On the right, the new Input System's [Actions Editor](ActionsEditor.md)._
+_On the left, the old Input Manager Axes Configuration window, in Project settings. On the right, the new Input System's [Actions Editor](xref:input-system-configuring-input)._
-__Note:__ In some cases for named axes and buttons, the new Input System requires slightly more code than the old Input Manager, but this results in better performance. This is because in the new Input System, the logic is separated into two parts: the first is to find and store a reference to the action (usually done once, for example in your `Start` method), and the second is to read the action (usually done every frame, for example in your `Update` method). In contrast, the old Input Manager used a string-based API to "find" and "read" the value at the same time, because it was not possible to store a reference to a button or axis. This results in worse performance, because the axis or button is looked up each time the value is read.
+> [!NOTE]
+> In some cases for named axes and buttons, the new Input System requires slightly more code than the old Input Manager, but this results in better performance. This is because in the new Input System, the logic is separated into two parts: the first is to find and store a reference to the action (usually done once, for example in your `Start` method), and the second is to read the action (usually done every frame, for example in your `Update` method). In contrast, the old Input Manager used a string-based API to "find" and "read" the value at the same time, because it was not possible to store a reference to a button or axis. This results in worse performance, because the axis or button is looked up each time the value is read.
-To find and store references to actions, which can be axes or buttons use [`FindAction`](../api/UnityEngine.InputSystem.InputActionAsset.html#UnityEngine_InputSystem_InputActionAsset_FindAction_System_String_System_Boolean_). For example:
+To find and store references to actions, which can be axes or buttons use [`FindAction`](xref:UnityEngine.InputSystem.InputActionAsset.FindAction(System.String,System.Boolean)). For example:
```
// A 2D axis action named "Move"
InputAction moveAction = InputSystem.actions.FindAction("Move");
@@ -68,87 +60,89 @@ Then, to read the action values, use the following:
|Input Manager (Old)|Input System (New)|
|--|--|
-[`Input.GetAxis`](https://docs.unity3d.com/ScriptReference/Input.GetAxis.html) In the old Input Manager System, all axes are 1D and return float values. For example, to read the horizontal and vertical axes: `float h = Input.GetAxis("Horizontal");` `float v = Input.GetAxis("Vertical");` | Use [`ReadValue`](../api/UnityEngine.InputSystem.InputBindingComposite-1.html#UnityEngine_InputSystem_InputBindingComposite_1_ReadValue_UnityEngine_InputSystem_InputBindingCompositeContext__) on the reference to the action to read the current value of the axis. In the new Input System, axes can be 1D, 2D or other value types. You must specify the correct value type that corresponds with how the action is set up. This example shows a 2D axis: `Vector2 moveVector = moveAction.ReadValue();`.
-[`Input.GetButton`](https://docs.unity3d.com/ScriptReference/Input.GetButton.html) Example: `bool jumpValue = Input.GetButton("Jump");` |Use [`IsPressed`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_IsPressed_) on the reference to the action to read the button value. Example: `bool jumpValue = jumpAction.IsPressed();`.
-[`Input.GetButtonDown`](https://docs.unity3d.com/ScriptReference/Input.GetButtonDown.html) Example: `bool jump = Input.GetButtonDown("Jump");` |Use [`WasPressedThisFrame`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasPressedThisFrame_) on the reference to the action to read if the button was pressed this frame. Example: `bool jumpValue = jumpAction.WasPressedThisFrame();`.
-[`Input.GetButtonUp`](https://docs.unity3d.com/ScriptReference/Input.GetButtonUp.html) Example: `bool jump = Input.GetButtonUp("Jump");` |Use [`WasReleasedThisFrame`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasReleasedThisFrame_) on the reference to the action to read whether the button was released this frame. Example: `bool jumpValue = jumpAction.WasReleasedThisFrame();`.
-[`Input.GetAxisRaw`](https://docs.unity3d.com/ScriptReference/Input.GetAxisRaw.html) For example, to read the raw values of the horizontal and vertical axes: `float h = Input.GetAxisRaw("Horizontal");` `float v = Input.GetAxisRaw("Vertical");` |No direct equivalent, but if there are [processors](UsingProcessors.md) associated with the action, you can use [`InputControl<>.ReadUnprocessedValue()`](../api/UnityEngine.InputSystem.InputControl-1.html#UnityEngine_InputSystem_InputControl_1_ReadUnprocessedValue) to read unprocessed values. Example: `Vector2 moveVector = moveAction.ReadUnprocessedValue();` Note: This returns the same value as ReadValue when there are no processors on the action.
+[`Input.GetAxis`](xref:UnityEngine.Input.GetAxis(System.String)) In the old Input Manager System, all axes are 1D and return float values. For example, to read the horizontal and vertical axes: `float h = Input.GetAxis("Horizontal");` `float v = Input.GetAxis("Vertical");` | Use [`ReadValue`](xref:UnityEngine.InputSystem.InputBindingComposite`1.ReadValue(UnityEngine.InputSystem.InputBindingCompositeContext@)) on the reference to the action to read the current value of the axis. In the new Input System, axes can be 1D, 2D or other value types. You must specify the correct value type that corresponds with how the action is set up. This example shows a 2D axis: `Vector2 moveVector = moveAction.ReadValue();`.
+[`Input.GetButton`](xref:UnityEngine.Input.GetButton(System.String)) Example: `bool jumpValue = Input.GetButton("Jump");` |Use [`IsPressed`](xref:UnityEngine.InputSystem.InputAction.IsPressed*) on the reference to the action to read the button value. Example: `bool jumpValue = jumpAction.IsPressed();`.
+[`Input.GetButtonDown`](xref:UnityEngine.Input.GetButtonDown(System.String)) Example: `bool jump = Input.GetButtonDown("Jump");` |Use [`WasPressedThisFrame`](xref:UnityEngine.InputSystem.InputAction.WasPressedThisFrame*) on the reference to the action to read if the button was pressed this frame. Example: `bool jumpValue = jumpAction.WasPressedThisFrame();`.
+[`Input.GetButtonUp`](xref:UnityEngine.Input.GetButtonUp(System.String)) Example: `bool jump = Input.GetButtonUp("Jump");` |Use [`WasReleasedThisFrame`](xref:UnityEngine.InputSystem.InputAction.WasReleasedThisFrame*) on the reference to the action to read whether the button was released this frame. Example: `bool jumpValue = jumpAction.WasReleasedThisFrame();`.
+[`Input.GetAxisRaw`](xref:UnityEngine.Input.GetAxisRaw(System.String)) For example, to read the raw values of the horizontal and vertical axes: `float h = Input.GetAxisRaw("Horizontal");` `float v = Input.GetAxisRaw("Vertical");` |No direct equivalent, but if there are [processors](UsingProcessors.md) associated with the action, you can use [`InputControl<>.ReadUnprocessedValue()`](xref:UnityEngine.InputSystem.InputControl`1.ReadUnprocessedValue) to read unprocessed values. Example: `Vector2 moveVector = moveAction.ReadUnprocessedValue();` Note: This returns the same value as ReadValue when there are no processors on the action.
### Directly reading Gamepad and Joystick controls
-Directly reading hardware controls bypasses the new Input System's action-based workflow, which has some benefits and some drawbacks. ([Read more about directly reading devices](./Workflow-Direct.md))
+Directly reading hardware controls bypasses the new Input System's action-based workflow, which has some benefits and some drawbacks. ([Read more about directly reading devices](xref:input-system-workflow-direct))
|Input Manager (Old)|Input System (New)|
|--|--|
-[`Input.GetKey`](https://docs.unity3d.com/ScriptReference/Input.GetKey.html) Example: `Input.GetKey(KeyCode.JoystickButton0)` |Use [`isPressed`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html#UnityEngine_InputSystem_Controls_ButtonControl_isPressed) on the corresponding Gamepad button. Example: `InputSystem.GamePad.current.buttonNorth.isPressed`.
-[`Input.GetKeyDown`](https://docs.unity3d.com/ScriptReference/Input.GetKeyDown.html) Example: `Input.GetKeyDown(KeyCode.JoystickButton0)` |Use [`wasPressedThisFrame`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html#UnityEngine_InputSystem_Controls_ButtonControl_wasPressedThisFrame) on the corresponding Gamepad button. Example: `InputSystem.GamePad.current.buttonNorth.WasPressedThisFrame`.
-[`Input.GetKeyUp`](https://docs.unity3d.com/ScriptReference/Input.GetKeyUp.html) Example: `Input.GetKeyUp(KeyCode.JoystickButton0)` |Use [`wasReleasedThisFrame`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html#UnityEngine_InputSystem_Controls_ButtonControl_wasReleasedThisFrame) on the corresponding Gamepad button. Example: `InputSystem.GamePad.current.buttonNorth.wasReleasedThisFrame`.
-[`Input.GetJoystickNames`](https://docs.unity3d.com/ScriptReference/Input.GetJoystickNames.html)|There is no API that corresponds to this exactly, but there are examples of [how to read all connected devices here](Gamepad.html#discover-all-connected-devices).
-[`Input.IsJoystickPreconfigured`](https://docs.unity3d.com/ScriptReference/Input.IsJoystickPreconfigured.html)|Not needed. Devices which derive from [`Gamepad`](../api/UnityEngine.InputSystem.Gamepad.html) always correctly implement the mapping of axes and buttons to the corresponding [`InputControl`](../api/UnityEngine.InputSystem.InputControl.html) members of the [`Gamepad`](../api/UnityEngine.InputSystem.Gamepad.html) class. [`Input.ResetInputAxes`](https://docs.unity3d.com/ScriptReference/Input.ResetInputAxes.html)
+[`Input.GetKey`](xref:UnityEngine.Input.GetKey(System.String)) Example: `Input.GetKey(KeyCode.JoystickButton0)` |Use [`isPressed`](xref:UnityEngine.InputSystem.Controls.ButtonControl.isPressed) on the corresponding Gamepad button. Example: `InputSystem.GamePad.current.buttonNorth.isPressed`.
+[`Input.GetKeyDown`](xref:UnityEngine.Input.GetKeyDown(System.String)) Example: `Input.GetKeyDown(KeyCode.JoystickButton0)` |Use [`wasPressedThisFrame`](xref:UnityEngine.InputSystem.Controls.ButtonControl.wasPressedThisFrame) on the corresponding Gamepad button. Example: `InputSystem.GamePad.current.buttonNorth.WasPressedThisFrame`.
+[`Input.GetKeyUp`](xref:UnityEngine.Input.GetKeyUp(System.String)) Example: `Input.GetKeyUp(KeyCode.JoystickButton0)` |Use [`wasReleasedThisFrame`](xref:UnityEngine.InputSystem.Controls.ButtonControl.wasReleasedThisFrame) on the corresponding Gamepad button. Example: `InputSystem.GamePad.current.buttonNorth.wasReleasedThisFrame`.
+[`Input.GetJoystickNames`](xref:UnityEngine.Input.GetJoystickNames)|There is no API that corresponds to this exactly, but there are examples of [how to read all connected devices here](Gamepad.html#discover-all-connected-devices).
+[`Input.IsJoystickPreconfigured`](xref:UnityEngine.Input.IsJoystickPreconfigured(System.String))|Not needed. Devices which derive from [`Gamepad`](xref:UnityEngine.InputSystem.Gamepad) always correctly implement the mapping of axes and buttons to the corresponding [`InputControl`](xref:UnityEngine.InputSystem.InputControl) members of the [`Gamepad`](xref:UnityEngine.InputSystem.Gamepad) class. [`Input.ResetInputAxes`](xref:UnityEngine.Input.ResetInputAxes)
### Keyboard
|Input Manager (Old)|Input System (New)|
|--|--|
-[`Input.GetKey`](https://docs.unity3d.com/ScriptReference/Input.GetKey.html) Example: `Input.GetKey(KeyCode.Space)` |Use [`isPressed`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html#UnityEngine_InputSystem_Controls_ButtonControl_isPressed) on the corresponding key. Example: `InputSystem.Keyboard.current.spaceKey.isPressed`
-[`Input.GetKeyDown`](https://docs.unity3d.com/ScriptReference/Input.GetKeyDown.html) Example: `Input.GetKeyDown(KeyCode.Space)` |Use [`wasPressedThisFrame`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html#UnityEngine_InputSystem_Controls_ButtonControl_wasPressedThisFrame) on the corresponding key. Example: `InputSystem.Keyboard.current.spaceKey.wasPressedThisFrame`
-[`Input.GetKeyUp`](https://docs.unity3d.com/ScriptReference/Input.GetKeyUp.html) Example: `Input.GetKeyUp(KeyCode.Space)` |Use [`wasReleasedThisFrame`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html#UnityEngine_InputSystem_Controls_ButtonControl_wasReleasedThisFrame) on the corresponding key. Example: `InputSystem.Keyboard.current.spaceKey.wasReleasedThisFrame`
-[`Input.anyKey`](https://docs.unity3d.com/ScriptReference/Input-anyKey.html)|Use [`onAnyButtonPress`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_onAnyButtonPress). This also includes controller buttons as well as keyboard keys.
-[`Input.anyKeyDown`](https://docs.unity3d.com/ScriptReference/Input-anyKeyDown.html)|Use [`Keyboard.current.anyKey.wasUpdatedThisFrame`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_anyKey)
-[`Input.compositionCursorPos`](https://docs.unity3d.com/ScriptReference/Input-compositionCursorPos.html)|Use [`Keyboard.current.SetIMECursorPosition(myPosition)`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_SetIMECursorPosition_UnityEngine_Vector2_)
-[`Input.compositionString`](https://docs.unity3d.com/ScriptReference/Input-compositionString.html)|Subscribe to the [`Keyboard.onIMECompositionChange`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_onIMECompositionChange).
-[`Input.imeCompositionMode`](https://docs.unity3d.com/ScriptReference/Input-imeCompositionMode.html)|Use: [`Keyboard.current.SetIMEEnabled(true)`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_SetIMEEnabled_System_Boolean_) Also see: [Keyboard text input documentation](Keyboard.html#ime).
-[`Input.imeIsSelected`](https://docs.unity3d.com/ScriptReference/Input-imeIsSelected.html)|Use: [`Keyboard.current.imeSelected`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_imeSelected)
-[`Input.inputString`](https://docs.unity3d.com/ScriptReference/Input-inputString.html)|Subscribe to the [`Keyboard.onTextInput`](../api/UnityEngine.InputSystem.Keyboard.html#UnityEngine_InputSystem_Keyboard_onTextInput) event: `Keyboard.current.onTextInput += character => /* ... */;`
+[`Input.GetKey`](xref:UnityEngine.Input.GetKey(System.String)) Example: `Input.GetKey(KeyCode.Space)` |Use [`isPressed`](xref:UnityEngine.InputSystem.Controls.ButtonControl.isPressed) on the corresponding key. Example: `InputSystem.Keyboard.current.spaceKey.isPressed`
+[`Input.GetKeyDown`](xref:UnityEngine.Input.GetKeyDown(System.String)) Example: `Input.GetKeyDown(KeyCode.Space)` |Use [`wasPressedThisFrame`](xref:UnityEngine.InputSystem.Controls.ButtonControl.wasPressedThisFrame) on the corresponding key. Example: `InputSystem.Keyboard.current.spaceKey.wasPressedThisFrame`
+[`Input.GetKeyUp`](xref:UnityEngine.Input.GetKeyUp(System.String)) Example: `Input.GetKeyUp(KeyCode.Space)` |Use [`wasReleasedThisFrame`](xref:UnityEngine.InputSystem.Controls.ButtonControl.wasReleasedThisFrame) on the corresponding key. Example: `InputSystem.Keyboard.current.spaceKey.wasReleasedThisFrame`
+[`Input.anyKey`](xref:UnityEngine.Input.anyKey)|Use [`onAnyButtonPress`](xref:UnityEngine.InputSystem.InputSystem.onAnyButtonPress). This also includes controller buttons as well as keyboard keys.
+[`Input.anyKeyDown`](xref:UnityEngine.Input.anyKeyDown)|Use [`Keyboard.current.anyKey.wasUpdatedThisFrame`](xref:UnityEngine.InputSystem.Keyboard.anyKey)
+[`Input.compositionCursorPos`](xref:UnityEngine.Input.compositionCursorPos)|Use [`Keyboard.current.SetIMECursorPosition(myPosition)`](xref:UnityEngine.InputSystem.Keyboard.SetIMECursorPosition(UnityEngine.Vector2))
+[`Input.compositionString`](xref:UnityEngine.Input.compositionString)|Subscribe to the [`Keyboard.onIMECompositionChange`](xref:UnityEngine.InputSystem.Keyboard.onIMECompositionChange).
+[`Input.imeCompositionMode`](xref:UnityEngine.Input.imeCompositionMode)|Use: [`Keyboard.current.SetIMEEnabled(true)`](xref:UnityEngine.InputSystem.Keyboard.SetIMEEnabled(System.Boolean)) Also see: [Keyboard text input documentation](Keyboard.html#ime).
+[`Input.imeIsSelected`](xref:UnityEngine.Input.imeIsSelected)|Use: [`Keyboard.current.imeSelected`](xref:UnityEngine.InputSystem.Keyboard.imeSelected)
+[`Input.inputString`](xref:UnityEngine.Input.inputString)|Subscribe to the [`Keyboard.onTextInput`](xref:UnityEngine.InputSystem.Keyboard.onTextInput) event: `Keyboard.current.onTextInput += character => /* ... */;`
### Mouse
+
|Input Manager (Old)|Input System (New)|
|--|--|
-[`Input.GetMouseButton`](https://docs.unity3d.com/ScriptReference/Input.GetMouseButton.html) Example: `Input.GetMouseButton(0)`|Use [`isPressed`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html#UnityEngine_InputSystem_Controls_ButtonControl_isPressed) on the corresponding mouse button. Example: `InputSystem.Mouse.current.leftButton.isPressed`
-[`Input.GetMouseButtonDown`](https://docs.unity3d.com/ScriptReference/Input.GetMouseButtonDown.html) Example: `Input.GetMouseButtonDown(0)`|Use [`wasPressedThisFrame`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html#UnityEngine_InputSystem_Controls_ButtonControl_wasPressedThisFrame) on the corresponding mouse button. Example: `InputSystem.Mouse.current.leftButton.wasPressedThisFrame`
-[`Input.GetMouseButtonUp`](https://docs.unity3d.com/ScriptReference/Input.GetMouseButtonUp.html) Example: `Input.GetMouseButtonUp(0)`|Use [`wasReleasedThisFrame`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html#UnityEngine_InputSystem_Controls_ButtonControl_wasReleasedThisFrame) on the corresponding mouse button. Example: `InputSystem.Mouse.current.leftButton.wasReleasedThisFrame`
-[`Input.mousePosition`](https://docs.unity3d.com/ScriptReference/Input-mousePosition.html)|Use [`Mouse.current.position.ReadValue()`](../api/UnityEngine.InputSystem.Mouse.html) Example: `Vector2 position = Mouse.current.position.ReadValue();` __Note__: Mouse simulation from touch isn't implemented yet.
-[`Input.mousePresent`](https://docs.unity3d.com/ScriptReference/Input-mousePresent.html)|No corresponding API yet.
+[`Input.GetMouseButton`](xref:UnityEngine.Input.GetMouseButton(System.Int32)) Example: `Input.GetMouseButton(0)`|Use [`isPressed`](xref:UnityEngine.InputSystem.Controls.ButtonControl.isPressed) on the corresponding mouse button. Example: `InputSystem.Mouse.current.leftButton.isPressed`
+[`Input.GetMouseButtonDown`](xref:UnityEngine.Input.GetMouseButtonDown(System.Int32)) Example: `Input.GetMouseButtonDown(0)`|Use [`wasPressedThisFrame`](xref:UnityEngine.InputSystem.Controls.ButtonControl.wasPressedThisFrame) on the corresponding mouse button. Example: `InputSystem.Mouse.current.leftButton.wasPressedThisFrame`
+[`Input.GetMouseButtonUp`](xref:UnityEngine.Input.GetMouseButtonUp(System.Int32)) Example: `Input.GetMouseButtonUp(0)`|Use [`wasReleasedThisFrame`](xref:UnityEngine.InputSystem.Controls.ButtonControl.wasReleasedThisFrame) on the corresponding mouse button. Example: `InputSystem.Mouse.current.leftButton.wasReleasedThisFrame`
+[`Input.mousePosition`](xref:UnityEngine.Input.mousePosition)|Use [`Mouse.current.position.ReadValue()`](xref:UnityEngine.InputSystem.Mouse) Example: `Vector2 position = Mouse.current.position.ReadValue();` __Note__: Mouse simulation from touch isn't implemented yet.
+[`Input.mousePresent`](xref:UnityEngine.Input.mousePresent)|No corresponding API yet.
### Touch and Pen
|Input Manager (Old)|Input System (New)|
|--|--|
-[`Input.GetTouch`](https://docs.unity3d.com/ScriptReference/Input.GetTouch.html) For example: `Touch touch = Input.GetTouch(0);` `Vector2 touchPos = touch.position;`|Use [`EnhancedTouch.Touch.activeTouches[i]`](../api/UnityEngine.InputSystem.EnhancedTouch.Touch.html#UnityEngine_InputSystem_EnhancedTouch_Touch_activeTouches) Example: `Vector2 touchPos = EnhancedTouch.Touch.activeTouches[0].position;` __Note__: Enable enhanced touch support first by calling [`EnhancedTouch.Enable()`](../api/UnityEngine.InputSystem.EnhancedTouch.EnhancedTouchSupport.html#UnityEngine_InputSystem_EnhancedTouch_EnhancedTouchSupport_Enable).
-[`Input.multiTouchEnabled`](https://docs.unity3d.com/ScriptReference/Input-multiTouchEnabled.html)|No corresponding API yet.
-[`Input.simulateMouseWithTouches`](https://docs.unity3d.com/ScriptReference/Input-multiTouchEnabled.html)|No corresponding API yet.
-[`Input.stylusTouchSupported`](https://docs.unity3d.com/ScriptReference/Input-stylusTouchSupported.html)|No corresponding API yet.
-[`Input.touchCount`](https://docs.unity3d.com/ScriptReference/Input-touchCount.html)|[`EnhancedTouch.Touch.activeTouches.Count`](../api/UnityEngine.InputSystem.EnhancedTouch.Touch.html#UnityEngine_InputSystem_EnhancedTouch_Touch_activeTouches) __Note__: Enable enhanced touch support first by calling [`EnhancedTouchSupport.Enable()`](../api/UnityEngine.InputSystem.EnhancedTouch.EnhancedTouchSupport.html#UnityEngine_InputSystem_EnhancedTouch_EnhancedTouchSupport_Enable)
-[`Input.touches`](https://docs.unity3d.com/ScriptReference/Input-touches.html)|[`EnhancedTouch.Touch.activeTouches`](../api/UnityEngine.InputSystem.EnhancedTouch.Touch.html#UnityEngine_InputSystem_EnhancedTouch_Touch_activeTouches) __Note__: Enable enhanced touch support first by calling [`EnhancedTouch.Enable()`](../api/UnityEngine.InputSystem.EnhancedTouch.EnhancedTouchSupport.html#UnityEngine_InputSystem_EnhancedTouch_EnhancedTouchSupport_Enable)
-[`Input.touchPressureSupported`](https://docs.unity3d.com/ScriptReference/Input-touchPressureSupported.html)|No corresponding API yet.
-[`Input.touchSupported`](https://docs.unity3d.com/ScriptReference/Input-touchSupported.html)|[`Touchscreen.current != null`](../api/UnityEngine.InputSystem.Touchscreen.html#UnityEngine_InputSystem_Touchscreen_current)
-[`Input.backButtonLeavesApp`](https://docs.unity3d.com/ScriptReference/Input-backButtonLeavesApp.html)|No corresponding API yet.
-[`GetPenEvent`](https://docs.unity3d.com/ScriptReference/Input.GetPenEvent.html) [`GetLastPenContactEvent`](https://docs.unity3d.com/ScriptReference/Input.GetLastPenContactEvent.html) [`ResetPenEvents`](https://docs.unity3d.com/ScriptReference/Input.ResetPenEvents.html) [`ClearLastPenContactEvent`](https://docs.unity3d.com/ScriptReference/Input.ClearLastPenContactEvent.html)|Use: [`Pen.current`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_current) See the [Pen, tablet and stylus support](Pen.md) docs for more information.
+[`Input.GetTouch`](xref:UnityEngine.Input.GetTouch(System.Int32)) For example: `Touch touch = Input.GetTouch(0);` `Vector2 touchPos = touch.position;`|Use [`EnhancedTouch.Touch.activeTouches[i]`](xref:UnityEngine.InputSystem.EnhancedTouch.Touch.activeTouches) Example: `Vector2 touchPos = EnhancedTouch.Touch.activeTouches[0].position;` __Note__: Enable enhanced touch support first by calling [`EnhancedTouch.Enable()`](xref:UnityEngine.InputSystem.EnhancedTouch.EnhancedTouchSupport.Enable).
+[`Input.multiTouchEnabled`](xref:UnityEngine.Input.multiTouchEnabled)|No corresponding API yet.
+[`Input.simulateMouseWithTouches`](xref:UnityEngine.Input.multiTouchEnabled)|No corresponding API yet.
+[`Input.stylusTouchSupported`](xref:UnityEngine.Input.stylusTouchSupported)|No corresponding API yet.
+[`Input.touchCount`](xref:UnityEngine.Input.touchCount)|[`EnhancedTouch.Touch.activeTouches.Count`](xref:UnityEngine.InputSystem.EnhancedTouch.Touch.activeTouches) __Note__: Enable enhanced touch support first by calling [`EnhancedTouchSupport.Enable()`](xref:UnityEngine.InputSystem.EnhancedTouch.EnhancedTouchSupport.Enable)
+[`Input.touches`](xref:UnityEngine.Input.touches)|[`EnhancedTouch.Touch.activeTouches`](xref:UnityEngine.InputSystem.EnhancedTouch.Touch.activeTouches) __Note__: Enable enhanced touch support first by calling [`EnhancedTouch.Enable()`](xref:UnityEngine.InputSystem.EnhancedTouch.EnhancedTouchSupport.Enable)
+[`Input.touchPressureSupported`](xref:UnityEngine.Input.touchPressureSupported)|No corresponding API yet.
+[`Input.touchSupported`](xref:UnityEngine.Input.touchSupported)|[`Touchscreen.current != null`](xref:UnityEngine.InputSystem.Touchscreen.current)
+[`Input.backButtonLeavesApp`](xref:UnityEngine.Input.backButtonLeavesApp)|No corresponding API yet.
+[`GetPenEvent`](xref:UnityEngine.Input.GetPenEvent(System.Int32)) [`GetLastPenContactEvent`](xref:UnityEngine.Input.GetLastPenContactEvent) [`ResetPenEvents`](xref:UnityEngine.Input.ResetPenEvents) [`ClearLastPenContactEvent`](xref:UnityEngine.Input.ClearLastPenContactEvent)|Use: [`Pen.current`](xref:UnityEngine.InputSystem.Pen.current) See the [Pen, tablet and stylus support](xref:input-system-pen) docs for more information.
-Note: [`UnityEngine.TouchScreenKeyboard`](https://docs.unity3d.com/ScriptReference/TouchScreenKeyboard.html) is not part of the old Input Manager API, so you can continue to use it when migrating to the new Input System package.
+> [!NOTE]
+> [`UnityEngine.TouchScreenKeyboard`](xref:UnityEngine.TouchScreenKeyboard) is not part of the old Input Manager API, so you can continue to use it when migrating to the new Input System package.
### Sensors
|Input Manager (Old)|Input System (New)|
|--|--|
-[`Input.acceleration`](https://docs.unity3d.com/ScriptReference/Input-acceleration.html)|[`Accelerometer.current.acceleration.ReadValue()`](../api/UnityEngine.InputSystem.Accelerometer.html).
-[`Input.accelerationEventCount`](https://docs.unity3d.com/ScriptReference/Input-accelerationEventCount.html) [`Input.accelerationEvents`](https://docs.unity3d.com/ScriptReference/Input-accelerationEvents.html)|Acceleration events aren't made available separately from other input events. See the [accelerometer code sample on the Sensors page](Sensors.html#accelerometer).
-[`Input.compass`](https://docs.unity3d.com/ScriptReference/Input-compass.html)|No corresponding API yet.
-[`Input.compensateSensors`](https://docs.unity3d.com/ScriptReference/Input-compensateSensors.html)|[`InputSettings.compensateForScreenOrientation`](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_compensateForScreenOrientation).
-[`Input.deviceOrientation`](https://docs.unity3d.com/ScriptReference/Input-deviceOrientation.html)|No corresponding API yet.
-[`Input.gyro`](https://docs.unity3d.com/ScriptReference/Input-gyro.html)|The `UnityEngine.Gyroscope` class is replaced by multiple separate sensor Devices in the new Input System: [`Gyroscope`](../api/UnityEngine.InputSystem.Gyroscope.html) to measure angular velocity. [`GravitySensor`](../api/UnityEngine.InputSystem.GravitySensor.html) to measure the direction of gravity. [`AttitudeSensor`](../api/UnityEngine.InputSystem.AttitudeSensor.html) to measure the orientation of the device. [`Accelerometer`](../api/UnityEngine.InputSystem.Accelerometer.html) to measure the total acceleration applied to the device. [`LinearAccelerationSensor`](../api/UnityEngine.InputSystem.LinearAccelerationSensor.html) to measure acceleration applied to the device, compensating for gravity.
-[`Input.gyro.attitude`](https://docs.unity3d.com/ScriptReference/Gyroscope-attitude.html)|[`AttitudeSensor.current.orientation.ReadValue()`](../api/UnityEngine.InputSystem.AttitudeSensor.html).
-[`Input.gyro.enabled`](https://docs.unity3d.com/ScriptReference/Gyroscope-enabled.html)|Get: `Gyroscope.current.enabled` Set: `EnableDevice(Gyroscope.current);` `DisableDevice(Gyroscope.current);` __Note__: The new Input System replaces `UnityEngine.Gyroscope` with multiple separate sensor devices. Substitute [`Gyroscope`](../api/UnityEngine.InputSystem.Gyroscope.html) with other sensors in the sample as needed. See the notes for `Input.gyro` above for details.
-[`Input.gyro.gravity`](https://docs.unity3d.com/ScriptReference/Gyroscope-gravity.html)|[`GravitySensor.current.gravity.ReadValue()`](../api/UnityEngine.InputSystem.GravitySensor.html)
-[`Input.gyro.rotationRate`](https://docs.unity3d.com/ScriptReference/Gyroscope-rotationRate.html)|[`Gyroscope.current.angularVelocity.ReadValue()`](../api/UnityEngine.InputSystem.Gyroscope.html).
-[`Input.gyro.rotationRateUnbiased`](https://docs.unity3d.com/ScriptReference/Gyroscope-rotationRateUnbiased.html)|No corresponding API yet.
-[`Input.gyro.updateInterval`](https://docs.unity3d.com/ScriptReference/Gyroscope-updateInterval.html)|[`Sensor.samplingFrequency`](../api/UnityEngine.InputSystem.Sensor.html#UnityEngine_InputSystem_Sensor_samplingFrequency) Example: `Gyroscope.current.samplingFrequency = 1.0f / updateInterval;` __Notes__: [`samplingFrequency`](../api/UnityEngine.InputSystem.Sensor.html#UnityEngine_InputSystem_Sensor_samplingFrequency) is in Hz, not in seconds as [`updateInterval`](https://docs.unity3d.com/ScriptReference/Gyroscope-updateInterval.html), so you need to divide 1 by the value. The new Input System replaces `UnityEngine.Gyroscope` with multiple separate sensor devices. Substitute [`Gyroscope`](../api/UnityEngine.InputSystem.Gyroscope.html) with other sensors in the sample as needed. See the notes for `Input.gyro` above for details.
-[`Input.gyro.userAcceleration`](https://docs.unity3d.com/ScriptReference/Gyroscope-userAcceleration.html)|[`LinearAccelerationSensor.current.acceleration.ReadValue()`](../api/UnityEngine.InputSystem.LinearAccelerationSensor.html)
-[`Input.location`](https://docs.unity3d.com/ScriptReference/Input-location.html)|No corresponding API yet.
-[`Input.GetAccelerationEvent`](https://docs.unity3d.com/ScriptReference/Input.GetAccelerationEvent.html)|See notes for `Input.accelerationEvents` above.
+[`Input.acceleration`](xref:UnityEngine.Input.acceleration)|[`Accelerometer.current.acceleration.ReadValue()`](xref:UnityEngine.InputSystem.Accelerometer).
+[`Input.accelerationEventCount`](xref:UnityEngine.Input.accelerationEventCount) [`Input.accelerationEvents`](xref:UnityEngine.Input.accelerationEvents)|Acceleration events aren't made available separately from other input events. See the [accelerometer code sample on the Sensors page](Sensors.html#accelerometer).
+[`Input.compass`](xref:UnityEngine.Input.compass)|No corresponding API yet.
+[`Input.compensateSensors`](xref:UnityEngine.Input.compensateSensors)|[`InputSettings.compensateForScreenOrientation`](xref:UnityEngine.InputSystem.InputSettings.compensateForScreenOrientation).
+[`Input.deviceOrientation`](xref:UnityEngine.Input.deviceOrientation)|No corresponding API yet.
+[`Input.gyro`](xref:UnityEngine.Input.gyro)|The `UnityEngine.Gyroscope` class is replaced by multiple separate sensor Devices in the new Input System: [`Gyroscope`](xref:UnityEngine.InputSystem.Gyroscope) to measure angular velocity. [`GravitySensor`](xref:UnityEngine.InputSystem.GravitySensor) to measure the direction of gravity. [`AttitudeSensor`](xref:UnityEngine.InputSystem.AttitudeSensor) to measure the orientation of the device. [`Accelerometer`](xref:UnityEngine.InputSystem.Accelerometer) to measure the total acceleration applied to the device. [`LinearAccelerationSensor`](xref:UnityEngine.InputSystem.LinearAccelerationSensor) to measure acceleration applied to the device, compensating for gravity.
+[`Input.gyro.attitude`](xref:UnityEngine.Gyroscope.attitude)|[`AttitudeSensor.current.orientation.ReadValue()`](xref:UnityEngine.InputSystem.AttitudeSensor).
+[`Input.gyro.enabled`](xref:UnityEngine.Gyroscope.enabled)|Get: `Gyroscope.current.enabled` Set: `EnableDevice(Gyroscope.current);` `DisableDevice(Gyroscope.current);` __Note__: The new Input System replaces `UnityEngine.Gyroscope` with multiple separate sensor devices. Substitute [`Gyroscope`](xref:UnityEngine.InputSystem.Gyroscope) with other sensors in the sample as needed. See the notes for `Input.gyro` above for details.
+[`Input.gyro.gravity`](xref:UnityEngine.Gyroscope.gravity)|[`GravitySensor.current.gravity.ReadValue()`](xref:UnityEngine.InputSystem.GravitySensor)
+[`Input.gyro.rotationRate`](xref:UnityEngine.Gyroscope.rotationRate)|[`Gyroscope.current.angularVelocity.ReadValue()`](xref:UnityEngine.InputSystem.Gyroscope).
+[`Input.gyro.rotationRateUnbiased`](xref:UnityEngine.Gyroscope.rotationRateUnbiased)|No corresponding API yet.
+[`Input.gyro.updateInterval`](xref:UnityEngine.Gyroscope.updateInterval)|[`Sensor.samplingFrequency`](xref:UnityEngine.InputSystem.Sensor.samplingFrequency) Example: `Gyroscope.current.samplingFrequency = 1.0f / updateInterval;` __Notes__: [`samplingFrequency`](xref:UnityEngine.InputSystem.Sensor.samplingFrequency) is in Hz, not in seconds as [`updateInterval`](xref:UnityEngine.Gyroscope.updateInterval), so you need to divide 1 by the value. The new Input System replaces `UnityEngine.Gyroscope` with multiple separate sensor devices. Substitute [`Gyroscope`](xref:UnityEngine.InputSystem.Gyroscope) with other sensors in the sample as needed. See the notes for `Input.gyro` above for details.
+[`Input.gyro.userAcceleration`](xref:UnityEngine.Gyroscope.userAcceleration)|[`LinearAccelerationSensor.current.acceleration.ReadValue()`](xref:UnityEngine.InputSystem.LinearAccelerationSensor)
+[`Input.location`](xref:UnityEngine.Input.location)|No corresponding API yet.
+[`Input.GetAccelerationEvent`](xref:UnityEngine.Input.GetAccelerationEvent(System.Int32))|See notes for `Input.accelerationEvents` above.
diff --git a/Packages/com.unity.inputsystem/Documentation~/Mouse.md b/Packages/com.unity.inputsystem/Documentation~/Mouse.md
index dbcb1122a0..d8dd06624b 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Mouse.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Mouse.md
@@ -3,40 +3,42 @@ uid: input-system-mouse
---
# Mouse support
-The Input System represents mouse input with the [`Mouse`](../api/UnityEngine.InputSystem.Mouse.html) Device layout that the [`Mouse`](../api/UnityEngine.InputSystem.Mouse.html) class implements. Mice are based on the [`Pointer`](Pointers.md) layout.
+The Input System represents mouse input with the [`Mouse`](xref:UnityEngine.InputSystem.Mouse) Device layout that the [`Mouse`](xref:UnityEngine.InputSystem.Mouse) class implements. Mice are based on the [`Pointer`](xref:input-system-pointers) layout.
-To query the last used or last added mouse, use [`Mouse.current`](../api/UnityEngine.InputSystem.Mouse.html#UnityEngine_InputSystem_Mouse_current).
+To query the last used or last added mouse, use [`Mouse.current`](xref:UnityEngine.InputSystem.Mouse.current).
```
var mouse = Mouse.current;
```
->__Note__: The Input System does not currently support:
+> [!NOTE]
+> The Input System does not currently support:
>* Input from multiple mice at the platform level.
>* Identifying the current display a mouse is on.
## Controls
-In addition to the [Controls inherited from `Pointer`](Pointers.md#controls), Mouse devices implement the following Controls:
+In addition to the [Controls inherited from `Pointer`](xref:input-system-pointers#controls), Mouse devices implement the following Controls:
|Control|Type|Description|
|-------|----|-----------|
-|[`leftButton`](../api/UnityEngine.InputSystem.Mouse.html#UnityEngine_InputSystem_Mouse_leftButton)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|The left mouse button. Same as the inherited [`Pointer.press`](../api/UnityEngine.InputSystem.Pointer.html#UnityEngine_InputSystem_Pointer_press).|
-|[`rightButton`](../api/UnityEngine.InputSystem.Mouse.html#UnityEngine_InputSystem_Mouse_rightButton)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|The right mouse button.|
-|[`middleButton`](../api/UnityEngine.InputSystem.Mouse.html#UnityEngine_InputSystem_Mouse_middleButton)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|The middle mouse button.|
-|[`forwardButton`](../api/UnityEngine.InputSystem.Mouse.html#UnityEngine_InputSystem_Mouse_forwardButton)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|Used for other mouse buttons where applicable.|
-|[`backButton`](../api/UnityEngine.InputSystem.Mouse.html#UnityEngine_InputSystem_Mouse_backButton)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|Used for other mouse buttons where applicable.|
-|[`clickCount`](../api/UnityEngine.InputSystem.Mouse.html#UnityEngine_InputSystem_Mouse_clickCount)|[`IntegerControl`](../api/UnityEngine.InputSystem.Controls.IntegerControl.html)|A Control which lets you read the number of consecutive clicks the last mouse click belonged to, as reported by the OS. Use this to distinguish double- or multi-clicks.|
-|[`scroll`](../api/UnityEngine.InputSystem.Mouse.html#UnityEngine_InputSystem_Mouse_scroll)|[`Vector2Control`](../api/UnityEngine.InputSystem.Controls.Vector2Control.html)|The input from the mouse scrolling control expressed as a delta in pixels since the last frame. Can come from a physical scroll wheel, or from touchpad gestures.|
+|[`leftButton`](xref:UnityEngine.InputSystem.Mouse.leftButton)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|The left mouse button. Same as the inherited [`Pointer.press`](xref:UnityEngine.InputSystem.Pointer.press).|
+|[`rightButton`](xref:UnityEngine.InputSystem.Mouse.rightButton)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|The right mouse button.|
+|[`middleButton`](xref:UnityEngine.InputSystem.Mouse.middleButton)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|The middle mouse button.|
+|[`forwardButton`](xref:UnityEngine.InputSystem.Mouse.forwardButton)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|Used for other mouse buttons where applicable.|
+|[`backButton`](xref:UnityEngine.InputSystem.Mouse.backButton)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|Used for other mouse buttons where applicable.|
+|[`clickCount`](xref:UnityEngine.InputSystem.Mouse.clickCount)|[`IntegerControl`](xref:UnityEngine.InputSystem.Controls.IntegerControl)|A Control which lets you read the number of consecutive clicks the last mouse click belonged to, as reported by the OS. Use this to distinguish double- or multi-clicks.|
+|[`scroll`](xref:UnityEngine.InputSystem.Mouse.scroll)|[`Vector2Control`](xref:UnityEngine.InputSystem.Controls.Vector2Control)|The input from the mouse scrolling control expressed as a delta in pixels since the last frame. Can come from a physical scroll wheel, or from touchpad gestures.|
## Cursor warping
-On desktop platforms (Windows, Mac, Linux, and UWP), you can move the mouse cursor via code. Note that this moves the system's actual mouse cursor, not just Unity's internally-stored mouse position. This means that the user sees the cursor jumping to a different position, which is generally considered to be bad UX practice. It's advisable to only do this if the cursor is hidden (see the [`Cursor` API documentation](https://docs.unity3d.com/ScriptReference/Cursor.html) for more information).
+On desktop platforms (Windows, Mac, Linux, and UWP), you can move the mouse cursor via code. Note that this moves the system's actual mouse cursor, not just Unity's internally-stored mouse position. This means that the user sees the cursor jumping to a different position, which is generally considered to be bad UX practice. It's advisable to only do this if the cursor is hidden (see the [`Cursor` API documentation](xref:UnityEngine.Cursor) for more information).
-To move the cursor to a different position, use [`Mouse.WarpCursorPosition`](../api/UnityEngine.InputSystem.Mouse.html#UnityEngine_InputSystem_Mouse_WarpCursorPosition_UnityEngine_Vector2_). The coordinates are expressed as Unity screen coordinates, just like [`Mouse.position`](../api/UnityEngine.InputSystem.Pointer.html#UnityEngine_InputSystem_Pointer_position).
+To move the cursor to a different position, use [`Mouse.WarpCursorPosition`](xref:UnityEngine.InputSystem.Mouse.WarpCursorPosition(UnityEngine.Vector2)). The coordinates are expressed as Unity screen coordinates, just like [`Mouse.position`](xref:UnityEngine.InputSystem.Pointer.position).
```
Mouse.current.WarpCursorPosition(new Vector2(123, 234));
```
->__Note__: If the cursor is locked, warping the mouse position is only temporary and Unity resets the cursor to the center of the window every frame.
+> [!NOTE]
+> If the cursor is locked, warping the mouse position is only temporary and Unity resets the cursor to the center of the window every frame.
diff --git a/Packages/com.unity.inputsystem/Documentation~/OnScreen.md b/Packages/com.unity.inputsystem/Documentation~/OnScreen.md
index 871196650b..5b448e6d66 100644
--- a/Packages/com.unity.inputsystem/Documentation~/OnScreen.md
+++ b/Packages/com.unity.inputsystem/Documentation~/OnScreen.md
@@ -5,43 +5,45 @@ uid: input-system-on-screen
You can use on-screen Controls to simulate Input Devices with UI widgets that the user interacts with on the screen. The most prominent example is the use of stick and button widgets on touchscreens to emulate a joystick or gamepad.
-There are currently two Control types implemented out of the box: [buttons](#on-screen-buttons) and [sticks](#on-screen-sticks). You can implement custom Controls by extending the base [`OnScreenControl`](../api/UnityEngine.InputSystem.OnScreen.OnScreenControl.html) class (see documentation on [writing custom on screen Controls](#writing-custom-on-screen-controls) to learn more).
+There are currently two Control types implemented out of the box: [buttons](#on-screen-buttons) and [sticks](#on-screen-sticks). You can implement custom Controls by extending the base [`OnScreenControl`](xref:UnityEngine.InputSystem.OnScreen.OnScreenControl) class (see documentation on [writing custom on screen Controls](#writing-custom-on-screen-controls) to learn more).
->__Note__: On-screen Controls don't have a predefined visual representation. It's up to you to set up the visual aspect of a Control (for example, by adding a sprite or UI component to the GameObject). On-screen Controls take care of the interaction logic and of setting up and generating input from interactions.
+> [!NOTE]
+> On-screen Controls don't have a predefined visual representation. It's up to you to set up the visual aspect of a Control (for example, by adding a sprite or UI component to the GameObject). On-screen Controls take care of the interaction logic and of setting up and generating input from interactions.
-Each on-screen Control uses a [Control path](Controls.md#control-paths) to reference the Control that it should report input as. For example, the following on-screen button reports input as the right shoulder button of a gamepad:
+Each on-screen Control uses a [Control path](xref:input-system-controls#control-paths) to reference the Control that it should report input as. For example, the following on-screen button reports input as the right shoulder button of a gamepad:
-
+![The OnScreenButton component displays the Control Path value as rightShoulder [Gamepad].](Images/OnScreenButton.png){width="486" height="81"}
-The collection of on-screen Controls present in a Scene forms one or more [Input Devices](Devices.md). The Input System creates one Input Device for each distinct type of Device the Controls reference. For example, if one on-screen button references `/buttonSouth` and another on-screen button references `/a`, the Input System creates both a `Gamepad` and a `Keyboard`. This happens automatically when the components are enabled. When disabled, the Input System automatically removes the Devices again.
+The collection of on-screen Controls present in a Scene forms one or more [Input Devices](xref:input-system-devices). The Input System creates one Input Device for each distinct type of Device the Controls reference. For example, if one on-screen button references `/buttonSouth` and another on-screen button references `/a`, the Input System creates both a `Gamepad` and a `Keyboard`. This happens automatically when the components are enabled. When disabled, the Input System automatically removes the Devices again.
-To query the Control (and, implicitly, the Device) that an on-screen Control feeds into, you can use the [`OnScreenControl.control`](../api/UnityEngine.InputSystem.OnScreen.OnScreenControl.html#UnityEngine_InputSystem_OnScreen_OnScreenControl_control) property.
+To query the Control (and, implicitly, the Device) that an on-screen Control feeds into, you can use the [`OnScreenControl.control`](xref:UnityEngine.InputSystem.OnScreen.OnScreenControl.control) property.
->__Note__: This design allows you to use on-screen Controls to create input for arbitrary Input Devices, in addition to joysticks and gamepads.
+> [!NOTE]
+> This design allows you to use on-screen Controls to create input for arbitrary Input Devices, in addition to joysticks and gamepads.
## On-screen buttons
To create an on-screen button:
1. Add a UI `Button` object.
-2. Add the [`OnScreenButton`](../api/UnityEngine.InputSystem.OnScreen.OnScreenButton.html) component to it.
-3. Set the [`Control Path`](../api/UnityEngine.InputSystem.OnScreen.OnScreenControl.html#UnityEngine_InputSystem_OnScreen_OnScreenControl_controlPath) to refer to a [`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html) (for example, `/buttonSouth`). The type of device referenced by the control path determines the type of virtual device created by the component.
+2. Add the [`OnScreenButton`](xref:UnityEngine.InputSystem.OnScreen.OnScreenButton) component to it.
+3. Set the [`Control Path`](xref:UnityEngine.InputSystem.OnScreen.OnScreenControl.controlPath) to refer to a [`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl) (for example, `/buttonSouth`). The type of device referenced by the control path determines the type of virtual device created by the component.
-
+ ![The OnScreenButton component displays the Control Path value as rightShoulder [Gamepad].](Images/OnScreenButton.png){width="486" height="81"}
-The [`OnScreenButton`](../api/UnityEngine.InputSystem.OnScreen.OnScreenButton.html) component requires the target Control to be a `Button` Control. [`OnScreenButton`](../api/UnityEngine.InputSystem.OnScreen.OnScreenButton.html) sets the target Control value to 1 when it receives a pointer-down (`IPointerDownHandler.OnPointerDown`) event, or 0 when it receives a pointer-up (`IPointerUpHandler.OnPointerUp`) event.
+The [`OnScreenButton`](xref:UnityEngine.InputSystem.OnScreen.OnScreenButton) component requires the target Control to be a `Button` Control. [`OnScreenButton`](xref:UnityEngine.InputSystem.OnScreen.OnScreenButton) sets the target Control value to 1 when it receives a pointer-down (`IPointerDownHandler.OnPointerDown`) event, or 0 when it receives a pointer-up (`IPointerUpHandler.OnPointerUp`) event.
## On-screen sticks
To create an on-screen stick:
1. Create a UI `Image` object.
-2. Add the [`OnScreenStick`](../api/UnityEngine.InputSystem.OnScreen.OnScreenStick.html) component to it.
-3. Set the [`Control Path`](../api/UnityEngine.InputSystem.OnScreen.OnScreenControl.html#UnityEngine_InputSystem_OnScreen_OnScreenControl_controlPath) to refer to a [`Vector2Control`](../api/UnityEngine.InputSystem.Controls.Vector2Control.html) (for example, `/leftStick`). The type of device referenced by the control path determines the type of virtual device created by the component.
+2. Add the [`OnScreenStick`](xref:UnityEngine.InputSystem.OnScreen.OnScreenStick) component to it.
+3. Set the [`Control Path`](xref:UnityEngine.InputSystem.OnScreen.OnScreenControl.controlPath) to refer to a [`Vector2Control`](xref:UnityEngine.InputSystem.Controls.Vector2Control) (for example, `/leftStick`). The type of device referenced by the control path determines the type of virtual device created by the component.
-
+ ![The OnScreenStick component displays 50 as the Movement Range value and leftStick [Gamepad] as the Control Path value.](Images/OnScreenStick.png){width="486" height="106"}
-The [`OnScreenStick`](../api/UnityEngine.InputSystem.OnScreen.OnScreenStick.html) component requires the target Control to be a `Vector2` Control. [`OnScreenStick`](../api/UnityEngine.InputSystem.OnScreen.OnScreenStick.html) starts the movement of the stick Control when it receives a pointer-down (`IPointerDownHandler.OnPointerDown`) event, and stops it when it receives a pointer-up (`IPointerUpHandler.OnPointerUp`) event.
+The [`OnScreenStick`](xref:UnityEngine.InputSystem.OnScreen.OnScreenStick) component requires the target Control to be a `Vector2` Control. [`OnScreenStick`](xref:UnityEngine.InputSystem.OnScreen.OnScreenStick) starts the movement of the stick Control when it receives a pointer-down (`IPointerDownHandler.OnPointerDown`) event, and stops it when it receives a pointer-up (`IPointerUpHandler.OnPointerUp`) event.
In-between, the stick moves according to the pointer being dragged (`IDragHandler.OnDrag`) within a box centered on the pointer-down screen point, and with an edge length defined in the component's __Movement Range__ property. A movement range of 50, for example, means that the stick's on-screen area is 25 pixels up, down, left, and right of the pointer-down point on screen.
@@ -49,7 +51,7 @@ If you want to be notified when the user starts and/or stops touching the on-scr
### Isolated mode
-The [`OnScreenStick`](../api/UnityEngine.InputSystem.OnScreen.OnScreenStick.html) simulates input events from the device specified in the [`OnScreenControl.control`](../api/UnityEngine.InputSystem.OnScreen.OnScreenControl.html#UnityEngine_InputSystem_OnScreen_OnScreenControl_control) property. To the Input System itself, these are normal events and can cause the paired device to change in games and applications where dynamic device switching is used, for example when the [`PlayerInput`](../api/UnityEngine.InputSystem.PlayerInput.html) component is used with the [`PlayerInput.neverAutoSwitchControlSchemes`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_neverAutoSwitchControlSchemes)) propety set to false. As the stick is dragged around, the paired device will alternate between the device that owns the pointer (mouse, touch, pen etc) and the device from the control path, which can result in jittery movement of the on-screen stick.
+The [`OnScreenStick`](xref:UnityEngine.InputSystem.OnScreen.OnScreenStick) simulates input events from the device specified in the [`OnScreenControl.control`](xref:UnityEngine.InputSystem.OnScreen.OnScreenControl.control) property. To the Input System itself, these are normal events and can cause the paired device to change in games and applications where dynamic device switching is used, for example when the [`PlayerInput`](xref:UnityEngine.InputSystem.PlayerInput) component is used with the [`PlayerInput.neverAutoSwitchControlSchemes`](xref:UnityEngine.InputSystem.PlayerInput.neverAutoSwitchControlSchemes)) propety set to false. As the stick is dragged around, the paired device will alternate between the device that owns the pointer (mouse, touch, pen etc) and the device from the control path, which can result in jittery movement of the on-screen stick.
Use Isolated Input Actions to fix this. This mode uses a local set of Input Action instances to drive interaction with the stick, and not the actions defined in the UI. The downside of this mode is that pointer actions will be duplicated in both the on-screen stick component and any Input Action Assets being used to drive the UI. Note that if a set of bindings is not specified for the Pointer Down Action and Pointer Move Actions, the following defaults will be used:
@@ -66,7 +68,7 @@ Use Isolated Input Actions to fix this. This mode uses a local set of Input Acti
## Writing custom on-screen Controls
-You can add support for new types of [Input Controls](Controls.md) by extending [`OnScreenControl`](../api/UnityEngine.InputSystem.OnScreen.OnScreenControl.html). An easy example to follow is [`OnScreenButton`](../api/UnityEngine.InputSystem.OnScreen.OnScreenButton.html).
+You can add support for new types of [Input Controls](xref:input-system-controls) by extending [`OnScreenControl`](xref:UnityEngine.InputSystem.OnScreen.OnScreenControl). An easy example to follow is [`OnScreenButton`](xref:UnityEngine.InputSystem.OnScreen.OnScreenButton).
```CSharp
[AddComponentMenu("Input/On-Screen Button")]
diff --git a/Packages/com.unity.inputsystem/Documentation~/Pen.md b/Packages/com.unity.inputsystem/Documentation~/Pen.md
index 1202906f8c..fe11836a55 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Pen.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Pen.md
@@ -7,43 +7,43 @@ Pen support comprises both tablets on desktops (such as the various tablets prod
Pens generally offer pressure sensitivity, in-range detection (being able to control the cursor while not yet touching the tablet/screen surface), and often the ability to flip the pen for eraser-like behavior.
-Pens are represented by the [`Pen`](../api/UnityEngine.InputSystem.Pen.html) Device layout implemented by the [`Pen`](../api/UnityEngine.InputSystem.Pen.html) class. Pens are based on the [`Pointer`](Pointers.md) layout.
+Pens are represented by the [`Pen`](xref:UnityEngine.InputSystem.Pen) Device layout implemented by the [`Pen`](xref:UnityEngine.InputSystem.Pen) class. Pens are based on the [`Pointer`](xref:input-system-pointers) layout.
-You can query the last used or last added pen with [`Pen.current`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_current).
+You can query the last used or last added pen with [`Pen.current`](xref:UnityEngine.InputSystem.Pen.current).
->__Note__:
->* Pen/tablet support is currently implemented on Windows, UWP, iOS, and Android. macOS is supported in Unity 2020.1+.
->* Some devices support tracking multiple pens independently. Unity's Input System doesn't support this currently.
->* iOS: The double-tap interaction on the side of the Apple Pencil is not surfaced as input at the moment. Also, no in-range detection is supported and [`inRange`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_inRange) will remain at its default value.
+> [!NOTE]
+> * Pen/tablet support is currently implemented on Windows, UWP, iOS, and Android. macOS is supported in Unity 2020.1+.
+> * Some devices support tracking multiple pens independently. Unity's Input System doesn't support this currently.
+> * iOS: The double-tap interaction on the side of the Apple Pencil is not surfaced as input at the moment. Also, no in-range detection is supported and [`inRange`](xref:UnityEngine.InputSystem.Pen.inRange) will remain at its default value.
## Controls
-In addition to the [Controls inherited from `Pointer`](Pointers.md#controls), pen Devices implement the following Controls:
+In addition to the [Controls inherited from `Pointer`](xref:input-system-pointers#controls), pen Devices implement the following Controls:
|Control|Type|Description|
|-------|----|-----------|
-|[`tip`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_tip)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|Whether the tip of the pen touches the surface. Same as the inherited [`Pointer.press`](../api/UnityEngine.InputSystem.Pointer.html#UnityEngine_InputSystem_Pointer_press).|
-|[`eraser`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_eraser)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|Whether the eraser/back end of the pen touches the surface.|
-|[`firstBarrelButton`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_firstBarrelButton)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|Whether the first button on the barrel of the pen is pressed.|
-|[`secondBarrelButton`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_secondBarrelButton)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|Whether the second button on the barrel of the pen is pressed.|
-|[`thirdBarrelButton`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_thirdBarrelButton)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|Whether the third button on the barrel of the pen is pressed.|
-|[`fourthBarrelButton`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_fourthBarrelButton)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|Whether the forth button on the barrel of the pen is pressed.|
-|[`inRange`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_inRange)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|Whether the pen is currently in detection range of the tablet. If unsupported, this control will remain at a value of 1.|
-|[`tilt`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_tilt)|[`Vector2Control`](../api/UnityEngine.InputSystem.Controls.Vector2Control.html)|Tilt of the pen relative to the surface.|
-|[`twist`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_twist)|[`AxisControl`](../api/UnityEngine.InputSystem.Controls.AxisControl.html)|Rotation of the pen around its own axis. Only supported on a limited number of pens, such as the Wacom Art Pen.|
+|[`tip`](xref:UnityEngine.InputSystem.Pen.tip)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|Whether the tip of the pen touches the surface. Same as the inherited [`Pointer.press`](xref:UnityEngine.InputSystem.Pointer.press).|
+|[`eraser`](xref:UnityEngine.InputSystem.Pen.eraser)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|Whether the eraser/back end of the pen touches the surface.|
+|[`firstBarrelButton`](xref:UnityEngine.InputSystem.Pen.firstBarrelButton)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|Whether the first button on the barrel of the pen is pressed.|
+|[`secondBarrelButton`](xref:UnityEngine.InputSystem.Pen.secondBarrelButton)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|Whether the second button on the barrel of the pen is pressed.|
+|[`thirdBarrelButton`](xref:UnityEngine.InputSystem.Pen.thirdBarrelButton)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|Whether the third button on the barrel of the pen is pressed.|
+|[`fourthBarrelButton`](xref:UnityEngine.InputSystem.Pen.fourthBarrelButton)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|Whether the forth button on the barrel of the pen is pressed.|
+|[`inRange`](xref:UnityEngine.InputSystem.Pen.inRange)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|Whether the pen is currently in detection range of the tablet. If unsupported, this control will remain at a value of 1.|
+|[`tilt`](xref:UnityEngine.InputSystem.Pen.tilt)|[`Vector2Control`](xref:UnityEngine.InputSystem.Controls.Vector2Control)|Tilt of the pen relative to the surface.|
+|[`twist`](xref:UnityEngine.InputSystem.Pen.twist)|[`AxisControl`](xref:UnityEngine.InputSystem.Controls.AxisControl)|Rotation of the pen around its own axis. Only supported on a limited number of pens, such as the Wacom Art Pen.|
## Pressure, tilt, and twist
-**Pressure:** You can access the pen's current pressure via [`Pen.pressure`](../api/UnityEngine.InputSystem.Pointer.html#UnityEngine_InputSystem_Pointer_pressure), where 0 means no pressure, and 1 means maximum pressure. However, pressure can go over 1 if the system applies a custom pressure curve where a pressure value of 1 doesn't require pressing the pen down all the way to the maximum force the hardware supports. If a pen doesn't support different pressure levels, the [`pressure`](../api/UnityEngine.InputSystem.Pointer.html#UnityEngine_InputSystem_Pointer_pressure) Control always returns 1.
+**Pressure:** You can access the pen's current pressure via [`Pen.pressure`](xref:UnityEngine.InputSystem.Pointer.pressure), where 0 means no pressure, and 1 means maximum pressure. However, pressure can go over 1 if the system applies a custom pressure curve where a pressure value of 1 doesn't require pressing the pen down all the way to the maximum force the hardware supports. If a pen doesn't support different pressure levels, the [`pressure`](xref:UnityEngine.InputSystem.Pointer.pressure) Control always returns 1.
-**Tilt:** If supported, the [`Pen.tilt`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_tilt) Control represents the angle at which the pen tilts towards the tablet or screen surface. The X and Y axes correspond to the respective screen axes. A value of 1 on either axis means that the pen is fully parallel to the tablet or screen surface on that axis. A value of 0 means that the pen is perpendicular to the tablet or screen surface on that axis. If a pen doesn't support tilt angles, `Pen.tilt` is always `(0,0)`.
+**Tilt:** If supported, the [`Pen.tilt`](xref:UnityEngine.InputSystem.Pen.tilt) Control represents the angle at which the pen tilts towards the tablet or screen surface. The X and Y axes correspond to the respective screen axes. A value of 1 on either axis means that the pen is fully parallel to the tablet or screen surface on that axis. A value of 0 means that the pen is perpendicular to the tablet or screen surface on that axis. If a pen doesn't support tilt angles, `Pen.tilt` is always `(0,0)`.
-**Twist:** Some pens also support twist detection (the pen rotating around its own axis). If supported, [`Pen.twist`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_twist) represents the current rotation, where 0 means that the pen is facing up towards the Y axis, and values close to 1 mean that the pen is fully rotated clockwise around its own axis.
+**Twist:** Some pens also support twist detection (the pen rotating around its own axis). If supported, [`Pen.twist`](xref:UnityEngine.InputSystem.Pen.twist) represents the current rotation, where 0 means that the pen is facing up towards the Y axis, and values close to 1 mean that the pen is fully rotated clockwise around its own axis.
## In-range detection
-A pen might not need to touch the tablet or screen surface in order to be able to control the cursor. You can use the [`inRange`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_inRange) button Control to determine whether the pen is currently in detection range. If [`inRange`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_inRange) reports as pressed, the pen registers with the tablet or screen. For Devices that don't support this feature, [`inRange`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_inRange) always reports as pressed.
+A pen might not need to touch the tablet or screen surface in order to be able to control the cursor. You can use the [`inRange`](xref:UnityEngine.InputSystem.Pen.inRange) button Control to determine whether the pen is currently in detection range. If [`inRange`](xref:UnityEngine.InputSystem.Pen.inRange) reports as pressed, the pen registers with the tablet or screen. For Devices that don't support this feature, [`inRange`](xref:UnityEngine.InputSystem.Pen.inRange) always reports as pressed.
## Barrel buttons
-Pen Devices often have one or multiple buttons on the side of the pen. These are represented by the [`firstBarrelButton`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_firstBarrelButton), [`secondBarrelButton`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_secondBarrelButton), [`thirdBarrelButton`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_thirdBarrelButton), and [`fourthBarrelButton`](../api/UnityEngine.InputSystem.Pen.html#UnityEngine_InputSystem_Pen_fourthBarrelButton) where applicable.
+Pen Devices often have one or multiple buttons on the side of the pen. These are represented by the [`firstBarrelButton`](xref:UnityEngine.InputSystem.Pen.firstBarrelButton), [`secondBarrelButton`](xref:UnityEngine.InputSystem.Pen.secondBarrelButton), [`thirdBarrelButton`](xref:UnityEngine.InputSystem.Pen.thirdBarrelButton), and [`fourthBarrelButton`](xref:UnityEngine.InputSystem.Pen.fourthBarrelButton) where applicable.
diff --git a/Packages/com.unity.inputsystem/Documentation~/PlayerInput.md b/Packages/com.unity.inputsystem/Documentation~/PlayerInput.md
index e3869e0869..69a54d1ef8 100644
--- a/Packages/com.unity.inputsystem/Documentation~/PlayerInput.md
+++ b/Packages/com.unity.inputsystem/Documentation~/PlayerInput.md
@@ -5,7 +5,7 @@ uid: input-system-player-input
The Player Input component provides two related but separate features which can be useful in common game scenarios. These are:
-- Configuring how [Actions](Actions.md) map to methods or callbacks in the script that controls your player.
+- Configuring how [Actions](xref:input-system-actions) map to methods or callbacks in the script that controls your player.
- Handling local multiplayer scenarios such as player lobbies, device filtering, and screen-splitting.
@@ -26,46 +26,47 @@ There are a few options for doing exactly how the Player Input component does th
### Handling local multiplayer scenarios
-You can also have multiple **Player Input** components active at the same time (each on a separate instance of a prefab) along with the [**Player Input Manager**](PlayerInputManager.md) component to implement local multiplayer features, such as device filtering, and screen-splitting.
+You can also have multiple **Player Input** components active at the same time (each on a separate instance of a prefab) along with the [**Player Input Manager**](xref:input-system-player-input-manager) component to implement local multiplayer features, such as device filtering, and screen-splitting.
-In these local multiplayer scenarios, the Player Input component should be on a prefab that represents a player in your game, which the [**Player Input Manager**](PlayerInputManager.md) has a reference to. The **Player Input Manager** then instantiates players as they join the game and pairs each player instance to a unique device that the player uses exclusively (for example, one gamepad for each player). You can also manually pair devices in a way that enables two or more players to share a Device (for example, left/right keyboard splits or hot seat use).
+In these local multiplayer scenarios, the Player Input component should be on a prefab that represents a player in your game, which the [**Player Input Manager**](xref:input-system-player-input-manager) has a reference to. The **Player Input Manager** then instantiates players as they join the game and pairs each player instance to a unique device that the player uses exclusively (for example, one gamepad for each player). You can also manually pair devices in a way that enables two or more players to share a Device (for example, left/right keyboard splits or hot seat use).
-Each `PlayerInput` corresponds to one [`InputUser`](UserManagement.md). You can use [`PlayerInput.user`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_user) to query the `InputUser` from the component.
+Each `PlayerInput` corresponds to one [`InputUser`](xref:input-system-user-management). You can use [`PlayerInput.user`](xref:UnityEngine.InputSystem.PlayerInput.user) to query the `InputUser` from the component.
## Getting started
To get started using the Player Input component, use the following steps:
1. [Add](https://docs.unity3d.com/Manual/UsingComponents.html) a **Player Input** component to a GameObject. This would usually be the GameObject that represents the player in your game.
-2. Assign your [Action Asset](ActionAssets.md) to the **Actions** field. This is usually the default project-wide action asset named "InputSystem_Actions"
-> Note: Currently, when using project-wide actions all the action maps are enabled by default. It is advisible to manually disable them and manually enable the default map that **Player Input** during `Start()`.
+2. Assign your [Action Asset](xref:input-system-action-assets) to the **Actions** field. This is usually the default project-wide action asset named "InputSystem_Actions"
+ > [!NOTE]
+ > Currently, when using project-wide actions all the action maps are enabled by default. It is advisible to manually disable them and manually enable the default map that **Player Input** during `Start()`.
3. Set up Action responses, by selecting a **Behavior** type from the Behavior menu. The Behavior type you select affects how you should implement the methods that handle your Action responses. See the [notification behaviors](#notification-behaviors) section further down for details. 
## Configuring the Player Input component
You can use the following properties to configure `PlayerInput`:
-| Property | Description |
-| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| [`Actions`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_actions) | The set of [Input Actions](Actions.md) associated with the player. Typically you would set this to Project-Wide Actions, however you can assign an [ActionAsset](ActionAssets.md) reference here). To receive input, each player must have an associated set of Actions. See documentation on [Actions](#actions) for details. |
-| [`Default Control Scheme`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_defaultControlScheme) | Which [Control Scheme](ActionBindings.md#control-schemes) (from what is defined in [`Actions`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_actions)) to enable by default. |
-| [`Default Action Map`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_defaultActionMap) | Which [Action Map](Actions.md#overview) in [`Actions`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_actions) to enable by default. If set to `None`, then the player starts with no Actions being enabled. |
-| [`Camera`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_camera) | The individual camera associated with the player. This is only required when employing [split-screen](PlayerInputManager.md#split-screen) setups and has no effect otherwise. |
-| [`Behavior`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_notificationBehavior) | How the `PlayerInput` component notifies game code about things that happen with the player. See documentation on [notification behaviors](#notification-behaviors). |
+| Component (UI) property | Description | Matching property |
+| -- | -- | -- |
+| **Actions** | The set of [Input Actions](xref:input-system-actions) associated with the player. Typically you would set this to Project-Wide Actions, however you can also assign an [ActionAsset](xref:input-system-action-assets) reference instead. To receive input, each player must have an associated set of [Actions](#actions). | [`actions`](xref:UnityEngine.InputSystem.PlayerInput.actions) |
+| **Default Scheme** | The [Control Scheme](xref:input-system-action-bindings#control-schemes) to enable by default, as defined in the [`PlayerInput.actions`](xref:UnityEngine.InputSystem.PlayerInput.actions) property. | [`defaultControlScheme`](xref:UnityEngine.InputSystem.PlayerInput.defaultControlScheme) |
+| **Default Map** | The [Action Map](xref:input-system-actions#overview) in the [`PlayerInput.actions`](xref:UnityEngine.InputSystem.PlayerInput.actions) property to enable by default. If set to `None`, then the player starts with no Actions being enabled. | [`defaultActionMap`](xref:UnityEngine.InputSystem.PlayerInput.defaultActionMap) |
+| **Camera** | The individual camera associated with the player. This is only required when employing [split-screen](xref:input-system-player-input-manager#split-screen) setups and has no effect otherwise. | [`camera`](xref:UnityEngine.InputSystem.PlayerInput.camera) |
+| **Behavior** | How the `PlayerInput` component [notifies](#notification-behaviors) game code about input actions and other input-related events happening to the player or that the player initiates. | [`notificationBehavior`](xref:UnityEngine.InputSystem.PlayerInput.notificationBehavior) |
### Actions
To receive input, each player must have an associated set of Input Actions.
#### Specifying the Actions to use
-The simplest workflow is to use the project-wide actions defined in the [Input Actions editor](ActionsEditor.md). However, the Player Input component also allows you to use an [Actions Asset](ActionAssets.md) to specify the actions that should be used by any instance of the component. If you set the **Actions** field to **Actions Asset**, the inspector displays a field into which you can assign an actions asset, and a **Create Actions** button which allows you to create a new actions asset. When you create these via the Player Input inspector's __Create Actions__ button, the Input System creates a default set of Actions. However, the Player Input component places no restrictions on the arrangement of Actions.
+The simplest workflow is to use the project-wide actions defined in the [Input Actions editor](xref:input-system-configuring-input). However, the Player Input component also allows you to use an [Actions Asset](xref:input-system-action-assets) to specify the actions that should be used by any instance of the component. If you set the **Actions** field to **Actions Asset**, the inspector displays a field into which you can assign an actions asset, and a **Create Actions** button which allows you to create a new actions asset. When you create these via the Player Input inspector's __Create Actions__ button, the Input System creates a default set of Actions. However, the Player Input component places no restrictions on the arrangement of Actions.
#### Enabling and disabling Actions
-The Player Input component automatically handles enabling and disabling Actions, and also handles installing [callbacks](RespondingToActions.md#responding-to-actions-using-callbacks) on the Actions. When multiple Player Input components use the same Actions, the components automatically create [private copies of the Actions](RespondingToActions.md#using-actions-with-multiple-players). This is why, when writing input code that works with the PlayerInput component, you should not use `InputSystem.actions` because this references the "singleton" copy of the actions rather than the specific private copy associated with the PlayerInput instance you are coding for.
+The Player Input component automatically handles enabling and disabling Actions, and also handles installing [callbacks](xref:input-system-responding#responding-to-actions-using-callbacks) on the Actions. When multiple Player Input components use the same Actions, the components automatically create [private copies of the Actions](xref:input-system-responding#using-actions-with-multiple-players). This is why, when writing input code that works with the PlayerInput component, you should not use `InputSystem.actions` because this references the "singleton" copy of the actions rather than the specific private copy associated with the PlayerInput instance you are coding for.
While we advise against using it, if you **really need or want** to use `InputSystem.actions` for single player use cases, it is advisible to manually disable them and manually enable the default map that **Player Input** sets, during `Start()`, like so:
```csharp
-public class MyPlayerScript : MonoBehaviour
+public class MyPlayerScript : MonoBehavior
{
PlayerInput playerInput;
@@ -79,11 +80,11 @@ public class MyPlayerScript : MonoBehaviour
```
-When first enabled, the Player Input component enables all Actions from the the [`Default Action Map`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_defaultActionMap). If no default Action Map exists, the Player Input component does not enable any Actions. To manually enable Actions, you can call [`Enable`](../api/UnityEngine.InputSystem.InputActionMap.html#UnityEngine_InputSystem_InputActionMap_Enable) and [`Disable`](../api/UnityEngine.InputSystem.InputActionMap.html#UnityEngine_InputSystem_InputActionMap_Disable) on the Action Maps or Actions, like you would do [without `PlayerInput`](Actions.md). To check which Action Map is currently enabled, or to switch to a different one, use the [`PlayerInput.currentActionMap`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_currentActionMap) property. To switch Action Maps with an Action Map name, you can also call [`PlayerInput.SwitchCurrentActionMap`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_SwitchCurrentActionMap_System_String_).
+When first enabled, the Player Input component enables all Actions from the the [`Default Action Map`](xref:UnityEngine.InputSystem.PlayerInput.defaultActionMap). If no default Action Map exists, the Player Input component does not enable any Actions. To manually enable Actions, you can call [`Enable`](xref:UnityEngine.InputSystem.InputActionMap.Enable) and [`Disable`](xref:UnityEngine.InputSystem.InputActionMap.Disable) on the Action Maps or Actions, like you would do [without `PlayerInput`](xref:input-system-actions). To check which Action Map is currently enabled, or to switch to a different one, use the [`PlayerInput.currentActionMap`](xref:UnityEngine.InputSystem.PlayerInput.currentActionMap) property. To switch Action Maps with an Action Map name, you can also call [`PlayerInput.SwitchCurrentActionMap`](xref:UnityEngine.InputSystem.PlayerInput.SwitchCurrentActionMap(System.String)).
-To disable a player's input, call [`PlayerInput.DeactivateInput`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_DeactivateInput). To re-enable it, call [`PlayerInput.ActivateInput`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_ActivateInput). The latter enables the default Action Map, if it exists.
+To disable a player's input, call [`PlayerInput.DeactivateInput`](xref:UnityEngine.InputSystem.PlayerInput.DeactivateInput). To re-enable it, call [`PlayerInput.ActivateInput`](xref:UnityEngine.InputSystem.PlayerInput.ActivateInput). The latter enables the default Action Map, if it exists.
-When `PlayerInput` is disabled, it automatically disables the currently active Action Map ([`PlayerInput.currentActionMap`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_currentActionMap)) and disassociate any Devices paired to the player.
+When `PlayerInput` is disabled, it automatically disables the currently active Action Map ([`PlayerInput.currentActionMap`](xref:UnityEngine.InputSystem.PlayerInput.currentActionMap)) and disassociate any Devices paired to the player.
See the [notification behaviors](#notification-behaviors) section below for how to be notified when player triggers an Action.
@@ -119,7 +120,7 @@ The component must be on the same `GameObject` if you are using `Send Messages`,
### When using **Invoke Unity Events**
-When the [notification behavior](#notification-behaviors) of `PlayerInput` is set to `Invoke Unity Events`, each Action has to be routed to a target method. The methods have the same format as the [`started`, `performed`, and `canceled` callbacks](RespondingToActions.md#action-callbacks) on [`InputAction`](../api/UnityEngine.InputSystem.InputAction.html).
+When the [notification behavior](#notification-behaviors) of `PlayerInput` is set to `Invoke Unity Events`, each Action has to be routed to a target method. The methods have the same format as the [`started`, `performed`, and `canceled` callbacks](xref:input-system-responding#action-callbacks) on [`InputAction`](xref:UnityEngine.InputSystem.InputAction).
```CSharp
public class MyPlayerScript : MonoBehaviour
@@ -137,29 +138,29 @@ public class MyPlayerScript : MonoBehaviour
### Notification behaviors
-You can use the [`Behavior`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_notificationBehavior) property in the Inspector to determine how a `PlayerInput` component notifies game code when something related to the player has occurred.
+You can use the [`Behavior`](xref:UnityEngine.InputSystem.PlayerInput.notificationBehavior) property in the Inspector to determine how a `PlayerInput` component notifies game code when something related to the player has occurred.
The following options are available:
-| Behavior | Description |
-| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [`Send Messages`](../api/UnityEngine.InputSystem.PlayerNotifications.html) | Uses [`GameObject.SendMessage`](https://docs.unity3d.com/ScriptReference/GameObject.SendMessage.html) on the `GameObject` that the `PlayerInput` component belongs to. |
-| [`Broadcast Messages`](../api/UnityEngine.InputSystem.PlayerNotifications.html) | Uses [`GameObject.BroadcastMessage`](https://docs.unity3d.com/ScriptReference/GameObject.BroadcastMessage.html) on the `GameObject` that the `PlayerInput` component belongs to. This broadcasts the message down the `GameObject` hierarchy. |
-| [`Invoke Unity Events`](../api/UnityEngine.InputSystem.PlayerNotifications.html) | Uses a separate [`UnityEvent`](https://docs.unity3d.com/ScriptReference/Events.UnityEvent.html) for each individual type of message. When this is selected, the events available on the `PlayerInput` are accessible from the __Events__ foldout. The argument received by events triggered for Actions is the same as the one received by [`started`, `performed`, and `canceled` callbacks](RespondingToActions.md#action-callbacks).  |
-| [`Invoke CSharp Events`](../api/UnityEngine.InputSystem.PlayerNotifications.html) | Similar to `Invoke Unity Events`, except that the events are plain C# events available on the `PlayerInput` API. You cannot configure these from the Inspector. Instead, you have to register callbacks for the events in your scripts. The following events are available:[`onActionTriggered`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_onActionTriggered) (collective event for all actions on the player) [`onDeviceLost`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_onDeviceLost) [`onDeviceRegained`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_onDeviceRegained) |
+| Behavior value (UI) | Description | Matching enum value |
+| -- | -- | -- |
+| **Send Messages** | Uses [`GameObject.SendMessage`](xref:UnityEngine.GameObject.SendMessage) on the `GameObject` that the `PlayerInput` component belongs to. | [`SendMessages`](xref:UnityEngine.InputSystem.PlayerNotifications.SendMessages) |
+| **Broadcast Messages** | Uses [`GameObject.BroadcastMessage`](xref:UnityEngine.GameObject.BroadcastMessage) on the `GameObject` that the `PlayerInput` component belongs to. This broadcasts the message down the `GameObject` hierarchy. | [`BroadcastMessages`](xref:UnityEngine.InputSystem.PlayerNotifications.BroadcastMessages) |
+| **Invoke Unity Events** | Uses a separate [`UnityEvent`](xref:UnityEngine.Events.UnityEvent) for each individual type of message. When this is selected, the events available on the `PlayerInput` are accessible from the __Events__ foldout. The argument received by events triggered for Actions is the same as the one received by [`started`, `performed`, and `canceled` callbacks](xref:input-system-responding#action-callbacks).  | [`InvokeUnityEvents`](xref:UnityEngine.InputSystem.PlayerNotifications.InvokeUnityEvents) |
+| **Invoke CSharp Events** | Similar to **Invoke Unity Events**, except that the events are plain C# events available on the `PlayerInput` API. You cannot configure these from the Inspector. Instead, you have to register callbacks for the events in your scripts. The following events are available:[`onActionTriggered`](xref:UnityEngine.InputSystem.PlayerInput.onActionTriggered) (collective event for all actions on the player) [`onDeviceLost`](xref:UnityEngine.InputSystem.PlayerInput.onDeviceLost) [`onDeviceRegained`](xref:UnityEngine.InputSystem.PlayerInput.onDeviceRegained) | [`InvokeCSharpEvents`](xref:UnityEngine.InputSystem.PlayerNotifications.InvokeCSharpEvents) |
In addition to per-action notifications, `PlayerInput` sends the following general notifications:
-| Notification | Description |
-| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
-| [`DeviceLostMessage`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_DeviceLostMessage) | The player has lost one of the Devices assigned to it. This can happen, for example, if a wireless device runs out of battery. |
-| [`DeviceRegainedMessage`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_DeviceRegainedMessage) | Notification that triggers when the player recovers from Device loss and is good to go again. |
+| Notification | Description |
+| -- | -- |
+| [`DeviceLostMessage`](xref:UnityEngine.InputSystem.PlayerInput.DeviceLostMessage) | The player has lost one of the Devices assigned to it. This can happen, for example, if a wireless device runs out of battery. |
+| [`DeviceRegainedMessage`](xref:UnityEngine.InputSystem.PlayerInput.DeviceRegainedMessage) | Notification that triggers when the player recovers from Device loss and is good to go again. |
### Device assignments
-If the `PlayerInput` component has any Devices assigned, it matches these to the [Control Schemes](ActionBindings.md#control-schemes) in the associated Action Asset, and only enables Control Schemes which match its Input Devices.
+If the `PlayerInput` component has any Devices assigned, it matches these to the [Control Schemes](xref:input-system-action-bindings#control-schemes) in the associated Action Asset, and only enables Control Schemes which match its Input Devices.
-Each `PlayerInput` can have one or more Devices assigned to it. By default, no two `PlayerInput` components are assigned the same Devices, but you can force this; to do so, manually assign Devices to a player when calling [`PlayerInput.Instantiate`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_Instantiate_UnityEngine_GameObject_System_Int32_System_String_System_Int32_UnityEngine_InputSystem_InputDevice_), or call [`InputUser.PerformPairingWithDevice`](../api/UnityEngine.InputSystem.Users.InputUser.html#UnityEngine_InputSystem_Users_InputUser_PerformPairingWithDevice_UnityEngine_InputSystem_InputDevice_UnityEngine_InputSystem_Users_InputUser_UnityEngine_InputSystem_Users_InputUserPairingOptions_) on the `InputUser` of a `PlayerInput`.
+Each `PlayerInput` can have one or more Devices assigned to it. By default, no two `PlayerInput` components are assigned the same Devices, but you can force this; to do so, manually assign Devices to a player when calling [`PlayerInput.Instantiate`](xref:UnityEngine.InputSystem.PlayerInput.Instantiate(UnityEngine.GameObject,System.Int32,System.String,System.Int32,UnityEngine.InputSystem.InputDevice)), or call [`InputUser.PerformPairingWithDevice`](xref:UnityEngine.InputSystem.Users.InputUser.PerformPairingWithDevice(UnityEngine.InputSystem.InputDevice,UnityEngine.InputSystem.Users.InputUser,UnityEngine.InputSystem.Users.InputUserPairingOptions)) on the `InputUser` of a `PlayerInput`.
### Debug information
@@ -171,16 +172,15 @@ The Debug section shows the User number (which starts counting from zero), the c
### UI input
-The `PlayerInput` component can work together with an [`InputSystemUIInputModule`](UISupport.md#setting-up-ui-input) to drive the [UI system](UISupport.md).
+The `PlayerInput` component can work together with an [`InputSystemUIInputModule`](xref:input-system-ui-support#setting-up-ui-input) to drive the [UI system](xref:input-system-ui-support).
-To set this up, assign a reference to a `InputSystemUIInputModule` component in the [`UI Input Module`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_uiInputModule) field of the `PlayerInput` component. The `PlayerInput` and `InputSystemUIInputModule` components should be configured to work with the same [`InputActionAsset`](Actions.md) for this to work.
+To set this up, assign a reference to a `InputSystemUIInputModule` component in the [`UI Input Module`](xref:UnityEngine.InputSystem.PlayerInput.uiInputModule) field of the `PlayerInput` component. The `PlayerInput` and `InputSystemUIInputModule` components should be configured to work with the same [`InputActionAsset`](xref:input-system-actions) for this to work.
Once you've completed this setup, when the `PlayerInput` component configures the Actions for a specific player, it assigns the same Action configuration to the `InputSystemUIInputModule`. In other words, the same Action and Device configuration that controls the player now also controls the UI.
-If you use [`MultiplayerEventSystem`](UISupport.md#multiplayer-uis) components to dispatch UI events, you can also use this setup to simultaneously have multiple UI instances on the screen, each controlled by a separate player.
+If you use [`MultiplayerEventSystem`](xref:input-system-ui-support#multiplayer-uis) components to dispatch UI events, you can also use this setup to simultaneously have multiple UI instances on the screen, each controlled by a separate player.
->**Notes**:
-> - As a general rule, if you are using the PlayerInput workflow, you should read input through callbacks as described above, however if you need to access the input actions asset directly while using the PlayerInput component, you should access the [PlayerInput component's copy of the actions](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_actions), not `InputSystem.actions`. This is because the PlayerInput component performs device filtering to automatically assign devices to multiple players, so each instance has its own copy of the actions filtered for each player. If you bypass this by reading `InputSystem.actions` directly, the automatic device assignment won't work.
+> [!NOTE]
+> - As a general rule, if you are using the PlayerInput workflow, you should read input through callbacks as described above, however if you need to access the input actions asset directly while using the PlayerInput component, you should access the [PlayerInput component's copy of the actions](xref:UnityEngine.InputSystem.PlayerInput.actions), not `InputSystem.actions`. This is because the PlayerInput component performs device filtering to automatically assign devices to multiple players, so each instance has its own copy of the actions filtered for each player. If you bypass this by reading `InputSystem.actions` directly, the automatic device assignment won't work.
>
> - This component is built on top of the public Input System API. As such, they don't do anything that you can't program yourself. They are meant primarily as an easy, out-of-the-box setup that eliminates much of the need for custom scripting.
->
diff --git a/Packages/com.unity.inputsystem/Documentation~/PlayerInputManager.md b/Packages/com.unity.inputsystem/Documentation~/PlayerInputManager.md
index 985bf6d095..179b4a2755 100644
--- a/Packages/com.unity.inputsystem/Documentation~/PlayerInputManager.md
+++ b/Packages/com.unity.inputsystem/Documentation~/PlayerInputManager.md
@@ -3,53 +3,54 @@ uid: input-system-player-input-manager
---
# The Player Input Manager component
->NOTE: The Input System package comes with a sample called `Simple Multiplayer` which you can install from the package manager UI in the Unity editor. The sample demonstrates how to use [`PlayerInputManager`](../api/UnityEngine.InputSystem.PlayerInputManager.html) to set up a simple local multiplayer scenario.
+> [!NOTE]
+> The Input System package comes with a sample called `Simple Multiplayer` which you can install from the package manager UI in the Unity editor. The sample demonstrates how to use [`PlayerInputManager`](xref:UnityEngine.InputSystem.PlayerInputManager) to set up a simple local multiplayer scenario.
-The [`Player Input`](PlayerInput.md) system facilitates setting up local multiplayer games, where multiple players share a single screen and multiple controllers. You can set this up using the [`PlayerInputManager`](../api/UnityEngine.InputSystem.PlayerInputManager.html) component, which automatically manages the creation and lifetime of `PlayerInput` instances as players join and leave the game.
+The [`Player Input`](xref:input-system-player-input) system facilitates setting up local multiplayer games, where multiple players share a single screen and multiple controllers. You can set this up using the [`PlayerInputManager`](xref:UnityEngine.InputSystem.PlayerInputManager) component, which automatically manages the creation and lifetime of `PlayerInput` instances as players join and leave the game.
-
+{width="486" height="279"}
|Property|Description|
|--------|-----------|
-|[`Notification Behavior`](../api/UnityEngine.InputSystem.PlayerInputManager.html#UnityEngine_InputSystem_PlayerInputManager_notificationBehavior)|How the [`PlayerInputManager`](../api/UnityEngine.InputSystem.PlayerInput.html) component notifies game code about changes to the connected players. [This works the same way as for the `PlayerInput` component](PlayerInput.md#notification-behaviors).|
-|[`Join Behavior`](../api/UnityEngine.InputSystem.PlayerInputManager.html#UnityEngine_InputSystem_PlayerInputManager_joinBehavior)|Determines the mechanism by which players can join when joining is enabled. See documentation on [join behaviors](#join-behaviors).|
-|[`Player Prefab`](../api/UnityEngine.InputSystem.PlayerInputManager.html#UnityEngine_InputSystem_PlayerInputManager_playerPrefab)|A prefab that represents a player in the game. The [`PlayerInputManager`](../api/UnityEngine.InputSystem.PlayerInputManager.html) component creates an instance of this prefab whenever a new player joins. This prefab must have one [`PlayerInput`](PlayerInput.md) component in its hierarchy.|
-|[`Joining Enabled By Default`](../api/UnityEngine.InputSystem.PlayerInputManager.html#UnityEngine_InputSystem_PlayerInputManager_joiningEnabled)|While this is enabled, new players can join via the mechanism determined by [`Join Behavior`](../api/UnityEngine.InputSystem.PlayerInputManager.html#UnityEngine_InputSystem_PlayerInputManager_joinBehavior).|
-|[`Limit Number of Players`](../api/UnityEngine.InputSystem.PlayerInputManager.html#UnityEngine_InputSystem_PlayerInputManager_maxPlayerCount)|Enable this if you want to limit the number of players who can join the game.|
-|[`Max Player Count`](../api/UnityEngine.InputSystem.PlayerInputManager.html#UnityEngine_InputSystem_PlayerInputManager_maxPlayerCount)(Only shown when `Limit number of Players` is enabled.)|The maximum number of players allowed to join the game.|
-|[`Enable Split-Screen`](../api/UnityEngine.InputSystem.PlayerInputManager.html#UnityEngine_InputSystem_PlayerInputManager_splitScreen)|If enabled, each player is automatically assigned a portion of the available screen area. See documentation on [split-screen](#split-screen) multiplayer.|
+|[`Notification Behavior`](xref:UnityEngine.InputSystem.PlayerInputManager.notificationBehavior)|How the [`PlayerInputManager`](xref:UnityEngine.InputSystem.PlayerInput) component notifies game code about changes to the connected players. [This works the same way as for the `PlayerInput` component](xref:input-system-player-input#notification-behaviors).|
+|[`Join Behavior`](xref:UnityEngine.InputSystem.PlayerInputManager.joinBehavior)|Determines the mechanism by which players can join when joining is enabled. See documentation on [join behaviors](#join-behaviors).|
+|[`Player Prefab`](xref:UnityEngine.InputSystem.PlayerInputManager.playerPrefab)|A prefab that represents a player in the game. The [`PlayerInputManager`](xref:UnityEngine.InputSystem.PlayerInputManager) component creates an instance of this prefab whenever a new player joins. This prefab must have one [`PlayerInput`](xref:input-system-player-input) component in its hierarchy.|
+|[`Joining Enabled By Default`](xref:UnityEngine.InputSystem.PlayerInputManager.joiningEnabled)|While this is enabled, new players can join via the mechanism determined by [`Join Behavior`](xref:UnityEngine.InputSystem.PlayerInputManager.joinBehavior).|
+|[`Limit Number of Players`](xref:UnityEngine.InputSystem.PlayerInputManager.maxPlayerCount)|Enable this if you want to limit the number of players who can join the game.|
+|[`Max Player Count`](xref:UnityEngine.InputSystem.PlayerInputManager.maxPlayerCount)(Only shown when `Limit number of Players` is enabled.)|The maximum number of players allowed to join the game.|
+|[`Enable Split-Screen`](xref:UnityEngine.InputSystem.PlayerInputManager.splitScreen)|If enabled, each player is automatically assigned a portion of the available screen area. See documentation on [split-screen](#split-screen) multiplayer.|
### Join behaviors
-You can use the [`Join Behavior`](../api/UnityEngine.InputSystem.PlayerInputManager.html#UnityEngine_InputSystem_PlayerInputManager_joinBehavior) property in the Inspector to determine how a [`PlayerInputManager`](../api/UnityEngine.InputSystem.PlayerInputManager.html) component decides when to add new players to the game. The following options are available to choose the specific mechanism that [`PlayerInputManager`](../api/UnityEngine.InputSystem.PlayerInputManager.html) employs.
+You can use the [`Join Behavior`](xref:UnityEngine.InputSystem.PlayerInputManager.joinBehavior) property in the Inspector to determine how a [`PlayerInputManager`](xref:UnityEngine.InputSystem.PlayerInputManager) component decides when to add new players to the game. The following options are available to choose the specific mechanism that [`PlayerInputManager`](xref:UnityEngine.InputSystem.PlayerInputManager) employs.
|Behavior|Description|
|--------|-----------|
-|[`Join Players When Button IsPressed`](../api/UnityEngine.InputSystem.PlayerJoinBehavior.html)|Listen for button presses on Devices that are not paired to any player. If a player presses a button and joining is allowed, join the new player using the Device they pressed the button on.|
-|[`Join Players When Join Action Is Triggered`](../api/UnityEngine.InputSystem.PlayerJoinBehavior.html)|Similar to `Join Players When Button IsPressed`, but this only joins a player if the control they triggered matches a specific action you define. For example, you can set up players to join when pressing a specific gamepad button.|
-|[`Join Players Manually`](../api/UnityEngine.InputSystem.PlayerJoinBehavior.html)|Don't join players automatically. Call [`JoinPlayer`](../api/UnityEngine.InputSystem.PlayerInputManager.html#UnityEngine_InputSystem_PlayerInputManager_JoinPlayer_System_Int32_System_Int32_System_String_UnityEngine_InputSystem_InputDevice_) explicitly to join new players. Alternatively, create GameObjects with [`PlayerInput`](PlayerInput.md) components directly and the Input System will automatically join them.|
+|[`Join Players When Button IsPressed`](xref:UnityEngine.InputSystem.PlayerJoinBehavior)|Listen for button presses on Devices that are not paired to any player. If a player presses a button and joining is allowed, join the new player using the Device they pressed the button on.|
+|[`Join Players When Join Action Is Triggered`](xref:UnityEngine.InputSystem.PlayerJoinBehavior)|Similar to `Join Players When Button IsPressed`, but this only joins a player if the control they triggered matches a specific action you define. For example, you can set up players to join when pressing a specific gamepad button.|
+|[`Join Players Manually`](xref:UnityEngine.InputSystem.PlayerJoinBehavior)|Don't join players automatically. Call [`JoinPlayer`](xref:UnityEngine.InputSystem.PlayerInputManager.JoinPlayer(System.Int32,System.Int32,System.String,UnityEngine.InputSystem.InputDevice)) explicitly to join new players. Alternatively, create GameObjects with [`PlayerInput`](xref:input-system-player-input) components directly and the Input System will automatically join them.|
### Split-screen
-If you enable the [`Split-Screen`](../api/UnityEngine.InputSystem.PlayerInputManager.html#UnityEngine_InputSystem_PlayerInputManager_splitScreen) option, the [`PlayerInputManager`](../api/UnityEngine.InputSystem.PlayerInputManager.html) automatically splits the available screen space between the active players. For this to work, you must set the [`Camera`](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_camera) property on the `PlayerInput` prefab. The [`PlayerInputManager`](../api/UnityEngine.InputSystem.PlayerInputManager.html) then automatically resizes and repositions each camera instance to let each player have their own part of the screen.
+If you enable the [`Split-Screen`](xref:UnityEngine.InputSystem.PlayerInputManager.splitScreen) option, the [`PlayerInputManager`](xref:UnityEngine.InputSystem.PlayerInputManager) automatically splits the available screen space between the active players. For this to work, you must set the [`Camera`](xref:UnityEngine.InputSystem.PlayerInput.camera) property on the `PlayerInput` prefab. The [`PlayerInputManager`](xref:UnityEngine.InputSystem.PlayerInputManager) then automatically resizes and repositions each camera instance to let each player have their own part of the screen.
-If you enable the [`Split-Screen`](../api/UnityEngine.InputSystem.PlayerInputManager.html#UnityEngine_InputSystem_PlayerInputManager_splitScreen) option, you can configure the following additional properties in the Inspector:
+If you enable the [`Split-Screen`](xref:UnityEngine.InputSystem.PlayerInputManager.splitScreen) option, you can configure the following additional properties in the Inspector:
|Property|Description|
|--------|-----------|
-|[`Maintain Aspect Ratio`](../api/UnityEngine.InputSystem.PlayerInputManager.html#UnityEngine_InputSystem_PlayerInputManager_maintainAspectRatioInSplitScreen)|A `false` value enables the game to produce screen areas that have an aspect ratio different from the screen resolution when subdividing the screen.|
-|[`Set Fixed Number`](../api/UnityEngine.InputSystem.PlayerInputManager.html#UnityEngine_InputSystem_PlayerInputManager_fixedNumberOfSplitScreens)|If this value is greater than zero, the [`PlayerInputManager`](../api/UnityEngine.InputSystem.PlayerInputManager.html) always splits the screen into a fixed number of rectangles, regardless of the actual number of players.|
-|[`Screen Rectangle`](../api/UnityEngine.InputSystem.PlayerInputManager.html#UnityEngine_InputSystem_PlayerInputManager_splitScreenArea)|The normalized screen rectangle available for allocating player split-screens into.|
+|[`Maintain Aspect Ratio`](xref:UnityEngine.InputSystem.PlayerInputManager.maintainAspectRatioInSplitScreen)|A `false` value enables the game to produce screen areas that have an aspect ratio different from the screen resolution when subdividing the screen.|
+|[`Set Fixed Number`](xref:UnityEngine.InputSystem.PlayerInputManager.fixedNumberOfSplitScreens)|If this value is greater than zero, the [`PlayerInputManager`](xref:UnityEngine.InputSystem.PlayerInputManager) always splits the screen into a fixed number of rectangles, regardless of the actual number of players.|
+|[`Screen Rectangle`](xref:UnityEngine.InputSystem.PlayerInputManager.splitScreenArea)|The normalized screen rectangle available for allocating player split-screens into.|
-By default, any player in the game can interact with any UI elements. However, in split-screen setups, your game can have screen-space UIs that are restricted to just one specific camera. See the [UI Input](PlayerInput.md#ui-input) section on the Player Input component page on how to set this up using the Player Input component, [`InputSystemUIInputModule`](UISupport.md#setting-up-ui-input) and [`MultiplayerEventSystem`](UISupport.md#multiplayer-uis) components.
+By default, any player in the game can interact with any UI elements. However, in split-screen setups, your game can have screen-space UIs that are restricted to just one specific camera. See the [UI Input](xref:input-system-player-input#ui-input) section on the Player Input component page on how to set this up using the Player Input component, [`InputSystemUIInputModule`](xref:input-system-ui-support#setting-up-ui-input) and [`MultiplayerEventSystem`](xref:input-system-ui-support#multiplayer-uis) components.
### `PlayerInputManager` notifications
-`PlayerInputManager` sends notifications when something notable happens with the current player setup. These notifications are delivered according to the `Notification Behavior` property, in the [same way as for `PlayerInput`](PlayerInput.md#notification-behaviors).
+`PlayerInputManager` sends notifications when something notable happens with the current player setup. These notifications are delivered according to the `Notification Behavior` property, in the [same way as for `PlayerInput`](xref:input-system-player-input#notification-behaviors).
Your game can listen to the following notifications:
|Notification|Description|
|------------|-----------|
-|[`PlayerJoinedMessage`](../api/UnityEngine.InputSystem.PlayerInputManager.html#UnityEngine_InputSystem_PlayerInputManager_PlayerJoinedMessage)|A new player joined the game. Passes the [`PlayerInput`](PlayerInput.md`PlayerInputManager` sends a `Player Joined` notification for each of these).|
-|[`PlayerLeftMessage`](../api/UnityEngine.InputSystem.PlayerInputManager.html#UnityEngine_InputSystem_PlayerInputManager_PlayerLeftMessage)|A player left the game. Passes the [`PlayerInput`](PlayerInput.md) instance of the player who left.|
+|[`PlayerJoinedMessage`](xref:UnityEngine.InputSystem.PlayerInputManager.PlayerJoinedMessage)|A new player joined the game. Passes the [`PlayerInput`](PlayerInput.md`PlayerInputManager` sends a `Player Joined` notification for each of these).|
+|[`PlayerLeftMessage`](xref:UnityEngine.InputSystem.PlayerInputManager.PlayerLeftMessage)|A player left the game. Passes the [`PlayerInput`](xref:input-system-player-input) instance of the player who left.|
diff --git a/Packages/com.unity.inputsystem/Documentation~/Pointers.md b/Packages/com.unity.inputsystem/Documentation~/Pointers.md
index 3b498c581e..614bedc698 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Pointers.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Pointers.md
@@ -3,26 +3,26 @@ uid: input-system-pointers
---
# Pointers
-[`Pointer`](../api/UnityEngine.InputSystem.Pointer.html) Devices are defined as [`InputDevices`](../api/UnityEngine.InputSystem.InputDevice.html) that track positions on a 2D surface. The Input System supports three types of pointers:
+[`Pointer`](xref:UnityEngine.InputSystem.Pointer) Devices are defined as [`InputDevices`](xref:UnityEngine.InputSystem.InputDevice) that track positions on a 2D surface. The Input System supports three types of pointers:
-* [Touch](Touch.md)
-* [Mouse](Mouse.md)
-* [Pen](Pen.md)
+* [Touch](xref:input-system-touch)
+* [Mouse](xref:input-system-mouse)
+* [Pen](xref:input-system-pen)
## Controls
-Each of these types implements a common set of Controls. For a more detailed descriptions of these Controls, refer to their [scripting reference](../api/UnityEngine.InputSystem.Pointer.html).
+Each of these types implements a common set of Controls. For a more detailed descriptions of these Controls, refer to their [scripting reference](xref:UnityEngine.InputSystem.Pointer).
|Control|Type|Description|
|-------|----|-----------|
-|[`position`](../api/UnityEngine.InputSystem.Pointer.html#UnityEngine_InputSystem_Pointer_position)|[`Vector2Control`](../api/UnityEngine.InputSystem.Controls.Vector2Control.html)|The current pointer coordinates in window space.|
-|[`delta`](../api/UnityEngine.InputSystem.Pointer.html#UnityEngine_InputSystem_Pointer_delta)|[`Vector2Control`](../api/UnityEngine.InputSystem.Controls.Vector2Control.html)|Provides motion delta in pixels accumulated (summed) over the duration of the current frame/update. Resets to `(0,0)` each frame. Note that the resolution of deltas depends on the specific hardware and/or platform.|
-|[`press`](../api/UnityEngine.InputSystem.Pointer.html#UnityEngine_InputSystem_Pointer_press)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|Whether the pointer or its primary button is pressed down.|
-|[`pressure`](../api/UnityEngine.InputSystem.Pointer.html#UnityEngine_InputSystem_Pointer_pressure)|[`AxisControl`](../api/UnityEngine.InputSystem.Controls.AxisControl.html)| The pressure applied with the pointer while in contact with the pointer surface. This value is normalized. This is only relevant for pressure-sensitive devices, such as tablets and some touch screens.|
-|[`radius`](../api/UnityEngine.InputSystem.Pointer.html#UnityEngine_InputSystem_Pointer_radius)|[`Vector2Control`](../api/UnityEngine.InputSystem.Controls.Vector2Control.html)|The size of the area where the finger touches the surface. This is only relevant for touch input.|
+|[`position`](xref:UnityEngine.InputSystem.Pointer.position)|[`Vector2Control`](xref:UnityEngine.InputSystem.Controls.Vector2Control)|The current pointer coordinates in window space.|
+|[`delta`](xref:UnityEngine.InputSystem.Pointer.delta)|[`Vector2Control`](xref:UnityEngine.InputSystem.Controls.Vector2Control)|Provides motion delta in pixels accumulated (summed) over the duration of the current frame/update. Resets to `(0,0)` each frame. Note that the resolution of deltas depends on the specific hardware and/or platform.|
+|[`press`](xref:UnityEngine.InputSystem.Pointer.press)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|Whether the pointer or its primary button is pressed down.|
+|[`pressure`](xref:UnityEngine.InputSystem.Pointer.pressure)|[`AxisControl`](xref:UnityEngine.InputSystem.Controls.AxisControl)| The pressure applied with the pointer while in contact with the pointer surface. This value is normalized. This is only relevant for pressure-sensitive devices, such as tablets and some touch screens.|
+|[`radius`](xref:UnityEngine.InputSystem.Pointer.radius)|[`Vector2Control`](xref:UnityEngine.InputSystem.Controls.Vector2Control)|The size of the area where the finger touches the surface. This is only relevant for touch input.|
## Window space
The coordinates within Player code are in the coordinate space of the Player window.
-Within Editor code, the coordinates are in the coordinate space of the current [`EditorWindow`](https://docs.unity3d.com/ScriptReference/EditorWindow.html). If you query [`Pointer.current.position`](../api/UnityEngine.InputSystem.Pointer.html#UnityEngine_InputSystem_Pointer_position) in [`UnityEditor.EditorWindow.OnGUI`](https://docs.unity3d.com/ScriptReference/EditorWindow.OnGUI.html), for example, the returned 2D vector will be in the coordinate space of your local GUI (same as [`UnityEngine.Event.mousePosition`](https://docs.unity3d.com/ScriptReference/Event-mousePosition.html)).
+Within Editor code, the coordinates are in the coordinate space of the current [`EditorWindow`](xref:UnityEditor.EditorWindow). If you query [`Pointer.current.position`](xref:UnityEngine.InputSystem.Pointer.position) in [`UnityEditor.EditorWindow.OnGUI`](xref:EditorWindow.OnGUI), for example, the returned 2D vector will be in the coordinate space of your local GUI (same as [`UnityEngine.Event.mousePosition`](xref:UnityEngine.Event.mousePosition)).
diff --git a/Packages/com.unity.inputsystem/Documentation~/ProcessorTypes.md b/Packages/com.unity.inputsystem/Documentation~/ProcessorTypes.md
index 3fecff6c0b..f90d02b7f1 100644
--- a/Packages/com.unity.inputsystem/Documentation~/ProcessorTypes.md
+++ b/Packages/com.unity.inputsystem/Documentation~/ProcessorTypes.md
@@ -5,28 +5,13 @@ uid: input-system-processors
Below are predefined processors. You can also create custom processors. For guidance on when to use each type, refer to [Using Processors](UsingProcessors.md).
-* [Predefined Processors](#predefined-processors)
- * [Clamp](#clamp)
- * [Invert](#invert)
- * [Invert Vector 2](#invert-vector-2)
- * [Invert Vector 3](#invert-vector-3)
- * [Normalize](#normalize)
- * [Normalize Vector 2](#normalize-vector-2)
- * [Normalize Vector 3](#normalize-vector-3)
- * [Scale](#scale)
- * [Scale Vector 2](#scale-vector-2)
- * [Scale Vector 3](#scale-vector-3)
- * [Axis deadzone](#axis-deadzone)
- * [Stick deadzone](#stick-deadzone)
-* [Writing custom Processors](#writing-custom-processors)
-
## Predefined Processors
The Input System package comes with a set of useful Processors you can use.
### Clamp
-|__Name__|[`Clamp`](../api/UnityEngine.InputSystem.Processors.ClampProcessor.html)|
+|__Name__|[`Clamp`](xref:UnityEngine.InputSystem.Processors.ClampProcessor)|
|---|---|
|__Operand Type__|`float`|
|__Parameters__|`float min` `float max`|
@@ -35,7 +20,7 @@ Clamps input values to the [`min`..`max`] range.
### Invert
-|__Name__|[`Invert`](../api/UnityEngine.InputSystem.Processors.InvertProcessor.html)|
+|__Name__|[`Invert`](xref:UnityEngine.InputSystem.Processors.InvertProcessor)|
|---|---|
|__Operand Type__|`float`|
@@ -43,7 +28,7 @@ Inverts the values from a Control (that is, multiplies the values by -1).
### Invert Vector 2
-|__Name__|[`InvertVector2`](../api/UnityEngine.InputSystem.Processors.InvertVector2Processor.html)|
+|__Name__|[`InvertVector2`](xref:UnityEngine.InputSystem.Processors.InvertVector2Processor)|
|---|---|
|__Operand Type__|`Vector2`|
|__Parameters__|`bool invertX` `bool invertY`|
@@ -52,7 +37,7 @@ Inverts the values from a Control (that is, multiplies the values by -1). Invert
### Invert Vector 3
-|__Name__|[`Invert Vector 3`](../api/UnityEngine.InputSystem.Processors.InvertVector3Processor.html)|
+|__Name__|[`Invert Vector 3`](xref:UnityEngine.InputSystem.Processors.InvertVector3Processor)|
|---|---|
|__Operand Type__|`Vector3`|
|__Parameters__|`bool invertX` `bool invertY` `bool invertZ`|
@@ -61,7 +46,7 @@ Inverts the values from a Control (that is, multiplies the values by -1). Invert
### Normalize
-|__Name__|[`Normalize`](../api/UnityEngine.InputSystem.Processors.NormalizeProcessor.html)|
+|__Name__|[`Normalize`](xref:UnityEngine.InputSystem.Processors.NormalizeProcessor)|
|---|---|
|__Operand Type__|`float`|
|__Parameters__|`float min` `float max` `float zero`|
@@ -70,7 +55,7 @@ Normalizes input values in the range [`min`..`max`] to unsigned normalized form
### Normalize Vector 2
-|__Name__|[`NormalizeVector2`](../api/UnityEngine.InputSystem.Processors.NormalizeVector2Processor.html)|
+|__Name__|[`NormalizeVector2`](xref:UnityEngine.InputSystem.Processors.NormalizeVector2Processor)|
|---|---|
|__Operand Type__|`Vector2`|
@@ -78,7 +63,7 @@ Normalizes input vectors to be of unit length (1). This is the same as calling `
### Normalize Vector 3
-|__Name__|[`NormalizeVector3`](../api/UnityEngine.InputSystem.Processors.NormalizeVector3Processor.html)|
+|__Name__|[`NormalizeVector3`](xref:UnityEngine.InputSystem.Processors.NormalizeVector3Processor)|
|---|---|
|__Operand Type__|`Vector3`|
@@ -86,7 +71,7 @@ Normalizes input vectors to be of unit length (1). This is the same as calling `
### Scale
-|__Name__|[`Scale`](../api/UnityEngine.InputSystem.Processors.ScaleProcessor.html)|
+|__Name__|[`Scale`](xref:UnityEngine.InputSystem.Processors.ScaleProcessor)|
|---|---|
|__Operand Type__|`float`|
|__Parameters__|`float factor`|
@@ -95,7 +80,7 @@ Multiplies all input values by `factor`.
### Scale Vector 2
-|__Name__|[`ScaleVector2`](../api/UnityEngine.InputSystem.Processors.ScaleVector2Processor.html)|
+|__Name__|[`ScaleVector2`](xref:UnityEngine.InputSystem.Processors.ScaleVector2Processor)|
|---|---|
|__Operand Type__|`Vector2`|
|__Parameters__|`float x` `float y`|
@@ -104,7 +89,7 @@ Multiplies all input values by `x` along the X axis and by `y` along the Y axis.
### Scale Vector 3
-|__Name__|[`ScaleVector3`](../api/UnityEngine.InputSystem.Processors.ScaleVector3Processor.html)|
+|__Name__|[`ScaleVector3`](xref:UnityEngine.InputSystem.Processors.ScaleVector3Processor)|
|---|---|
|__Operand Type__|`Vector3`|
|__Parameters__|`float x` `float y` `float x`|
@@ -113,7 +98,7 @@ Multiplies all input values by `x` along the X axis, by `y` along the Y axis, an
### Axis deadzone
-|__Name__|[`AxisDeadzone`](../api/UnityEngine.InputSystem.Processors.AxisDeadzoneProcessor.html)|
+|__Name__|[`AxisDeadzone`](xref:UnityEngine.InputSystem.Processors.AxisDeadzoneProcessor)|
|---|---|
|__Operand Type__|`float`|
|__Parameters__|`float min` `float max`|
@@ -122,7 +107,7 @@ An axis deadzone Processor scales the values of a Control so that any value with
### Stick deadzone
-|__Name__|[`StickDeadzone`](../api/UnityEngine.InputSystem.Processors.StickDeadzoneProcessor.html)|
+|__Name__|[`StickDeadzone`](xref:UnityEngine.InputSystem.Processors.StickDeadzoneProcessor)|
|---|---|
|__Operand Type__|`Vector2`|
|__Parameters__|`float min` `float max`|
@@ -131,9 +116,10 @@ A stick deadzone Processor scales the values of a Vector2 Control, such as a sti
## Writing custom Processors
-You can also write custom Processors to use in your Project. Custom Processors are available in the UI and code in the same way as the built-in Processors. Add a class derived from [`InputProcessor`](../api/UnityEngine.InputSystem.InputProcessor-1.html), and implement the [`Process`](../api/UnityEngine.InputSystem.InputProcessor-1.html#UnityEngine_InputSystem_InputProcessor_1_Process__0_UnityEngine_InputSystem_InputControl_) method:
+You can also write custom Processors to use in your Project. Custom Processors are available in the UI and code in the same way as the built-in Processors. Add a class derived from [`InputProcessor`](xref:UnityEngine.InputSystem.InputProcessor`1), and implement the [`Process`](xref:UnityEngine.InputSystem.InputProcessor`1.Process(`0,UnityEngine.InputSystem.InputControl)) method:
->__IMPORTANT__: Processors must be __stateless__. This means you cannot store local state in a processor that will change depending on the input being processed. The reason for this is because processors are not part of the [input state](./Controls.md#control-state) that the Input System keeps.
+> [!Important]
+> Processors must be __stateless__. This means you cannot store local state in a processor that will change depending on the input being processed. The reason for this is because processors are not part of the [input state](xref:input-system-controls#control-state) that the Input System keeps.
```CSharp
public class MyValueShiftProcessor : InputProcessor
@@ -148,7 +134,7 @@ public class MyValueShiftProcessor : InputProcessor
}
```
-Now, you need to tell the Input System about your Processor. Call [`InputSystem.RegisterProcessor`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_RegisterProcessor__1_System_String_) in your initialization code. You can do so locally within the Processor class like this:
+Now, you need to tell the Input System about your Processor. Call [`InputSystem.RegisterProcessor`](xref:UnityEngine.InputSystem.InputSystem.RegisterProcessor``1(System.String)) in your initialization code. You can do so locally within the Processor class like this:
```CSharp
#if UNITY_EDITOR
@@ -173,13 +159,13 @@ public class MyValueShiftProcessor : InputProcessor
}
```
-Your new Processor is now available in the in the [Input Actions Editor](ActionsEditor.md) and you can also add it in code like this:
+Your new Processor is now available in the in the [Input Actions Editor](xref:input-system-configuring-input) and you can also add it in code like this:
```CSharp
var action = new InputAction(processors: "myvalueshift(valueShift=2.3)");
```
-If you want to customize the UI for editing your Processor, create a custom [`InputParameterEditor`](../api/UnityEngine.InputSystem.Editor.InputParameterEditor-1.html) class for it:
+If you want to customize the UI for editing your Processor, create a custom [`InputParameterEditor`](xref:UnityEngine.InputSystem.Editor.InputParameterEditor`1) class for it:
```CSharp
// No registration is necessary for an InputParameterEditor.
diff --git a/Packages/com.unity.inputsystem/Documentation~/ProjectWideActions.md b/Packages/com.unity.inputsystem/Documentation~/ProjectWideActions.md
index c9cee8e64d..f411b91e19 100644
--- a/Packages/com.unity.inputsystem/Documentation~/ProjectWideActions.md
+++ b/Packages/com.unity.inputsystem/Documentation~/ProjectWideActions.md
@@ -3,13 +3,13 @@ uid: project-wide-actions
---
# Project-Wide Actions
-The Input System stores your configuration of [Input Actions](Actions.md) and their associated [Bindings](ActionBindings.md), [Action Maps](ActionsEditor.html#configure-action-maps) and [Control Schemes](ActionBindings.md#control-schemes) in an [Action Asset](ActionAssets.md) file.
+The Input System stores your configuration of [Input Actions](xref:input-system-actions) and their associated [Bindings](xref:input-system-action-bindings), [Action Maps](ActionsEditor.html#configure-action-maps) and [Control Schemes](xref:input-system-action-bindings#control-schemes) in an [Action Asset](xref:input-system-action-assets) file.
While it's possible to have more than one Action Asset in a project, most projects only ever need a single Action Asset. This is because an Action Asset can contain multiple [Action Maps](ActionsEditor.html#configure-action-maps), which each containing a set of actions relevant to the various parts of your project (such as UI navigation, gameplay, etc).
The Input System's **project-wide actions** feature allows you to choose an individual Action Asset as being available project-wide, which means the actions within that asset are available more conveniently through the Input System API without needing to set up a reference to the Actions Asset.
-The Action Asset assigned as project-wide is also a [preloaded asset](https://docs.unity3d.com/ScriptReference/PlayerSettings.GetPreloadedAssets.html), loaded when your app starts up, and kept available until it terminates.
+The Action Asset assigned as project-wide is also a [preloaded asset](xref:UnityEditor.PlayerSettings.GetPreloadedAssets), loaded when your app starts up, and kept available until it terminates.
Unless you have specific project requirements that require more than one Action Asset, the recommended workflow is to use a single Action Asset assigned as the project-wide actions, as described below.
@@ -22,7 +22,8 @@ If you don't yet have an Action Asset assigned as project-wide in your project,

*The Input System Package Project Settings with no project-wide actions assigned displays a button to create and assign a default project-wide Action Asset.*
-> **Note:** If you already have an Action Asset assigned, this button is not displayed, and instead the Actions Editor is displayed, allowing you to edit the project-wide actions.
+> [!NOTE]
+> If you already have an Action Asset assigned, this button is not displayed, and instead the Actions Editor is displayed, allowing you to edit the project-wide actions.
To create an Action Asset with default actions pre-configured, click **"Create a new project-wide Action Asset"**. The asset is created in your project, and automatically assigned as the **project-wide actions**.
@@ -32,7 +33,7 @@ The Action Asset appears in your Project view, and is named "InputSystem_Actions
## Edit project-wide actions
-Once you have created and assigned project-wide actions, the Input System Package page in Project Settings displays the **Actions Editor** interface. Read more about how to use the [Actions Editor](ActionsEditor.md) to configure your actions.
+Once you have created and assigned project-wide actions, the Input System Package page in Project Settings displays the **Actions Editor** interface. Read more about how to use the [Actions Editor](xref:input-system-configuring-input) to configure your actions.
## The default actions
@@ -46,11 +47,12 @@ You can also delete all action maps, or reset all the actions back to the defaul

-> **Note:** this **more** (⋮) menu is not available when the Actions Editor is open in a separate window, it is only present in the Project Settings window.
+> [!NOTE]
+> The **more** (⋮) menu is not available when the Actions Editor is open in a separate window, it is only present in the Project Settings window.
## Using project-wide actions in code
-The benefit of assign an Action Asset as the project-wide actions is that you can access the actions directly through the [`InputSystem.actions`](../api/UnityEngine.InputSystem.InputSystem.html) property directly, rather than needing to set up a reference to your Action Asset first.
+The benefit of assign an Action Asset as the project-wide actions is that you can access the actions directly through the [`InputSystem.actions`](xref:UnityEngine.InputSystem.InputSystem) property directly, rather than needing to set up a reference to your Action Asset first.
For example, you can get a reference to an action named "Move" in your project-wide actions using a line of code like this:
diff --git a/Packages/com.unity.inputsystem/Documentation~/QuickStartGuide.md b/Packages/com.unity.inputsystem/Documentation~/QuickStartGuide.md
index db6931ae1e..bbabdb46de 100644
--- a/Packages/com.unity.inputsystem/Documentation~/QuickStartGuide.md
+++ b/Packages/com.unity.inputsystem/Documentation~/QuickStartGuide.md
@@ -1,9 +1,11 @@
-
+---
+uid: input-system-quickstart
+---
# Quickstart Guide
-This page has a brief description of how to quickly start using the Input System. The Input System has [multiple workflows](Workflows.md) which you might prefer that offer different benefits. This quickstart guide shows a workflow which suits most common scenarios.
+This page has a brief description of how to quickly start using the Input System. The Input System has [multiple workflows](xref:input-system-workflows) which you might prefer that offer different benefits. This quickstart guide shows a workflow which suits most common scenarios.
-First, install the Input System package. For information on how to install the new Input System, see [Installation](Installation.md).
+First, install the Input System package. For information on how to install the new Input System, see [Installation](xref:input-system-installation).
## Create and assign the default project-wide actions
@@ -22,7 +24,7 @@ Once you have created and assigned some project-wide actions, the **Input Action
You can use this window to view the Actions to find out their names, value types, and what their corresponding bindings. You can also edit, delete, or add new Actions here.
-[Read more about using the Input Action Settings Window.](ActionsEditor.md)
+[Read more about using the Input Action Settings Window.](xref:input-system-configuring-input)
## The default Action Maps and Actions
@@ -89,6 +91,7 @@ public class Example : MonoBehaviour
These actions named "Move" and "Jump" in this script work straight away with no configuration required because they match the names of some of the pre-configured defaults in the Input System package.
-> **Note**: Different types of Action have different value types, and so have different methods to access their value, which is why you see `.ReadValue()` used to read a 2D axis, and `.IsPressed()` to read a button state, in the example above.
-
-> **Note:** If you create more than one Action with same name in different Action Maps, you must specify the Action Map and the Action Name separated by a `/` character when using FindAction. For example: `InputSystem.actions.FindAction("Player/Move")`
+> [!NOTE]
+> Different types of Action have different value types, and so have different methods to access their value, which is why you see `.ReadValue()` used to read a 2D axis, and `.IsPressed()` to read a button state, in the example above.
+>
+> If you create more than one Action with same name in different Action Maps, you must specify the Action Map and the Action Name separated by a `/` character when using FindAction. For example: `InputSystem.actions.FindAction("Player/Move")`
diff --git a/Packages/com.unity.inputsystem/Documentation~/RespondingToActions.md b/Packages/com.unity.inputsystem/Documentation~/RespondingToActions.md
index 4dd5abbd6b..0334da1982 100644
--- a/Packages/com.unity.inputsystem/Documentation~/RespondingToActions.md
+++ b/Packages/com.unity.inputsystem/Documentation~/RespondingToActions.md
@@ -1,4 +1,6 @@
-
+---
+uid: input-system-responding
+---
# Responding to Actions
There are two main techniques you can use to respond to Actions in your project. These are to either use **polling** or an **event-driven** approach.
@@ -13,7 +15,7 @@ For other situations where input is less frequent and directed to various differ
## Polling Actions
-You can poll the current value of an Action using [`InputAction.ReadValue<>()`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_ReadValue__1):
+You can poll the current value of an Action using [`InputAction.ReadValue<>()`](xref:UnityEngine.InputSystem.InputAction.ReadValue``1):
```CSharp
using UnityEngine;
@@ -41,14 +43,14 @@ Note that the value type has to correspond to the value type of the control that
There are two methods you can use to poll for `performed` [action callbacks](#action-callbacks) to determine whether an action was performed or stopped performing in the current frame.
-These methods differ from [`InputAction.WasPressedThisFrame()`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasPressedThisFrame) and [`InputAction.WasReleasedThisFrame()`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasReleasedThisFrame) in that these depend directly on the [Interactions](Interactions.md) driving the action (including the [default Interaction](Interactions.md#default-interaction) if no specific interaction has been added to the action or binding).
+These methods differ from [`InputAction.WasPressedThisFrame()`](xref:UnityEngine.InputSystem.InputAction.WasPressedThisFrame) and [`InputAction.WasReleasedThisFrame()`](xref:UnityEngine.InputSystem.InputAction.WasReleasedThisFrame) in that these depend directly on the [Interactions](xref:input-system-interactions) driving the action (including the [default Interaction](xref:input-system-interactions#default-interaction) if no specific interaction has been added to the action or binding).
|Method|Description|
|------|-----------|
-|[`InputAction.WasPerformedThisFrame()`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasPerformedThisFrame)|True if the [`InputAction.phase`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_phase) of the action has, at any point during the current frame, changed to [`Performed`](../api/UnityEngine.InputSystem.InputActionPhase.html#UnityEngine_InputSystem_InputActionPhase_Performed).|
-|[`InputAction.WasCompletedThisFrame()`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasCompletedThisFrame)|True if the [`InputAction.phase`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_phase) of the action has, at any point during the current frame, changed away from [`Performed`](../api/UnityEngine.InputSystem.InputActionPhase.html#UnityEngine_InputSystem_InputActionPhase_Performed) to any other phase. This can be useful for [Button](#button) actions or [Value](#value) actions with interactions like [Press](Interactions.md#press) or [Hold](Interactions.md#hold) when you want to know the frame the interaction stops being performed. For actions with the [default Interaction](Interactions.md#default-interaction), this method will always return false for [Value](#value) and [Pass-Through](#pass-through) actions (since the phase stays in [`Started`](../api/UnityEngine.InputSystem.InputActionPhase.html#UnityEngine_InputSystem_InputActionPhase_Started) for Value actions and stays in [`Performed`](../api/UnityEngine.InputSystem.InputActionPhase.html#UnityEngine_InputSystem_InputActionPhase_Performed) for Pass-Through).|
+|[`InputAction.WasPerformedThisFrame()`](xref:UnityEngine.InputSystem.InputAction.WasPerformedThisFrame)|True if the [`InputAction.phase`](xref:UnityEngine.InputSystem.InputAction.phase) of the action has, at any point during the current frame, changed to [`Performed`](xref:UnityEngine.InputSystem.InputActionPhase.Performed).|
+|[`InputAction.WasCompletedThisFrame()`](xref:UnityEngine.InputSystem.InputAction.WasCompletedThisFrame)|True if the [`InputAction.phase`](xref:UnityEngine.InputSystem.InputAction.phase) of the action has, at any point during the current frame, changed away from [`Performed`](xref:UnityEngine.InputSystem.InputActionPhase.Performed) to any other phase. This can be useful for [Button](#button) actions or [Value](#value) actions with interactions like [Press](xref:input-system-interactions#press) or [Hold](xref:input-system-interactions#hold) when you want to know the frame the interaction stops being performed. For actions with the [default Interaction](xref:input-system-interactions#default-interaction), this method will always return false for [Value](#value) and [Pass-Through](#pass-through) actions (since the phase stays in [`Started`](xref:UnityEngine.InputSystem.InputActionPhase.Started) for Value actions and stays in [`Performed`](xref:UnityEngine.InputSystem.InputActionPhase.Performed) for Pass-Through).|
-This example uses the Interact action from the [default actions](./ProjectWideActions.md#the-default-actions), which has a [Hold](Interactions.md#hold) interaction to make it perform only after the bound control is held for a period of time (for example, 0.4 seconds):
+This example uses the Interact action from the [default actions](xref:project-wide-actions#the-default-actions), which has a [Hold](xref:input-system-interactions#hold) interaction to make it perform only after the bound control is held for a period of time (for example, 0.4 seconds):
```CSharp
using UnityEngine;
@@ -82,11 +84,11 @@ Finally, there are three methods you can use to poll for button presses and rele
|Method|Description|
|------|-----------|
-|[`InputAction.IsPressed()`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_IsPressed)|True if the level of [actuation](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_EvaluateMagnitude) on the action has crossed the [press point](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_defaultButtonPressPoint) and did not yet fall to or below the [release threshold](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_buttonReleaseThreshold).|
-|[`InputAction.WasPressedThisFrame()`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasPressedThisFrame)|True if the level of [actuation](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_EvaluateMagnitude) on the action has, at any point during the current frame, reached or gone above the [press point](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_defaultButtonPressPoint).|
-|[`InputAction.WasReleasedThisFrame()`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasReleasedThisFrame)|True if the level of [actuation](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_EvaluateMagnitude) on the action has, at any point during the current frame, gone from being at or above the [press point](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_defaultButtonPressPoint) to at or below the [release threshold](../api/UnityEngine.InputSystem.InputSettings.html#UnityEngine_InputSystem_InputSettings_buttonReleaseThreshold).|
+|[`InputAction.IsPressed()`](xref:UnityEngine.InputSystem.InputAction.IsPressed)|True if the level of [actuation](xref:UnityEngine.InputSystem.InputControl.EvaluateMagnitude) on the action has crossed the [press point](xref:UnityEngine.InputSystem.InputSettings.defaultButtonPressPoint) and did not yet fall to or below the [release threshold](xref:UnityEngine.InputSystem.InputSettings.buttonReleaseThreshold).|
+|[`InputAction.WasPressedThisFrame()`](xref:UnityEngine.InputSystem.InputAction.WasPressedThisFrame)|True if the level of [actuation](xref:UnityEngine.InputSystem.InputControl.EvaluateMagnitude) on the action has, at any point during the current frame, reached or gone above the [press point](xref:UnityEngine.InputSystem.InputSettings.defaultButtonPressPoint).|
+|[`InputAction.WasReleasedThisFrame()`](xref:UnityEngine.InputSystem.InputAction.WasReleasedThisFrame)|True if the level of [actuation](xref:UnityEngine.InputSystem.InputControl.EvaluateMagnitude) on the action has, at any point during the current frame, gone from being at or above the [press point](xref:UnityEngine.InputSystem.InputSettings.defaultButtonPressPoint) to at or below the [release threshold](xref:UnityEngine.InputSystem.InputSettings.buttonReleaseThreshold).|
-This example uses three actions called Shield, Teleport and Submit (which are not included in the [default actions](./ProjectWideActions.md#the-default-actions)):
+This example uses three actions called Shield, Teleport and Submit (which are not included in the [default actions](xref:project-wide-actions#the-default-actions)):
```CSharp
using UnityEngine;
@@ -133,7 +135,7 @@ When you set up callbacks for your Action, the Action informs your code that a c
There are several ways to do this:
-1. You can use the [PlayerInput component](Workflow-PlayerInput.md) to set up callbacks in the inspector.
+1. You can use the [PlayerInput component](xref:input-system-workflow-player-input) to set up callbacks in the inspector.
1. Each Action has a [`started`, `performed`, and `canceled` callback](#action-callbacks).
1. Each Action Map has an [`actionTriggered` callback](#inputactionmapactiontriggered-callback).
1. The Input System has a global [`InputSystem.onActionChange` callback](#inputsystemonactionchange-callback).
@@ -141,7 +143,7 @@ There are several ways to do this:
#### The PlayerInput component
-The PlayerInput component is the simplest way to set up Action callbacks. It provides an interface in the inspector that allows you set up callbacks directly to your methods without requiring intermediate code. [Read more about the PlayerInput component](Workflow-PlayerInput.md).
+The PlayerInput component is the simplest way to set up Action callbacks. It provides an interface in the inspector that allows you set up callbacks directly to your methods without requiring intermediate code. [Read more about the PlayerInput component](xref:input-system-workflow-player-input).
Alternatively, you can implement callbacks entirely from your own code using the following workflow:
@@ -158,7 +160,7 @@ Every Action has a set of distinct phases it can go through in response to recei
|`Performed`|An Interaction with the Action has been completed.|
|`Canceled`|An Interaction with the Action has been canceled.|
-You can read the current phase of an action using [`InputAction.phase`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_phase).
+You can read the current phase of an action using [`InputAction.phase`](xref:UnityEngine.InputSystem.InputAction.phase).
The `Started`, `Performed`, and `Canceled` phases each have a callback associated with them:
@@ -170,11 +172,12 @@ The `Started`, `Performed`, and `Canceled` phases each have a callback associate
action.canceled += context => /* Action was canceled */;
```
-Each callback receives an [`InputAction.CallbackContext`](../api/UnityEngine.InputSystem.InputAction.CallbackContext.html) structure, which holds context information that you can use to query the current state of the Action and to read out values from Controls that triggered the Action ([`InputAction.CallbackContext.ReadValue`](../api/UnityEngine.InputSystem.InputAction.CallbackContext.html#UnityEngine_InputSystem_InputAction_CallbackContext_ReadValue__1)).
+Each callback receives an [`InputAction.CallbackContext`](xref:UnityEngine.InputSystem.InputAction.CallbackContext) structure, which holds context information that you can use to query the current state of the Action and to read out values from Controls that triggered the Action ([`InputAction.CallbackContext.ReadValue`](xref:UnityEngine.InputSystem.InputAction.CallbackContext.ReadValue``1)).
->__Note__: The contents of the structure are only valid for the duration of the callback. In particular, it isn't safe to store the received context and later access its properties from outside the callback.
+> [!NOTE]
+> The contents of the structure are only valid for the duration of the callback. In particular, it isn't safe to store the received context and later access its properties from outside the callback.
-When and how the callbacks are triggered depends on the [Interactions](Interactions.md) present on the respective Bindings. If the Bindings have no Interactions that apply to them, the [default Interaction](Interactions.md#default-interaction) applies.
+When and how the callbacks are triggered depends on the [Interactions](xref:input-system-interactions) present on the respective Bindings. If the Bindings have no Interactions that apply to them, the [default Interaction](xref:input-system-interactions#default-interaction) applies.
##### `InputActionMap.actionTriggered` callback
@@ -191,7 +194,8 @@ actionMap.actionTriggered +=
The argument received is the same `InputAction.CallbackContext` structure that you receive through the [`started`, `performed`, and `canceled` callbacks](#action-callbacks).
->__Note__: The Input System calls `InputActionMap.actionTriggered` for all three of the individual callbacks on Actions. That is, you get `started`, `performed`, and `canceled` all on a single callback.
+> [!NOTE]
+> The Input System calls `InputActionMap.actionTriggered` for all three of the individual callbacks on Actions. That is, you get `started`, `performed`, and `canceled` all on a single callback.
##### `InputSystem.onActionChange` callback
@@ -217,9 +221,10 @@ InputSystem.onActionChange +=
#### `InputActionTrace`
-You can trace Actions to generate a log of all activity that happened on a particular set of Actions. To do so, use [`InputActionTrace`](../api/UnityEngine.InputSystem.Utilities.InputActionTrace.html). This behaves in a similar way to [`InputEventTrace`](../api/UnityEngine.InputSystem.LowLevel.InputEventTrace.html) for events.
+You can trace Actions to generate a log of all activity that happened on a particular set of Actions. To do so, use [`InputActionTrace`](xref:UnityEngine.InputSystem.Utilities.InputActionTrace). This behaves in a similar way to [`InputEventTrace`](xref:UnityEngine.InputSystem.LowLevel.InputEventTrace) for events.
->__Note__: `InputActionTrace` allocates unmanaged memory and needs to be disposed of so that it doesn't create memory leaks.
+> [!NOTE]
+> `InputActionTrace` allocates unmanaged memory and needs to be disposed of so that it doesn't create memory leaks.
```CSharp
var trace = new InputActionTrace();
@@ -275,30 +280,30 @@ Once recorded, a trace can be safely read from multiple threads as long as it is
### Action types
-Each Action can be one of three different [Action types](../api/UnityEngine.InputSystem.InputActionType.html). You can select the Action type in the Input Action editor window, or by specifying the `type` parameter when calling the [`InputAction()`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction__ctor_System_String_UnityEngine_InputSystem_InputActionType_System_String_System_String_System_String_System_String_) constructor. The Action type influences how the Input System processes state changes for the Action. The default Action type is `Value`.
+Each Action can be one of three different [Action types](xref:UnityEngine.InputSystem.InputActionType). You can select the Action type in the Input Action editor window, or by specifying the `type` parameter when calling the [`InputAction()`](xref:UnityEngine.InputSystem.InputAction.#ctor(System.String,UnityEngine.InputSystem.InputActionType,System.String,System.String,System.String,System.String)) constructor. The Action type influences how the Input System processes state changes for the Action. The default Action type is `Value`.
#### Value
This is the default Action type. Use this for any inputs which should track continuous changes to the state of a Control.
- [`Value`](../api/UnityEngine.InputSystem.InputActionType.html#UnityEngine_InputSystem_InputActionType_Value) type actions continuously monitor all the Controls which are bound to the Action, and then choose the one which is the most actuated to be the Control driving the Action, and report the values from that Control in callbacks, triggered whenever the value changes. If a different bound Control actuated more, then that Control becomes the Control driving the Action, and the Action starts reporting values from that Control. This process is called [conflict resolution](ActionBindings.md#conflicting-inputs). 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.
+ [`Value`](xref:UnityEngine.InputSystem.InputActionType.Value) type actions continuously monitor all the Controls which are bound to the Action, and then choose the one which is the most actuated to be the Control driving the Action, and report the values from that Control in callbacks, triggered whenever the value changes. If a different bound Control actuated more, then that Control becomes the Control driving the Action, and the Action starts reporting values from that Control. This process is called [conflict resolution](xref:input-system-action-bindings#conflicting-inputs). 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.
-When the Action initially enables, it performs an [initial state check](ActionBindings.md#initial-state-check) of all bound Controls. If any of them is actuated, the Action then triggers a callback with the current value.
+When the Action initially enables, it performs an [initial state check](xref:input-system-action-bindings#initial-state-check) of all bound Controls. If any of them is actuated, the Action then triggers a callback with the current value.
#### Button
-This is very similar to [`Value`](../api/UnityEngine.InputSystem.InputActionType.html#UnityEngine_InputSystem_InputActionType_Value), but [`Button`](../api/UnityEngine.InputSystem.InputActionType.html#UnityEngine_InputSystem_InputActionType_Button) type Actions can only be bound to [`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html) Controls, and don't perform an initial state check like [`Value`](../api/UnityEngine.InputSystem.InputActionType.html#UnityEngine_InputSystem_InputActionType_Value) Actions do (see the Value section above). Use this for inputs that trigger an Action once every time they are pressed. The initial state check is usually not useful in such cases, because it can trigger actions if the button is still held down from a previous press when the Action was enabled.
+This is very similar to [`Value`](xref:UnityEngine.InputSystem.InputActionType.Value), but [`Button`](xref:UnityEngine.InputSystem.InputActionType.Button) type Actions can only be bound to [`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl) Controls, and don't perform an initial state check like [`Value`](xref:UnityEngine.InputSystem.InputActionType.Value) Actions do (see the Value section above). Use this for inputs that trigger an Action once every time they are pressed. The initial state check is usually not useful in such cases, because it can trigger actions if the button is still held down from a previous press when the Action was enabled.
#### Pass-Through
- [`Pass-Through`](../api/UnityEngine.InputSystem.InputActionType.html#UnityEngine_InputSystem_InputActionType_PassThrough) Actions bypass the [conflict resolution](ActionBindings.md#conflicting-inputs) process described above for `Value` Actions and don't use the concept of a specific Control driving the Action. Instead, any change to any bound Control triggers a callback with that Control's value. This is useful if you want to process all input from a set of Controls.
+ [`Pass-Through`](xref:UnityEngine.InputSystem.InputActionType.PassThrough) Actions bypass the [conflict resolution](xref:input-system-action-bindings#conflicting-inputs) process described above for `Value` Actions and don't use the concept of a specific Control driving the Action. Instead, any change to any bound Control triggers a callback with that Control's value. This is useful if you want to process all input from a set of Controls.
### Debugging Actions
-To see currently enabled Actions and their bound Controls, use the [Input Debugger](Debugging.md#debugging-actions).
+To see currently enabled Actions and their bound Controls, use the [Input Debugger](xref:input-system-debugging#debugging-actions).
-You can also use the [`InputActionVisualizer`](Debugging.md#inputactionvisualizer) component from the Visualizers sample to get an on-screen visualization of an Action's value and Interaction state in real-time.
+You can also use the [`InputActionVisualizer`](xref:input-system-debugging#inputactionvisualizer) component from the Visualizers sample to get an on-screen visualization of an Action's value and Interaction state in real-time.
### Using Actions with multiple players
-You can use the same Action definitions for multiple local players (for example, in a local co-op game). For more information, see documentation on the [Player Input Manager](PlayerInputManager.md) component.
+You can use the same Action definitions for multiple local players (for example, in a local co-op game). For more information, see documentation on the [Player Input Manager](xref:input-system-player-input-manager) component.
diff --git a/Packages/com.unity.inputsystem/Documentation~/Sensors.md b/Packages/com.unity.inputsystem/Documentation~/Sensors.md
index 4bf32b3298..059412ff99 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Sensors.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Sensors.md
@@ -3,24 +3,10 @@ uid: input-system-sensors
---
# Sensor support
-- [Sampling frequency](#sampling-frequency)
-- [`Accelerometer`](#accelerometer)
-- [`Gyroscope`](#gyroscope)
-- [`GravitySensor`](#gravitysensor)
-- [`AttitudeSensor`](#attitudesensor)
-- [`LinearAccelerationSensor`](#linearaccelerationsensor)
-- [`MagneticFieldSensor`](#magneticfieldsensor)
-- [`LightSensor`](#lightsensor)
-- [`PressureSensor`](#pressuresensor)
-- [`ProximitySensor`](#proximitysensor)
-- [`HumiditySensor`](#humiditysensor)
-- [`AmbientTemperatureSensor`](#ambienttemperaturesensor)
-- [`StepCounter`](#stepcounter)
-- [`HingeAngle`](#hingeangle)
-
-Sensors are [`InputDevices`](Devices.md) that measure environmental characteristics of the device that the content is running on. Unity currently supports sensors on iOS and Android. Android supports a wider range of sensors than iOS.
-
->__Note__: To test your app on iOS or Android in the editor with sensor input from your mobile device, you can use the Unity Remote as described [here](Debugging.md#unity-remote). This currently supports [`Accelerometer`](#accelerometer), [`Gyroscope`](#gyroscope), [`GravitySensor`](#gravitysensor), [`AttitudeSensor`](#attitudesensor), and [`LinearAccelerationSensor`](#linearaccelerationsensor).
+Sensors are [`InputDevices`](xref:input-system-devices) that measure environmental characteristics of the device that the content is running on. Unity currently supports sensors on iOS and Android. Android supports a wider range of sensors than iOS.
+
+> [!NOTE]
+> To test your app on iOS or Android in the editor with sensor input from your mobile device, you can use the Unity Remote as described [here](xref:input-system-debugging#unity-remote). This currently supports [`Accelerometer`](#accelerometer), [`Gyroscope`](#gyroscope), [`GravitySensor`](#gravitysensor), [`AttitudeSensor`](#attitudesensor), and [`LinearAccelerationSensor`](#linearaccelerationsensor).
To determine whether a particular sensor is present, you can use its `.current` getter.
@@ -30,19 +16,19 @@ if (Gyroscope.current != null)
Debug.Log("Gyroscope present");
```
-Unlike other devices, sensors are disabled by default. To enable a sensor, call [`InputSystem.EnableDevice()`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_EnableDevice_UnityEngine_InputSystem_InputDevice_)).
+Unlike other devices, sensors are disabled by default. To enable a sensor, call [`InputSystem.EnableDevice()`](xref:UnityEngine.InputSystem.InputSystem.EnableDevice(UnityEngine.InputSystem.InputDevice))).
```CSharp
InputSystem.EnableDevice(Gyroscope.current);
```
-To disable a sensor, call [`InputSystem.DisableDevice()`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_DisableDevice_UnityEngine_InputSystem_InputDevice_System_Boolean_).
+To disable a sensor, call [`InputSystem.DisableDevice()`](xref:UnityEngine.InputSystem.InputSystem.DisableDevice(UnityEngine.InputSystem.InputDevice,System.Boolean)).
```CSharp
InputSystem.DisableDevice(Gyroscope.current);
```
-To check whether a sensor is currently enabled, use [`InputDevice.enabled`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_enabled).
+To check whether a sensor is currently enabled, use [`InputDevice.enabled`](xref:UnityEngine.InputSystem.InputDevice.enabled).
```CSharp
if (Gyroscope.current.enabled)
@@ -53,26 +39,29 @@ Each sensor Device implements a single Control which represents the data read by
|Device|Android|iOS|**WebGL**|Control|Type|
|------|-------|---|-------|----|----|
-|[`Accelerometer`](#accelerometer)|Yes|Yes|Yes(1)|[`acceleration`](../api/UnityEngine.InputSystem.Accelerometer.html#UnityEngine_InputSystem_Accelerometer_acceleration)|[`Vector3Control`](../api/UnityEngine.InputSystem.Controls.Vector3Control.html)|
-|[`Gyroscope`](#gyroscope)|Yes|Yes|Yes(1)|[`angularVelocity`](../api/UnityEngine.InputSystem.Gyroscope.html#UnityEngine_InputSystem_Gyroscope_angularVelocity)|[`Vector3Control`](../api/UnityEngine.InputSystem.Controls.Vector3Control.html)|
-|[`GravitySensor`](#gravitysensor)|Yes|Yes|Yes(1)|[`gravity`](../api/UnityEngine.InputSystem.GravitySensor.html#UnityEngine_InputSystem_GravitySensor_gravity)|[`Vector3Control`](../api/UnityEngine.InputSystem.Controls.Vector3Control.html)|
-|[`AttitudeSensor`](#attitudesensor)|Yes|Yes|Yes(1)|[`attitude`](../api/UnityEngine.InputSystem.AttitudeSensor.html#properties)|[`QuaternionControl`](../api/UnityEngine.InputSystem.Controls.QuaternionControl.html)|
-|[`LinearAccelerationSensor`](#linearaccelerationsensor)|Yes|Yes|Yes(1)|[`acceleration`](../api/UnityEngine.InputSystem.LinearAccelerationSensor.html#UnityEngine_InputSystem_LinearAccelerationSensor_acceleration)|[`Vector3Control`](../api/UnityEngine.InputSystem.Controls.Vector3Control.html)|
-|[`MagneticFieldSensor`](#magneticfieldsensor)|Yes|No|No|[`magneticField`](../api/UnityEngine.InputSystem.MagneticFieldSensor.html#UnityEngine_InputSystem_MagneticFieldSensor_magneticField)|[`Vector3Control`](../api/UnityEngine.InputSystem.Controls.Vector3Control.html)|
-|[`LightSensor`](#lightsensor)|Yes|No|No|[`lightLevel`](../api/UnityEngine.InputSystem.LightSensor.html#UnityEngine_InputSystem_LightSensor_lightLevel)|[`AxisControl`](../api/UnityEngine.InputSystem.Controls.AxisControl.html)|
-|[`PressureSensor`](#pressuresensor)|Yes|No|No|[`atmosphericPressure`](../api/UnityEngine.InputSystem.PressureSensor.html#UnityEngine_InputSystem_PressureSensor_atmosphericPressure)|[`AxisControl`](../api/UnityEngine.InputSystem.Controls.AxisControl.html)|
-|[`ProximitySensor`](#proximitysensor)|Yes|No|No|[`distance`](../api/UnityEngine.InputSystem.ProximitySensor.html#UnityEngine_InputSystem_ProximitySensor_distance)|[`AxisControl`](../api/UnityEngine.InputSystem.Controls.AxisControl.html)|
-|[`HumiditySensor`](#humiditysensor)|Yes|No|No|[`relativeHumidity`](../api/UnityEngine.InputSystem.HumiditySensor.html#UnityEngine_InputSystem_HumiditySensor_relativeHumidity)|[`AxisControl`](../api/UnityEngine.InputSystem.Controls.AxisControl.html)|
-|[`AmbientTemperatureSensor`](#ambienttemperaturesensor)|Yes|No|No|[`ambientTemperature`](../api/UnityEngine.InputSystem.AmbientTemperatureSensor.html#UnityEngine_InputSystem_AmbientTemperatureSensor_ambientTemperature)|[`AxisControl`](../api/UnityEngine.InputSystem.Controls.AxisControl.html)|
-|[`StepCounter`](#stepcounter)|Yes|Yes|No|[`stepCounter`](../api/UnityEngine.InputSystem.StepCounter.html#UnityEngine_InputSystem_StepCounter_stepCounter)|[`IntegerControl`](../api/UnityEngine.InputSystem.Controls.IntegerControl.html)|
-|[`HingeAngle`](#hingeangle)|Yes|No|No|[`angle`](../api/UnityEngine.InputSystem.HingeAngle.html#UnityEngine_InputSystem_HingeAngle_angle)|[`AxisControl`](../api/UnityEngine.InputSystem.Controls.AxisControl.html)|
-
->__Notes__:
->1. Sensor support for WebGL on Android and iOS devices is available in Unity 2021.2
+|[`Accelerometer`](#accelerometer)|Yes|Yes|Yes [† ](#fn1)|[`acceleration`](xref:UnityEngine.InputSystem.Accelerometer.acceleration)|[`Vector3Control`](xref:UnityEngine.InputSystem.Controls.Vector3Control)|
+|[`Gyroscope`](#gyroscope)|Yes|Yes|Yes [† ](#fn1)|[`angularVelocity`](xref:UnityEngine.InputSystem.Gyroscope.angularVelocity)|[`Vector3Control`](xref:UnityEngine.InputSystem.Controls.Vector3Control)|
+|[`GravitySensor`](#gravitysensor)|Yes|Yes|Yes [† ](#fn1)|[`gravity`](xref:UnityEngine.InputSystem.GravitySensor.gravity)|[`Vector3Control`](xref:UnityEngine.InputSystem.Controls.Vector3Control)|
+|[`AttitudeSensor`](#attitudesensor)|Yes|Yes|Yes [† ](#fn1)|[`attitude`](xref:UnityEngine.InputSystem.AttitudeSensor.attitude)|[`QuaternionControl`](xref:UnityEngine.InputSystem.Controls.QuaternionControl)|
+|[`LinearAccelerationSensor`](#linearaccelerationsensor)|Yes|Yes|Yes [† ](#fn1)|[`acceleration`](xref:UnityEngine.InputSystem.LinearAccelerationSensor.acceleration)|[`Vector3Control`](xref:UnityEngine.InputSystem.Controls.Vector3Control)|
+|[`MagneticFieldSensor`](#magneticfieldsensor)|Yes|No|No|[`magneticField`](xref:UnityEngine.InputSystem.MagneticFieldSensor.magneticField)|[`Vector3Control`](xref:UnityEngine.InputSystem.Controls.Vector3Control)|
+|[`LightSensor`](#lightsensor)|Yes|No|No|[`lightLevel`](xref:UnityEngine.InputSystem.LightSensor.lightLevel)|[`AxisControl`](xref:UnityEngine.InputSystem.Controls.AxisControl)|
+|[`PressureSensor`](#pressuresensor)|Yes|No|No|[`atmosphericPressure`](xref:UnityEngine.InputSystem.PressureSensor.atmosphericPressure)|[`AxisControl`](xref:UnityEngine.InputSystem.Controls.AxisControl)|
+|[`ProximitySensor`](#proximitysensor)|Yes|No|No|[`distance`](xref:UnityEngine.InputSystem.ProximitySensor.distance)|[`AxisControl`](xref:UnityEngine.InputSystem.Controls.AxisControl)|
+|[`HumiditySensor`](#humiditysensor)|Yes|No|No|[`relativeHumidity`](xref:UnityEngine.InputSystem.HumiditySensor.relativeHumidity)|[`AxisControl`](xref:UnityEngine.InputSystem.Controls.AxisControl)|
+|[`AmbientTemperatureSensor`](#ambienttemperaturesensor)|Yes|No|No|[`ambientTemperature`](xref:UnityEngine.InputSystem.AmbientTemperatureSensor.ambientTemperature)|[`AxisControl`](xref:UnityEngine.InputSystem.Controls.AxisControl)|
+|[`StepCounter`](#stepcounter)|Yes|Yes|No|[`stepCounter`](xref:UnityEngine.InputSystem.StepCounter.stepCounter)|[`IntegerControl`](xref:UnityEngine.InputSystem.Controls.IntegerControl)|
+|[`HingeAngle`](#hingeangle)|Yes|No|No|[`angle`](xref:UnityEngine.InputSystem.HingeAngle.angle)|[`AxisControl`](xref:UnityEngine.InputSystem.Controls.AxisControl)|
+
+
+
+
+> [!NOTE]
+> **†** Sensor support for WebGL on Android and iOS devices is available in Unity 2021.2.
## Sampling frequency
-Sensors sample continuously at a set interval. You can set or query the sampling frequency for each sensor using the [`samplingFrequency`](../api/UnityEngine.InputSystem.Sensor.html#UnityEngine_InputSystem_Sensor_samplingFrequency) property. The frequency is expressed in Hertz (number of samples per second).
+Sensors sample continuously at a set interval. You can set or query the sampling frequency for each sensor using the [`samplingFrequency`](xref:UnityEngine.InputSystem.Sensor.samplingFrequency) property. The frequency is expressed in Hertz (number of samples per second).
```CSharp
// Get sampling frequency of gyro.
@@ -82,11 +71,11 @@ var frequency = Gyroscope.current.samplingFrequency;
Gyroscope.current.samplingFrequency = 16;
```
-## [`Accelerometer`](../api/UnityEngine.InputSystem.Accelerometer.html)
+## [`Accelerometer`](xref:UnityEngine.InputSystem.Accelerometer)
-Use the accelerometer to measure the acceleration of a device. This is useful to control content by moving a device around. It reports the acceleration measured on a device both due to moving the device around, and due to gravity pulling the device down. You can use `GravitySensor` and `LinearAccelerationSensor` to get separate values for these. Values are affected by the [__Compensate Orientation__](Settings.md#compensate-orientation) setting.
+Use the accelerometer to measure the acceleration of a device. This is useful to control content by moving a device around. It reports the acceleration measured on a device both due to moving the device around, and due to gravity pulling the device down. You can use `GravitySensor` and `LinearAccelerationSensor` to get separate values for these. Values are affected by the [__Compensate Orientation__](xref:input-system-settings#compensate-orientation) setting.
- The following code traces all input events on the [`Accelerometer.current`](../api/UnityEngine.InputSystem.Accelerometer.html) device.
+ The following code traces all input events on the [`Accelerometer.current`](xref:UnityEngine.InputSystem.Accelerometer) device.
```CSharp
private InputEventTrace trace;
@@ -108,19 +97,26 @@ Use the accelerometer to measure the acceleration of a device. This is useful to
}
```
-## [`Gyroscope`](../api/UnityEngine.InputSystem.Gyroscope.html)
+## [`Gyroscope`](xref:UnityEngine.InputSystem.Gyroscope)
+
+Use the gyroscope to measure the angular velocity of a device. This is useful to control content by rotating a device. Values are affected by the [__Compensate Orientation__](xref:input-system-settings#compensate-orientation) setting.
+
+## [`GravitySensor`](xref:UnityEngine.InputSystem.GravitySensor)
+
+Use the gravity sensor to determine the direction of the gravity vector relative to a device. This is useful to control content by device orientation. This is usually derived from a hardware `Accelerometer`, by subtracting the effect of linear acceleration (see `LinearAccelerationSensor`). Values are affected by the [__Compensate Orientation__](xref:input-system-settings#compensate-orientation) setting.
-Use the gyroscope to measure the angular velocity of a device. This is useful to control content by rotating a device. Values are affected by the [__Compensate Orientation__](Settings.md#compensate-orientation) setting.
+## [`AttitudeSensor`](xref:UnityEngine.InputSystem.AttitudeSensor)
-## [`GravitySensor`](../api/UnityEngine.InputSystem.GravitySensor.html)
+Use the attitude sensor to determine the orientation of a device. This is useful to control content by rotating a device. Values are affected by the [__Compensate Orientation__](xref:input-system-settings#compensate-orientation) setting.
-Use the gravity sensor to determine the direction of the gravity vector relative to a device. This is useful to control content by device orientation. This is usually derived from a hardware `Accelerometer`, by subtracting the effect of linear acceleration (see `LinearAccelerationSensor`). Values are affected by the [__Compensate Orientation__](Settings.md#compensate-orientation) setting.
+On Android devices, there are two types of attitude sensors:
-## [`AttitudeSensor`](../api/UnityEngine.InputSystem.AttitudeSensor.html)
+- [**RotationVector**](https://developer.android.com/reference/android/hardware/Sensor#TYPE_ROTATION_VECTOR)
+- [**GameRotationVector**](https://developer.android.com/reference/android/hardware/Sensor#TYPE_GAME_ROTATION_VECTOR)
-Use the attitude sensor to determine the orientation of a device. This is useful to control content by rotating a device. Values are affected by the [__Compensate Orientation__](Settings.md#compensate-orientation) setting.
+Some Android devices have both types of sensor, while other devices may only have one or the other type available. These two types of attitude sensor behave slightly differently to each other. You can [read about the differences between them here](https://developer.android.com/guide/topics/sensors/sensors_position#sensors-pos-gamerot).
-**Note**: On Android devices, there are two types of attitude sensors: [**RotationVector**](https://developer.android.com/reference/android/hardware/Sensor#TYPE_ROTATION_VECTOR) and [**GameRotationVector**](https://developer.android.com/reference/android/hardware/Sensor#TYPE_GAME_ROTATION_VECTOR). Some Android devices have both types of sensor, while other devices may only have one or the other type available. These two types of attitude sensor behave slightly differently to each other. You can [read about the differences between them here](https://developer.android.com/guide/topics/sensors/sensors_position#sensors-pos-gamerot). Because of this variety in what type of rotation sensors are available across devices, when you require input from a rotation sensor on Android devices, you should include code that checks for your preferred type of rotation sensor with a fallback to the alternative type of rotation sensor if it is not present. For example:
+Because of this variety in what type of rotation sensors are available across devices, when you require input from a rotation sensor on Android devices, you should include code that checks for your preferred type of rotation sensor with a fallback to the alternative type of rotation sensor if it is not present. For example:
```CSharp
AttitudeSensor attitudeSensor = InputSystem.GetDevice();
@@ -135,43 +131,45 @@ if (attitudeSensor != null)
InputSystem.EnableDevice(attitudeSensor);
```
-## [`LinearAccelerationSensor`](../api/UnityEngine.InputSystem.LinearAccelerationSensor.html)
+## [`LinearAccelerationSensor`](xref:UnityEngine.InputSystem.LinearAccelerationSensor)
-Use the accelerometer to measure the acceleration of a device. This is useful to control content by moving a device around. Linear acceleration is the acceleration of a device unaffected by gravity. This is usually derived from a hardware `Accelerometer`, by subtracting the effect of gravity (see `GravitySensor`). Values are affected by the [__Compensate Orientation__](Settings.md#compensate-orientation) setting.
+Use the accelerometer to measure the acceleration of a device. This is useful to control content by moving a device around. Linear acceleration is the acceleration of a device unaffected by gravity. This is usually derived from a hardware `Accelerometer`, by subtracting the effect of gravity (see `GravitySensor`). Values are affected by the [__Compensate Orientation__](xref:input-system-settings#compensate-orientation) setting.
-## [`MagneticFieldSensor`](../api/UnityEngine.InputSystem.MagneticFieldSensor.html)
+## [`MagneticFieldSensor`](xref:UnityEngine.InputSystem.MagneticFieldSensor)
This Input Device represents the magnetic field that affects the device which is running the content. Values are in micro-Tesla (μT) and measure the ambient magnetic field in the X, Y, and Z axis.
-## [`LightSensor`](../api/UnityEngine.InputSystem.LightSensor.html)
+## [`LightSensor`](xref:UnityEngine.InputSystem.LightSensor)
This Input Device represents the ambient light measured by the device which is running the content. Value is in SI lux units.
-## [`PressureSensor`](../api/UnityEngine.InputSystem.PressureSensor.html)
+## [`PressureSensor`](xref:UnityEngine.InputSystem.PressureSensor)
This Input Device represents the atmospheric pressure measured by the device which is running the content. Value is in in hPa (millibar).
-## [`ProximitySensor`](../api/UnityEngine.InputSystem.ProximitySensor.html)
+## [`ProximitySensor`](xref:UnityEngine.InputSystem.ProximitySensor)
This Input Device measures how close the device which is running the content is to the user. Phones typically use the proximity sensor to determine if the user is holding the phone to their ear or not. Values represent distance measured in centimeters.
->NOTE: The Samsung devices' proximity sensor is only enabled during calls and not when using speakerphone or Bluetooth earphones. This means the lock screen function won't work, allowing the user to use the display during the call. It is important to note that the proximity sensor only works during non-speakerphone or non-Bluetooth calls, as it is designed to prevent accidental touches during calls. However, the proximity sensor can work slightly differently on different Samsung phones.
+> [!NOTE]
+> The Samsung devices' proximity sensor is only enabled during calls and not when using speakerphone or Bluetooth earphones. This means the lock screen function won't work, allowing the user to use the display during the call. It is important to note that the proximity sensor only works during non-speakerphone or non-Bluetooth calls, as it is designed to prevent accidental touches during calls. However, the proximity sensor can work slightly differently on different Samsung phones.
-## [`HumiditySensor`](../api/UnityEngine.InputSystem.HumiditySensor.html)
+## [`HumiditySensor`](xref:UnityEngine.InputSystem.HumiditySensor)
This Input Device represents the ambient air humidity measured by the device which is running the content. Values represent the relative ambient air humidity in percent.
-## [`AmbientTemperatureSensor`](../api/UnityEngine.InputSystem.AmbientTemperatureSensor.html)
+## [`AmbientTemperatureSensor`](xref:UnityEngine.InputSystem.AmbientTemperatureSensor)
This Input Device represents the ambient air temperature measured by the device which is running the content. Values represent temperature in Celsius degrees.
-## [`StepCounter`](../api/UnityEngine.InputSystem.StepCounter.html)
+## [`StepCounter`](xref:UnityEngine.InputSystem.StepCounter)
This Input Device represents the user's footstep count as measured by the device which is running the content.
->NOTE: To access the pedometer on iOS/tvOS devices, you need to enable the [__Motion Usage__ setting](Settings.md#iostvos) in the [Input Settings](Settings.md).
+> [!NOTE]
+> To access the pedometer on iOS/tvOS devices, you need to enable the [__Motion Usage__ setting](xref:input-system-settings#iostvos) in the [Input Settings](xref:input-system-settings).
-## [`HingeAngle`](../api/UnityEngine.InputSystem.HingeAngle.html)
+## [`HingeAngle`](xref:UnityEngine.InputSystem.HingeAngle)
This Input Device represents hinge angle for foldable devices. For ex., Google Fold Android phone.
diff --git a/Packages/com.unity.inputsystem/Documentation~/Settings.md b/Packages/com.unity.inputsystem/Documentation~/Settings.md
index 15cc0f08e6..fc6d8a7004 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Settings.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Settings.md
@@ -3,27 +3,15 @@ uid: input-system-settings
---
# Input settings
-- [Create Settings Asset](#create-settings-asset)
-- [Update Mode](#update-mode)
-- [Background Behavior](#background-behavior)
-- [Filter Noise On Current](#filter-noise-on-current)
-- [Compensate Orientation](#compensate-orientation)
-- [Default value properties](#default-value-properties)
-- [Supported Devices](#supported-devices)
-- [Platform-specific settings](#platform-specific-settings)
-
-
To configure the Input System individually for each project, go to __Edit__ > __Project Settings…__ > __Input System Package__ from Unity's main menu.
-
-
This page describes each input setting in detail.
## Create Settings Asset
When you first view the input settings, they are not editable, and instead a button to __Create settings asset__ is displayed at the top of the input settings window.
-
+{width="486" height="239"}
If you want to customise the input settings, you must first click this button, which creates a settings asset in your Project. Once your project contains a settings asset, the __Create settings asset__ is no longer displayed, and the settings fields become editable. Unity saves changes to your settings in the settings asset when you save the project.
@@ -36,61 +24,64 @@ This setting determines when the Input System processes input. The Input System
|Type|Description|
|----|-----------|
-|[`Process Events In Dynamic Update`](../api/UnityEngine.InputSystem.InputSettings.UpdateMode.html)|The Input System processes events at irregular intervals determined by the current framerate.|
-|[`Process Events In Fixed Update`](../api/UnityEngine.InputSystem.InputSettings.UpdateMode.html)|The Input System processes events at fixed-length intervals. This corresponds to how [`MonoBehaviour.FixedUpdate`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.FixedUpdate.html) operates. The length of each interval is determined by [`Time.fixedDeltaTime`](https://docs.unity3d.com/ScriptReference/Time-fixedDeltaTime.html).|
-|[`Process Events Manually`](../api/UnityEngine.InputSystem.InputSettings.UpdateMode.html)|The Input System does not process events automatically. Instead, it processes them whenever you call [`InputSystem.Update()`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_Update).|
+|[`Process Events In Dynamic Update`](xref:UnityEngine.InputSystem.InputSettings.UpdateMode)|The Input System processes events at irregular intervals determined by the current framerate.|
+|[`Process Events In Fixed Update`](xref:UnityEngine.InputSystem.InputSettings.UpdateMode)|The Input System processes events at fixed-length intervals. This corresponds to how [`MonoBehaviour.FixedUpdate`](xref:MonoBehaviour.FixedUpdate) operates. The length of each interval is determined by [`Time.fixedDeltaTime`](xref:UnityEngine.Time.fixedDeltaTime).|
+|[`Process Events Manually`](xref:UnityEngine.InputSystem.InputSettings.UpdateMode)|The Input System does not process events automatically. Instead, it processes them whenever you call [`InputSystem.Update()`](xref:UnityEngine.InputSystem.InputSystem.Update).|
->__Note__: The system performs two additional types of updates in the form of [`InputUpdateType.BeforeRender`](../api/UnityEngine.InputSystem.LowLevel.InputUpdateType.html) (late update for XR tracking Devices) and [`InputUpdateType.Editor`](../api/UnityEngine.InputSystem.LowLevel.InputUpdateType.html) (for EditorWindows). Neither of these update types change how the application consumes input.
+> [!NOTE]
+> The system performs two additional types of updates in the form of [`InputUpdateType.BeforeRender`](xref:UnityEngine.InputSystem.LowLevel.InputUpdateType) (late update for XR tracking Devices) and [`InputUpdateType.Editor`](xref:UnityEngine.InputSystem.LowLevel.InputUpdateType) (for EditorWindows). Neither of these update types change how the application consumes input.
## Background Behavior
-Background Behaviour determines what happens when [application focus](https://docs.unity3d.com/ScriptReference/Application-isFocused.html) is lost or regained, and how input behaves while the application is not in the foreground.
+Background Behaviour determines what happens when [application focus](xref:UnityEngine.Application.isFocused) is lost or regained, and how input behaves while the application is not in the foreground.
This setting is only relevant when "Run In Background" is enabled in the [Player Settings](https://docs.unity3d.com/Manual/class-PlayerSettings.html) for the project. This setting is only supported on some platforms. On platforms such as Android and iOS, your app will not run when it is not in the foreground.
In the Editor, "Run In Background" is considered to always be enabled as the player loop is kept running regardless of whether a Game View is focused or not. Also, in development players on desktop platforms, the setting is force-enabled during the build process.
->__Note__: In the editor, `Background Behavior` is further influenced by [`Play Mode Input Behavior`](#play-mode-input-behavior). See [Background and Focus Change Behavior](Devices.md#background-and-focus-change-behavior) for a detailed breakdown. In particular, which devices are considered as [`canRunInBackground`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_canRunInBackground) partly depends on the [`Play Mode Input Behavior`](#play-mode-input-behavior) setting.
+> [!NOTE]
+> In the editor, `Background Behavior` is further influenced by [`Play Mode Input Behavior`](#play-mode-input-behavior). See [Background and Focus Change Behavior](xref:input-system-devices#background-and-focus-change-behavior) for a detailed breakdown. In particular, which devices are considered as [`canRunInBackground`](xref:UnityEngine.InputSystem.InputDevice.canRunInBackground) partly depends on the [`Play Mode Input Behavior`](#play-mode-input-behavior) setting.
|Setting|Description|
|----|-----------|
-|[`Reset And Disable Non Background Devices`](../api/UnityEngine.InputSystem.InputSettings.BackgroundBehavior.html#UnityEngine_InputSystem_InputSettings_BackgroundBehavior_ResetAndDisableNonBackgroundDevices)|When focus is lost, perform a [soft reset](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_ResetDevice_UnityEngine_InputSystem_InputDevice_System_Boolean_) on all Devices that are not marked as [`canRunInBackground`](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_canRunInBackground) and also subsequently [disable](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_DisableDevice_UnityEngine_InputSystem_InputDevice_System_Boolean_) them. Does not affect Devices marked as being able to run in the background. When focus is regained, [re-enable](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_EnableDevice_UnityEngine_InputSystem_InputDevice_) any Device that has been disabled and also issue a [sync request](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_TrySyncDevice_UnityEngine_InputSystem_InputDevice_) on these Devices in order to update their current state. If a Device is issued a sync request and does not respond to it, [soft-reset](Devices.md#device-resets) the Device. This is the default setting.|
-|[`Reset And Disable All Devices`](../api/UnityEngine.InputSystem.InputSettings.BackgroundBehavior.html#UnityEngine_InputSystem_InputSettings_BackgroundBehavior_ResetAndDisableAllDevices)|When focus is lost, perform a [soft reset](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_ResetDevice_UnityEngine_InputSystem_InputDevice_System_Boolean_) on all Devices and also subsequently [disable](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_DisableDevice_UnityEngine_InputSystem_InputDevice_System_Boolean_) them. When focus is regained, [re-enable](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_EnableDevice_UnityEngine_InputSystem_InputDevice_) all Devices and also issue a [sync request](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_TrySyncDevice_UnityEngine_InputSystem_InputDevice_) on each Device in order to update it to its current state. If a device does not respond to the sync request, [soft-reset](Devices.md#device-resets) it.|
-|[`Ignore Focus`](../api/UnityEngine.InputSystem.InputSettings.BackgroundBehavior.html#UnityEngine_InputSystem_InputSettings_BackgroundBehavior_IgnoreFocus)|Do nothing when focus is lost. When focus is regained, issue a [sync request](Devices.md#device-syncs) on all Devices.|
+|[`Reset And Disable Non Background Devices`](xref:UnityEngine.InputSystem.InputSettings.BackgroundBehavior.ResetAndDisableNonBackgroundDevices)|When focus is lost, perform a [soft reset](xref:UnityEngine.InputSystem.InputSystem.ResetDevice(UnityEngine.InputSystem.InputDevice,System.Boolean)) on all Devices that are not marked as [`canRunInBackground`](xref:UnityEngine.InputSystem.InputDevice.canRunInBackground) and also subsequently [disable](xref:UnityEngine.InputSystem.InputSystem.DisableDevice(UnityEngine.InputSystem.InputDevice,System.Boolean)) them. Does not affect Devices marked as being able to run in the background. When focus is regained, [re-enable](xref:UnityEngine.InputSystem.InputSystem.EnableDevice(UnityEngine.InputSystem.InputDevice)) any Device that has been disabled and also issue a [sync request](xref:UnityEngine.InputSystem.InputSystem.TrySyncDevice(UnityEngine.InputSystem.InputDevice)) on these Devices in order to update their current state. If a Device is issued a sync request and does not respond to it, [soft-reset](xref:input-system-devices#device-resets) the Device. This is the default setting.|
+|[`Reset And Disable All Devices`](xref:UnityEngine.InputSystem.InputSettings.BackgroundBehavior.ResetAndDisableAllDevices)|When focus is lost, perform a [soft reset](xref:UnityEngine.InputSystem.InputSystem.ResetDevice(UnityEngine.InputSystem.InputDevice,System.Boolean)) on all Devices and also subsequently [disable](xref:UnityEngine.InputSystem.InputSystem.DisableDevice(UnityEngine.InputSystem.InputDevice,System.Boolean)) them. When focus is regained, [re-enable](xref:UnityEngine.InputSystem.InputSystem.EnableDevice(UnityEngine.InputSystem.InputDevice)) all Devices and also issue a [sync request](xref:UnityEngine.InputSystem.InputSystem.TrySyncDevice(UnityEngine.InputSystem.InputDevice)) on each Device in order to update it to its current state. If a device does not respond to the sync request, [soft-reset](xref:input-system-devices#device-resets) it.|
+|[`Ignore Focus`](xref:UnityEngine.InputSystem.InputSettings.BackgroundBehavior.IgnoreFocus)|Do nothing when focus is lost. When focus is regained, issue a [sync request](xref:input-system-devices#device-syncs) on all Devices.|
-Focus behavior has implications for how [Actions](./Actions.md) behave on focus changes. When a Device is reset, Actions bound to Controls on the device will be cancelled. This ensures, for example, that a user-controlled character in your game doesn't continue to move when focus is lost while the user is pressing one of the W, A, S or D keys. The cancellation happens in such a way that Actions are guaranteed to not trigger. That is, even if an Action is set to trigger on button release, it will not get triggered when a button is down and gets reset by a [Device reset](Devices.md#device-resets).
+Focus behavior has implications for how [Actions](xref:input-system-actions) behave on focus changes. When a Device is reset, Actions bound to Controls on the device will be cancelled. This ensures, for example, that a user-controlled character in your game doesn't continue to move when focus is lost while the user is pressing one of the W, A, S or D keys. The cancellation happens in such a way that Actions are guaranteed to not trigger. That is, even if an Action is set to trigger on button release, it will not get triggered when a button is down and gets reset by a [Device reset](xref:input-system-devices#device-resets).
## Filter Noise On Current
[//]: # (REVIEW: should this be enabled by default)
-This setting is disabled by default, and it's only relevant for apps that use the `.current` properties (such as [`Gamepad.current`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_current)) in the API. If your app doesn't use these properties, leave this setting disabled. Otherwise, it adds needless overhead.
+This setting is disabled by default, and it's only relevant for apps that use the `.current` properties (such as [`Gamepad.current`](xref:UnityEngine.InputSystem.Gamepad.current)) in the API. If your app doesn't use these properties, leave this setting disabled. Otherwise, it adds needless overhead.
-Whenever there is input on a Device, the system make the respective Device `.current`. For example, if a [`Gamepad`](../api/UnityEngine.InputSystem.Gamepad.html) receives new input, [`Gamepad.current`](../api/UnityEngine.InputSystem.Gamepad.html#UnityEngine_InputSystem_Gamepad_current) is assigned to that gamepad.
+Whenever there is input on a Device, the system make the respective Device `.current`. For example, if a [`Gamepad`](xref:UnityEngine.InputSystem.Gamepad) receives new input, [`Gamepad.current`](xref:UnityEngine.InputSystem.Gamepad.current) is assigned to that gamepad.
Some Devices have noise in their input, and receive input even if nothing is interacting with them. For example, the PS4 DualShock controller generates a constant stream of input because of its built-in gyro. This means that if both an Xbox and a PS4 controller are connected, and the user is using the Xbox controller, the PS4 controller still pushes itself to the front continuously and makes itself current.
-To counteract this, enable noise filtering. When this setting is enabled and your application receives input, the system determines whether the input comes from a Device that has noisy Controls ([`InputControl.noisy`](../api/UnityEngine.InputSystem.InputControl.html#UnityEngine_InputSystem_InputControl_noisy)). If it does, the system also determines whether the given input contains any state changes on a Control that isn't flagged as noisy. If so, that Device becomes current. Otherwise, your application still consumes the input, which is also visible on the Device, but the Device doesn't become current.
+To counteract this, enable noise filtering. When this setting is enabled and your application receives input, the system determines whether the input comes from a Device that has noisy Controls ([`InputControl.noisy`](xref:UnityEngine.InputSystem.InputControl.noisy)). If it does, the system also determines whether the given input contains any state changes on a Control that isn't flagged as noisy. If so, that Device becomes current. Otherwise, your application still consumes the input, which is also visible on the Device, but the Device doesn't become current.
->__Note__: The system doesn't currently detect most forms of noise, but does detect those on gamepad sticks. This means that if the sticks wiggle a small amount but are still within deadzone limits, the Device still becomes current. This doesn't require actuating the sticks themselves. On most gamepads, there's a small tolerance within which the sticks move when the entire device moves.
+> [!NOTE]
+> The system doesn't currently detect most forms of noise, but does detect those on gamepad sticks. This means that if the sticks wiggle a small amount but are still within deadzone limits, the Device still becomes current. This doesn't require actuating the sticks themselves. On most gamepads, there's a small tolerance within which the sticks move when the entire device moves.
## Compensate Orientation
-If this setting is enabled, rotation values reported by [sensors](Sensors.md) are rotated around the Z axis as follows:
+If this setting is enabled, rotation values reported by [sensors](xref:input-system-sensors) are rotated around the Z axis as follows:
|Screen orientation|Effect on rotation values|
|---|---|
-|[`ScreenOrientation.Portrait`](https://docs.unity3d.com/ScriptReference/ScreenOrientation.html)|Values remain unchanged|
-|[`ScreenOrientation.PortraitUpsideDown`](https://docs.unity3d.com/ScriptReference/ScreenOrientation.html)|Values rotate by 180 degrees.|
-|[`ScreenOrientation.LandscapeLeft`](https://docs.unity3d.com/ScriptReference/ScreenOrientation.html)|Values rotate by 90 degrees.|
-|[`ScreenOrientation.LandscapeRight`](https://docs.unity3d.com/ScriptReference/ScreenOrientation.html)|Values rotate by 270 degrees.|
+|[`ScreenOrientation.Portrait`](xref:UnityEngine.ScreenOrientation)|Values remain unchanged|
+|[`ScreenOrientation.PortraitUpsideDown`](xref:UnityEngine.ScreenOrientation)|Values rotate by 180 degrees.|
+|[`ScreenOrientation.LandscapeLeft`](xref:UnityEngine.ScreenOrientation)|Values rotate by 90 degrees.|
+|[`ScreenOrientation.LandscapeRight`](xref:UnityEngine.ScreenOrientation)|Values rotate by 270 degrees.|
This setting affects the following sensors:
-* [`Gyroscope`](../api/UnityEngine.InputSystem.Gyroscope.html)
-* [`GravitySensor`](../api/UnityEngine.InputSystem.GravitySensor.html)
-* [`AttitudeSensor`](../api/UnityEngine.InputSystem.AttitudeSensor.html)
-* [`Accelerometer`](../api/UnityEngine.InputSystem.Accelerometer.html)
-* [`LinearAccelerationSensor`](../api/UnityEngine.InputSystem.LinearAccelerationSensor.html)
+* [`Gyroscope`](xref:UnityEngine.InputSystem.Gyroscope)
+* [`GravitySensor`](xref:UnityEngine.InputSystem.GravitySensor)
+* [`AttitudeSensor`](xref:UnityEngine.InputSystem.AttitudeSensor)
+* [`Accelerometer`](xref:UnityEngine.InputSystem.Accelerometer)
+* [`LinearAccelerationSensor`](xref:UnityEngine.InputSystem.LinearAccelerationSensor)
## Default value properties
@@ -98,24 +89,23 @@ This setting affects the following sensors:
|----|-----------|
|Default Deadzone Min|The default minimum value for [Stick Deadzone](ProcessorTypes.md#stick-deadzone) or [Axis Deadzone](ProcessorTypes.md#axis-deadzone) processors when no `min` value is explicitly set on the processor.|
|Default Deadzone Max|The default maximum value for [Stick Deadzone](ProcessorTypes.md#stick-deadzone) or [Axis Deadzone](ProcessorTypes.md#axis-deadzone) processors when no `max` value is explicitly set on the processor.|
-|Default Button Press Point|The default [press point](../api/UnityEngine.InputSystem.Controls.ButtonControl.html#UnityEngine_InputSystem_Controls_ButtonControl_pressPointOrDefault) for [Button Controls](../api/UnityEngine.InputSystem.Controls.ButtonControl.html), and for various [Interactions](Interactions.md). For button Controls which have analog physics inputs (such as triggers on a gamepad), this configures how far they need to be held down for the system to consider them pressed.|
-|Default Tap Time|Default duration for [Tap](Interactions.md#tap) and [MultiTap](Interactions.md#multitap) Interactions. Also used by by touchscreen Devices to distinguish taps from to new touches.|
-|Default Slow Tap Time|Default duration for [SlowTap](Interactions.md#tap) Interactions.|
-|Default Hold Time|Default duration for [Hold](Interactions.md#hold) Interactions.|
+|Default Button Press Point|The default [press point](xref:UnityEngine.InputSystem.Controls.ButtonControl.pressPointOrDefault) for [Button Controls](xref:UnityEngine.InputSystem.Controls.ButtonControl), and for various [Interactions](xref:input-system-interactions). For button Controls which have analog physics inputs (such as triggers on a gamepad), this configures how far they need to be held down for the system to consider them pressed.|
+|Default Tap Time|Default duration for [Tap](xref:input-system-interactions#tap) and [MultiTap](xref:input-system-interactions#multitap) Interactions. Also used by by touchscreen Devices to distinguish taps from to new touches.|
+|Default Slow Tap Time|Default duration for [SlowTap](xref:input-system-interactions#tap) Interactions.|
+|Default Hold Time|Default duration for [Hold](xref:input-system-interactions#hold) Interactions.|
|Tap Radius|Maximum distance between two finger taps on a touchscreen Device for the system to consider this a tap of the same touch (as opposed to a new touch).|
-|Multi Tap Delay Time|Default delay between taps for [MultiTap](Interactions.md#multitap) Interactions. Also used by touchscreen Devices to count multi-taps (See [`TouchControl.tapCount`](../api/UnityEngine.InputSystem.Controls.TouchControl.html#UnityEngine_InputSystem_Controls_TouchControl_tapCount)).|
+|Multi Tap Delay Time|Default delay between taps for [MultiTap](xref:input-system-interactions#multitap) Interactions. Also used by touchscreen Devices to count multi-taps (See [`TouchControl.tapCount`](xref:UnityEngine.InputSystem.Controls.TouchControl.tapCount)).|
## Supported Devices
-
-
A Project usually supports a known set of input methods. For example, a mobile app might support only touch, and a console application might support only gamepads. A cross-platform application might support gamepads, mouse, and keyboard, but might not require XR Device support.
To narrow the options that the Editor UI presents to you, and to avoid creating input Devices and consuming input that your application won't use, you can restrict the set of supported Devices on a per-project basis.
If __Supported Devices__ is empty, no restrictions apply, which means that the Input System adds any Device that Unity recognizes and processes input for it. However, if __Support Devices__ contains one or more entries, the Input System only adds Devices that are of one of the listed types.
->__Note__: When the __Support Devices__ list changes, the system removes or re-adds Devices as needed. The system always keeps information about what Devices are available for potential, which means that no Device is permanently lost as long as it stays connected.
+> [!NOTE]
+> When the __Support Devices__ list changes, the system removes or re-adds Devices as needed. The system always keeps information about what Devices are available for potential, which means that no Device is permanently lost as long as it stays connected.
To add Devices to the list, click the Add (+) icon and choose a Device from the menu that appears.
@@ -123,30 +113,31 @@ To add Devices to the list, click the Add (+) icon and choose a Device from the
In the Editor, you might want to use input Devices that the application doesn't support. For example, you might want to use a tablet in the Editor even if your application only supports gamepads.
-To force the Editor to add all locally available Devices, even if they're not in the list of __Supported Devices__, open the [Input Debugger](Debugging.md) (menu: __Window > Analysis > Input Debugger__), and select __Options > Add Devices Not Listed in 'Supported Devices'__.
+To force the Editor to add all locally available Devices, even if they're not in the list of __Supported Devices__, open the [Input Debugger](xref:input-system-debugging) (menu: __Window > Analysis > Input Debugger__), and select __Options > Add Devices Not Listed in 'Supported Devices'__.
-
+{width="486" height="297"}
->__Note__: This setting is stored as a user setting, not a project setting. This means other users who open the project in their own Editor do not share the setting.
+> [!NOTE]
+> This setting is stored as a user setting, not a project setting. This means other users who open the project in their own Editor do not share the setting.
## Platform-specific settings
### iOS/tvOS
__Motion Usage__
- Governs access to the [pedometer](Sensors.md#stepcounter) on the device. If you enable this setting, the __Description__ field becomes editable. The text you enter into the Description field is added to your application's `Info.plist`.
+ Governs access to the [pedometer](xref:input-system-sensors#stepcounter) on the device. If you enable this setting, the __Description__ field becomes editable. The text you enter into the Description field is added to your application's `Info.plist`.
### Editor
#### Play Mode Input Behavior
-__Play Mode Input Behavior__ determines how input is handled in the Editor when in play mode. Unlike in built players, in the Unity Editor the input back-ends keep running for as long as the Editor is active, regardless of whether a Game View window is focused or not. This setting determines how input should behave when focus is __not__ on any Game View – and thus [`Application.isFocused`](https://docs.unity3d.com/ScriptReference/Application-isFocused.html) is false and the player considered to be running in the background.
+__Play Mode Input Behavior__ determines how input is handled in the Editor when in play mode. Unlike in built players, in the Unity Editor the input back-ends keep running for as long as the Editor is active, regardless of whether a Game View window is focused or not. This setting determines how input should behave when focus is __not__ on any Game View – and thus [`Application.isFocused`](xref:UnityEngine.Application.isFocused) is false and the player considered to be running in the background.
|Setting|Description|
|-------|-----------|
-|[`Pointers And Keyboards Respect Game View Focus`](../api/UnityEngine.InputSystem.InputSettings.EditorInputBehaviorInPlayMode.html#UnityEngine_InputSystem_InputSettings_EditorInputBehaviorInPlayMode_PointersAndKeyboardsRespectGameViewFocus)|Only [Pointer](Pointers.md) and [Keyboard](Keyboard.md) Devices require the Game View to be focused. Other Devices will route their input into the application regardless of Game View focus. This setting essentially routes any input into the game that is, by default, not used to operate the Editor UI. So, Devices such as [gamepads](Gamepad.md) will go to the application at all times when in play mode whereas keyboard input, for example, will require explicitly giving focus to a Game View window. This setting is the default.|
-|[`All Devices Respect Game View Focus`](../api/UnityEngine.InputSystem.InputSettings.EditorInputBehaviorInPlayMode.html#UnityEngine_InputSystem_InputSettings_EditorInputBehaviorInPlayMode_AllDevicesRespectGameViewFocus)|Focus on a Game View is required for all Devices. When no Game View window is focused, all input goes to the editor and not to the application. This allows other EditorWindows to receive these inputs (from gamepads, for example).|
-|[`All Device Input Always Goes To Game View`](../api/UnityEngine.InputSystem.InputSettings.EditorInputBehaviorInPlayMode.html#UnityEngine_InputSystem_InputSettings_EditorInputBehaviorInPlayMode_AllDeviceInputAlwaysGoesToGameView)|All editor input is disabled and input is considered to be exclusive to Game Views. Also, [`Background Behavior`](#background-behavior) is to be taken literally and executed like in players. Meaning, if in a certain situation, a Device is disabled in the player, it will get disabled in the editor as well. This setting most closely aligns player behavior with editor behavior. Be aware, however, that no EditorWindows will be able to see input from Devices (this does not effect IMGUI and UITK input in the Editor in general as they do not consume input from the Input System).|
+|[`Pointers And Keyboards Respect Game View Focus`](xref:UnityEngine.InputSystem.InputSettings.EditorInputBehaviorInPlayMode.PointersAndKeyboardsRespectGameViewFocus)|Only [Pointer](xref:input-system-pointers) and [Keyboard](xref:input-system-keyboard) Devices require the Game View to be focused. Other Devices will route their input into the application regardless of Game View focus. This setting essentially routes any input into the game that is, by default, not used to operate the Editor UI. So, Devices such as [gamepads](xref:input-system-gamepad) will go to the application at all times when in play mode whereas keyboard input, for example, will require explicitly giving focus to a Game View window. This setting is the default.|
+|[`All Devices Respect Game View Focus`](xref:UnityEngine.InputSystem.InputSettings.EditorInputBehaviorInPlayMode.AllDevicesRespectGameViewFocus)|Focus on a Game View is required for all Devices. When no Game View window is focused, all input goes to the editor and not to the application. This allows other EditorWindows to receive these inputs (from gamepads, for example).|
+|[`All Device Input Always Goes To Game View`](xref:UnityEngine.InputSystem.InputSettings.EditorInputBehaviorInPlayMode.AllDeviceInputAlwaysGoesToGameView)|All editor input is disabled and input is considered to be exclusive to Game Views. Also, [`Background Behavior`](#background-behavior) is to be taken literally and executed like in players. Meaning, if in a certain situation, a Device is disabled in the player, it will get disabled in the editor as well. This setting most closely aligns player behavior with editor behavior. Be aware, however, that no EditorWindows will be able to see input from Devices (this does not effect IMGUI and UITK input in the Editor in general as they do not consume input from the Input System).|
#### Input Action Property Drawer Mode
@@ -156,6 +147,6 @@ This setting is not shown in the **Edit** > **Project Settings** window, it i
|Setting|Description|
|-------|-----------|
-|[`Compact`](../api/UnityEngine.InputSystem.InputSettings.InputActionPropertyDrawerMode.html#UnityEngine_InputSystem_InputSettings_InputActionPropertyDrawerMode_Compact)|Display the property in a compact format, using a minimal number of lines. Toggling between a reference to an input action in an asset and a directly serialized input action is done using a dropdown menu.|
-|[`Multiline Effective`](../api/UnityEngine.InputSystem.InputSettings.InputActionPropertyDrawerMode.html#UnityEngine_InputSystem_InputSettings_InputActionPropertyDrawerMode_MultilineEffective)|Display the effective action underlying the property, using multiple lines. Toggling between a reference to an input action in an asset and a directly serialized input action is done using a property that is always visible. This mode could be useful if you want to see or revert prefab overrides and hide the field that is ignored.|
-|[`Multiline Both`](../api/UnityEngine.InputSystem.InputSettings.InputActionPropertyDrawerMode.html#UnityEngine_InputSystem_InputSettings_InputActionPropertyDrawerMode_MultilineBoth)|Display both the input action and external reference underlying the property. Toggling between a reference to an input action in an asset and a directly serialized input action is done using a property that is always visible. This mode could be useful if you want to see both values of the property without needing to toggle Use Reference.|
+|[`Compact`](xref:UnityEngine.InputSystem.InputSettings.InputActionPropertyDrawerMode.Compact)|Display the property in a compact format, using a minimal number of lines. Toggling between a reference to an input action in an asset and a directly serialized input action is done using a dropdown menu.|
+|[`Multiline Effective`](xref:UnityEngine.InputSystem.InputSettings.InputActionPropertyDrawerMode.MultilineEffective)|Display the effective action underlying the property, using multiple lines. Toggling between a reference to an input action in an asset and a directly serialized input action is done using a property that is always visible. This mode could be useful if you want to see or revert prefab overrides and hide the field that is ignored.|
+|[`Multiline Both`](xref:UnityEngine.InputSystem.InputSettings.InputActionPropertyDrawerMode.MultilineBoth)|Display both the input action and external reference underlying the property. Toggling between a reference to an input action in an asset and a directly serialized input action is done using a property that is always visible. This mode could be useful if you want to see both values of the property without needing to toggle Use Reference.|
diff --git a/Packages/com.unity.inputsystem/Documentation~/SupportedDevices.md b/Packages/com.unity.inputsystem/Documentation~/SupportedDevices.md
index 0e9f5f028a..00731553ff 100644
--- a/Packages/com.unity.inputsystem/Documentation~/SupportedDevices.md
+++ b/Packages/com.unity.inputsystem/Documentation~/SupportedDevices.md
@@ -11,18 +11,18 @@ Support for the following Devices doesn't require specialized support of particu
|Device|Windows|Mac|Linux|UWP|Android|iOS|tvOS|Xbox(3)|PS4(3)|Switch(3)|WebGL|
|------|-------|---|-----|---|-------|---|----|----|---|------|-----|
-|[Mouse](Mouse.md)|Yes|Yes|Yes|Yes|Yes|No|No|Yes|Yes|No|Yes|
-|[Keyboard](Keyboard.md)|Yes|Yes|Yes|Yes|Yes|No|No|Yes|Yes|No|Yes|
-|[Pen](Pen.md)|Yes|No |No|Yes|Yes|Yes|No|No|No|No|No|
-|[Touchscreen](Touch.md)|Yes|No|No|Yes|Yes|Yes|Yes(4)|No|No|No|Yes|
-|[Sensors](Sensors.md)|No|No|No|No|Yes|Yes|No|No|No|No|Yes(5)|
+|[Mouse](xref:input-system-mouse)|Yes|Yes|Yes|Yes|Yes|No|No|Yes|Yes|No|Yes|
+|[Keyboard](xref:input-system-keyboard)|Yes|Yes|Yes|Yes|Yes|No|No|Yes|Yes|No|Yes|
+|[Pen](xref:input-system-pen)|Yes|No |No|Yes|Yes|Yes|No|No|No|No|No|
+|[Touchscreen](xref:input-system-touch)|Yes|No|No|Yes|Yes|Yes|Yes(4)|No|No|No|Yes|
+|[Sensors](xref:input-system-sensors)|No|No|No|No|Yes|Yes|No|No|No|No|Yes(5)|
|[Joystick](#other-gamepads-joysticks-and-racing-wheels) (2)|Yes|Yes|Yes|Yes|Yes|No|No|No|No|No|Yes|
->__Notes__:
->1. Joysticks are supported as generic HIDs, refer to [Other gamepads, joysticks, and racing wheels](#other-gamepads-joysticks-and-racing-wheels) to learn more.
->2. Consoles are supported using separate packages. You need to install these packages in your Project to enable console support.
->3. Indirect touches are received from Siri Remote.
->4. Sensor support for WebGL on Android and iOS devices is available in Unity 2021.2
+> [!NOTE]
+> 1. Joysticks are supported as generic HIDs, refer to [Other gamepads, joysticks, and racing wheels](#other-gamepads-joysticks-and-racing-wheels) to learn more.
+> 2. Consoles are supported using separate packages. You need to install these packages in your Project to enable console support.
+> 3. Indirect touches are received from Siri Remote.
+> 4. Sensor support for WebGL on Android and iOS devices is available in Unity 2021.2
## Gamepads
@@ -35,32 +35,33 @@ Support for the following Devices doesn't require specialized support of particu
|Switch|Yes (10)|Yes (10)|Yes|Yes|No|No|No|No|No|Yes|Sometimes (2)|
|MFi (such as SteelSeries)|No|Sometimes (12)|No|No|No|Yes|Yes|No|No|No|No|
->__Notes__:
->1. The trigger motors on the Xbox One controller are only supported on UWP and Xbox.
->2. WebGL support varies between browsers, Devices, and operating systems.
->3. XInput controllers on macOS currently require the installation of the [Xbox Controller Driver for macOS](https://github.com/360Controller/360Controller). This driver only supports only USB connections, and doesn't support wireless dongles. However, the latest generation of Xbox One controllers natively support Bluetooth, and are natively supported on Macs as HIDs without any additional drivers when connected via Bluetooth.
->4. This includes any XInput-compatible Device.
->5. Unity doesn't support motor rumble and lightbar color over Bluetooth. Unity doesn't support the gyro or accelerometer on PS4/PS5 controllers on platforms other than the PlayStation consoles. Unity also doesn't support the DualShock 4 USB Wireless Adapter. On UWP, only USB connection is supported, motor rumble and lightbar are not working correctly.
->6. Unity supports Made for iOS (MFi) certified controllers on iOS. Xbox One and PS4 controllers are only supported on iOS 13 or higher.
->7. Consoles are supported using separate packages. You need to install these packages in your Project to enable console support.
->8. Unity supports PS4 controllers on Android devices running [Android 10 or higher](https://playstation.com/en-us/support/hardware/ps4-pair-dualshock-4-wireless-with-sony-xperia-and-android).
->9. Unity supports PS5 controllers on Android devices running [Android 12 or higher](https://playstation.com/en-gb/support/hardware/pair-dualsense-controller-bluetooth/).
->10. Switch Joy-Cons are not currently supported on Windows and Mac. Some of official accessories are supported on Windows and Mac: "Hori Co HORIPAD for Nintendo Switch", "HORI Pokken Tournament DX Pro Pad", "HORI Wireless Switch Pad", "HORI Real Arcade Pro V Hayabusa in Switch Mode", "PowerA NSW Fusion Wired FightPad", "PowerA NSW Fusion Pro Controller (USB only)", "PDP Wired Fight Pad Pro: Mario", "PDP Faceoff Wired Pro Controller for Nintendo Switch", "PDP Faceoff Deluxe Wired Pro Controller for Nintendo Switch", "PDP Afterglow Wireless Switch Controller", "PDP Rockcandy Wired Controller".
->11. PS5 DualSense is supported on Windows and macOS via USB HID, though setting motor rumble and lightbar color when connected over Bluetooth is currently not supported.
->12. SteelSeries Nimbus+ supported via HID on macOS.
-On UWP only USB connection is supported, motor rumble and lightbar are not working correctly.
-On Android it's expected to be working from Android 12.
-On iOS/tvOS it's currently recognized as a generic gamepad and most controls do work.
->13. To ensure all controller types are detected on UWP, enable the HumanInterfaceDevice setting in [UWP Player Settings](https://docs.unity3d.com/Manual/class-PlayerSettingsWSA.html#Capabilities).
+> [!NOTE]
+> 1. The trigger motors on the Xbox One controller are only supported on UWP and Xbox.
+> 2. WebGL support varies between browsers, Devices, and operating systems.
+> 3. XInput controllers on macOS currently require the installation of the [Xbox Controller Driver for macOS](https://github.com/360Controller/360Controller). This driver only supports only USB connections, and doesn't support wireless dongles. However, the latest generation of Xbox One controllers natively support Bluetooth, and are natively supported on Macs as HIDs without any additional drivers when connected via Bluetooth.
+> 4. This includes any XInput-compatible Device.
+> 5. Unity doesn't support motor rumble and lightbar color over Bluetooth. Unity doesn't support the gyro or accelerometer on PS4/PS5 controllers on platforms other than the PlayStation consoles. Unity also doesn't support the DualShock 4 USB Wireless Adapter. On UWP, only USB connection is supported, motor rumble and lightbar are not working correctly.
+> 6. Unity supports Made for iOS (MFi) certified controllers on iOS. Xbox One and PS4 controllers are only supported on iOS 13 or higher.
+> 7. Consoles are supported using separate packages. You need to install these packages in your Project to enable console support.
+> 8. Unity supports PS4 controllers on Android devices running [Android 10 or higher](https://playstation.com/en-us/support/hardware/ps4-pair-dualshock-4-wireless-with-sony-xperia-and-android).
+> 9. Unity supports PS5 controllers on Android devices running [Android 12 or higher](https://playstation.com/en-gb/support/hardware/pair-dualsense-controller-bluetooth/).
+> 10. Switch Joy-Cons are not currently supported on Windows and Mac. Some of official accessories are supported on Windows and Mac: "Hori Co HORIPAD for Nintendo Switch", "HORI Pokken Tournament DX Pro Pad", "HORI Wireless Switch Pad", "HORI Real Arcade Pro V Hayabusa in Switch Mode", "PowerA NSW Fusion Wired FightPad", "PowerA NSW Fusion Pro Controller (USB only)", "PDP Wired Fight Pad Pro: Mario", "PDP Faceoff Wired Pro Controller for Nintendo Switch", "PDP Faceoff Deluxe Wired Pro Controller for Nintendo Switch", "PDP Afterglow Wireless Switch Controller", "PDP Rockcandy Wired Controller".
+> 11. PS5 DualSense is supported on Windows and macOS via USB HID, though setting motor rumble and lightbar color when connected over Bluetooth is currently not supported.
+> 12. SteelSeries Nimbus+ supported via HID on macOS.
+> - On UWP only USB connection is supported, motor rumble and lightbar are not working correctly.
+> - On Android it's expected to be working from Android 12.
+> - On iOS/tvOS it's currently recognized as a generic gamepad and most controls do work.
+> 13. To ensure all controller types are detected on UWP, enable the HumanInterfaceDevice setting in [UWP Player Settings](https://docs.unity3d.com/Manual/class-PlayerSettingsWSA.html#Capabilities).
### WebGL
-The Input System supports the *Standard Gamepad* mapping as specified in the [W3C Gamepad Specification](https://www.w3.org/TR/gamepad/#remapping). It also supports gamepads and joysticks that the browser surfaces without a mapping, but this support is generally limited to detecting the axes and buttons which are present, without any context as to what they mean. This means gamepads and joysticks are generally only useful when [the user manually remaps them](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.html). The Input System reports these Devices as generic [`Joysticks`](../api/UnityEngine.InputSystem.Joystick.html).
+The Input System supports the *Standard Gamepad* mapping as specified in the [W3C Gamepad Specification](https://www.w3.org/TR/gamepad/#remapping). It also supports gamepads and joysticks that the browser surfaces without a mapping, but this support is generally limited to detecting the axes and buttons which are present, without any context as to what they mean. This means gamepads and joysticks are generally only useful when [the user manually remaps them](xref:UnityEngine.InputSystem.InputActionRebindingExtensions). The Input System reports these Devices as generic [`Joysticks`](xref:UnityEngine.InputSystem.Joystick).
Support varies between browsers, Devices, and operating systems, and further differs for different browser versions, so it's not feasible to provide an up-to-date compatibility list. At the time of this publication (September 2019), Safari, Chrome, Edge, and Firefox all support the gamepad API, but only Chrome reliably maps common gamepads (Xbox and PlayStation controllers) to the W3C Standard Gamepad mapping, which allows the Input System to correctly identify and map controls.
->__Note__: WebGL currently doesn't support rumble.
+> [!NOTE]
+> WebGL currently doesn't support rumble.
## Other gamepads, joysticks, and racing wheels
-The Input System supports any Device which implements the USB HID specification. However, for Devices which don't have specific [layouts](Layouts.md) implemented in the Input System, the system can only surface the information available from the HID descriptor of the Device, which limits how precisely it can describe a control. These Devices often work best when allowing the user to [manually remap the controls](../api/UnityEngine.InputSystem.InputActionRebindingExtensions.html). If you need to support a specific Device, you can also [add your own mapping for it](HID.md#creating-a-custom-device-layout). See documentation on [HID](HID.md) for more information.
+The Input System supports any Device which implements the USB HID specification. However, for Devices which don't have specific [layouts](xref:input-system-layouts) implemented in the Input System, the system can only surface the information available from the HID descriptor of the Device, which limits how precisely it can describe a control. These Devices often work best when allowing the user to [manually remap the controls](xref:UnityEngine.InputSystem.InputActionRebindingExtensions). If you need to support a specific Device, you can also [add your own mapping for it](xref:input-system-hid#creating-a-custom-device-layout). See documentation on [HID](xref:input-system-hid) for more information.
diff --git a/Packages/com.unity.inputsystem/Documentation~/TableOfContents.md b/Packages/com.unity.inputsystem/Documentation~/TableOfContents.md
index 13609af73e..7f48ede325 100644
--- a/Packages/com.unity.inputsystem/Documentation~/TableOfContents.md
+++ b/Packages/com.unity.inputsystem/Documentation~/TableOfContents.md
@@ -1,59 +1,59 @@
-* [Introduction](index.md)
- * [Installation](Installation.md)
- * [Quickstart Guide](QuickStartGuide.md)
- * [Concepts](Concepts.md)
- * [Workflows](Workflows.md)
- * [Workflow - Actions](Workflow-Actions.md)
- * [Workflow - Actions & PlayerInput](Workflow-PlayerInput.md)
- * [Workflow - Direct](Workflow-Direct.md)
+* [Introduction](xref:input-system-index)
+ * [Installation](xref:input-system-installation)
+ * [Quickstart Guide](xref:input-system-quickstart)
+ * [Concepts](xref:basic-concepts)
+ * [Workflows](xref:input-system-workflows)
+ * [Workflow - Actions](xref:input-system-workflow-project-wide-actions)
+ * [Workflow - Actions & PlayerInput](xref:input-system-workflow-player-input)
+ * [Workflow - Direct](xref:input-system-workflow-direct)
* [Using the Input System]()
- * [Project-Wide Actions](ProjectWideActions.md)
- * [Configuring Input](ActionsEditor.md)
- * [Actions](Actions.md)
- * [Responding to Actions](RespondingToActions.md)
- * [Input Action Assets](ActionAssets.md)
- * [Input Bindings](ActionBindings.md)
- * [Interactions](Interactions.md)
- * [Devices](Devices.md)
- * [Controls](Controls.md)
+ * [Project-Wide Actions](xref:project-wide-actions)
+ * [Configuring Input](xref:input-system-configuring-input)
+ * [Actions](xref:input-system-actions)
+ * [Responding to Actions](xref:input-system-responding)
+ * [Input Action Assets](xref:input-system-action-assets)
+ * [Input Bindings](xref:input-system-action-bindings)
+ * [Interactions](xref:input-system-interactions)
+ * [Devices](xref:input-system-devices)
+ * [Controls](xref:input-system-controls)
* [Processors]()
* [Processors and their use](UsingProcessors.md)
- * [How to apply Processors](HowToApplyProcessors.md)
+ * [How to apply Processors](xref:input-system-processors)
* [Processor Types](ProcessorTypes.md)
- * [Player Input Component](PlayerInput.md)
- * [Player Input Manager Component](PlayerInputManager.md)
- * [Input settings](Settings.md)
- * [Tracked Input Devices](TrackedInputDevices.md)
+ * [Player Input Component](xref:input-system-player-input)
+ * [Player Input Manager Component](xref:input-system-player-input-manager)
+ * [Input settings](xref:input-system-settings)
+ * [Tracked Input Devices](xref:input-system-tracked-input-devices)
* [Advanced Topics]()
- * [Events](Events.md)
- * [Layouts](Layouts.md)
- * [User Management](UserManagement.md)
- * [Timing and latency](timing-and-latency.md)
- * [Input events queue](timing-input-events-queue.md)
- * [Select an input processing mode](timing-select-mode.md)
- * [Optimize for dynamic update](timing-optimize-dynamic-update.md)
- * [Optimize for fixed update](timing-optimize-fixed-update.md)
- * [Avoid missed or duplicate events](timing-missed-duplicate-events.md)
- * [Mixed timing scenarios](timing-mixed-scenarios.md)
-* [Supported Input Devices](SupportedDevices.md)
- * [Pointers](Pointers.md)
- * [Touch support](Touch.md)
- * [Mouse support](Mouse.md)
- * [Pen, tablet, and stylus support](Pen.md)
- * [Keyboard support](Keyboard.md)
- * [Gamepad support](Gamepad.md)
- * [Joystick support](Joystick.md)
- * [Sensor support](Sensors.md)
- * [HID support](HID.md)
-* [UI support](UISupport.md)
- * [On-screen Controls](OnScreen.md)
-* [Editor Features](EditorFeatures.md)
- * [Using Input in the Editor](UseInEditor.md)
- * [Debugging](Debugging.md)
- * [Input testing](Testing.md)
-* [How do I...?](HowDoI.md)
-* [Architecture](Architecture.md)
-* [Migrating from the old Input Manager](Migration.md)
-* [Contributing](Contributing.md)
-* [Known Limitations](KnownLimitations.md)
+ * [Events](xref:input-system-events)
+ * [Layouts](xref:input-system-layouts)
+ * [User Management](xref:input-system-user-management)
+ * [Timing and latency](xref:timing-latency)
+ * [Input events queue](xref:input-system-timing-queue)
+ * [Select an input processing mode](xref:input-system-timing-select)
+ * [Optimize for dynamic update](xref:input-system-timing-optimize-dynamic)
+ * [Optimize for fixed update](xref:input-system-timing-optimize-fixed)
+ * [Avoid missed or duplicate events](xref:input-system-timing-missed)
+ * [Mixed timing scenarios](xref:input-system-timing-mixed)
+* [Supported Input Devices](xref:input-system-supported-devices)
+ * [Pointers](xref:input-system-pointers)
+ * [Touch support](xref:input-system-touch)
+ * [Mouse support](xref:input-system-mouse)
+ * [Pen, tablet, and stylus support](xref:input-system-pen)
+ * [Keyboard support](xref:input-system-keyboard)
+ * [Gamepad support](xref:input-system-gamepad)
+ * [Joystick support](xref:input-system-joystick)
+ * [Sensor support](xref:input-system-sensors)
+ * [HID support](xref:input-system-hid)
+* [UI support](xref:input-system-ui-support)
+ * [On-screen Controls](xref:input-system-on-screen)
+* [Editor Features](xref:input-system-editor-features)
+ * [Using Input in the Editor](xref:input-system-use-in-editor)
+ * [Debugging](xref:input-system-debugging)
+ * [Input testing](xref:input-system-testing)
+* [How do I...?](xref:input-system-how-do-i)
+* [Architecture](xref:input-system-architecture)
+* [Migrating from the old Input Manager](xref:input-system-migration)
+* [Contributing](xref:input-system-contributing)
+* [Known Limitations](xref:input-system-known-limitations)
diff --git a/Packages/com.unity.inputsystem/Documentation~/Testing.md b/Packages/com.unity.inputsystem/Documentation~/Testing.md
index 84dd300451..42395f8668 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Testing.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Testing.md
@@ -19,13 +19,14 @@ To set up a test assembly that uses the Input System's automation framework, fol
2. Create a new assembly definition (menu: __Create > Assembly Definition__) or go to an assembly definition for a test assembly that you have already created.
3. Add references to `nunit.framework.dll`, `UnityEngine.TestRunner`, and `UnityEditor.TestRunner` (as described in [How to create a new test assembly](https://docs.unity3d.com/Packages/com.unity.test-framework@1.0/manual/workflow-create-test-assembly.html)), as well as `Unity.InputSystem` and `Unity.InputSystem.TestFramework` for the Input System.
-
+{width="486" height="667"}
## Setting up test fixtures
-Use [`InputTestFixture`](../api/UnityEngine.InputSystem.InputTestFixture.html) to create an isolated version of the Input System for tests. The fixture sets up a blank, default-initialized version of the Input System for each test, and restores the Input System to its original state after the test completes. The default-initialized version has all built-in registrations (such as layout and processors), but doesn't have any pre-existing Input Devices.
+Use [`InputTestFixture`](xref:UnityEngine.InputSystem.InputTestFixture) to create an isolated version of the Input System for tests. The fixture sets up a blank, default-initialized version of the Input System for each test, and restores the Input System to its original state after the test completes. The default-initialized version has all built-in registrations (such as layout and processors), but doesn't have any pre-existing Input Devices.
->__NOTE:__ [`InputTestFixture`](../api/UnityEngine.InputSystem.InputTestFixture.html) will not have custom registrations performed from Unity startup code such as `[InitializeOnLoad]` or `[RuntimeInitializeOnLoadMethod]`. Layouts needed during tests have to be manually registered as part of the test setup.
+> [!NOTE]
+> [`InputTestFixture`](xref:UnityEngine.InputSystem.InputTestFixture) will not have custom registrations performed from Unity startup code such as `[InitializeOnLoad]` or `[RuntimeInitializeOnLoadMethod]`. Layouts needed during tests have to be manually registered as part of the test setup.
You can use the fixture as a base class for your own fixture:
@@ -59,7 +60,8 @@ class MyTests : InputTestFixture
}
```
->__IMPORTANT:__ If you do this, do __not__ add a `[SetUp]` or `[TearDown]` method. Doing so will cause the methods in [`InputTestFixture`](../api/UnityEngine.InputSystem.InputTestFixture.html) to not be called, thus leading to the test fixture not properly initializing or shutting down. Instead, override the `Setup` and/or `TearDown` method inherited from `InputTestFixture`.
+> [!IMPORTANT]
+> If you do this, do __not__ add a `[SetUp]` or `[TearDown]` method. Doing so will cause the methods in [`InputTestFixture`](xref:UnityEngine.InputSystem.InputTestFixture) to not be called, thus leading to the test fixture not properly initializing or shutting down. Instead, override the `Setup` and/or `TearDown` method inherited from `InputTestFixture`.
Alternatively, you can instantiate it in your fixture:
@@ -116,11 +118,11 @@ public class GameTestPrebuildSetup : IPrebuildSetup
#endif
```
-Note that you do __not__ generally need to clean up any input-related data you set up. This includes devices you add, layouts you registered, [`InputSettings`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_settings) you modify, and any other alteration to the state of [`InputSystem`](../api/UnityEngine.InputSystem.InputSystem.html). [`InputTestFixture`](../api/UnityEngine.InputSystem.InputTestFixture.html) will automatically throw away the current state of the Input System and restore the state from before the test was started.
+Note that you do __not__ generally need to clean up any input-related data you set up. This includes devices you add, layouts you registered, [`InputSettings`](xref:UnityEngine.InputSystem.InputSystem.settings) you modify, and any other alteration to the state of [`InputSystem`](xref:UnityEngine.InputSystem.InputSystem). [`InputTestFixture`](xref:UnityEngine.InputSystem.InputTestFixture) will automatically throw away the current state of the Input System and restore the state from before the test was started.
## Writing tests
-When writing a test, use [`InputSystem.AddDevice()`](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_AddDevice__1_System_String_) to add new Devices.
+When writing a test, use [`InputSystem.AddDevice()`](xref:UnityEngine.InputSystem.InputSystem.AddDevice``1(System.String)) to add new Devices.
```CSharp
[Test]
@@ -142,7 +144,7 @@ When writing a test, use [`InputSystem.AddDevice()`](../api/UnityEngine.Input
}
```
-To feed input, the easiest way is to use the [`Press(button)`](../api/UnityEngine.InputSystem.InputTestFixture.html#UnityEngine_InputSystem_InputTestFixture_Press_UnityEngine_InputSystem_Controls_ButtonControl_System_Double_System_Double_System_Boolean_), [`Release(button)`](../api/UnityEngine.InputSystem.InputTestFixture.html#UnityEngine_InputSystem_InputTestFixture_Release_UnityEngine_InputSystem_Controls_ButtonControl_System_Double_System_Double_System_Boolean_), [`PressAndRelease(button)`](../api/UnityEngine.InputSystem.InputTestFixture.html#UnityEngine_InputSystem_InputTestFixture_PressAndRelease_UnityEngine_InputSystem_Controls_ButtonControl_System_Double_System_Double_System_Boolean_), `Set(control,value)`, and [`Trigger(action)`](../api/UnityEngine.InputSystem.InputTestFixture.html#UnityEngine_InputSystem_InputTestFixture_Trigger_UnityEngine_InputSystem_InputAction_) helper methods provided by [`InputTestFixture`](../api/UnityEngine.InputSystem.InputTestFixture.html).
+To feed input, the easiest way is to use the [`Press(ButtonControl, double, double, bool)`](xref:UnityEngine.InputSystem.InputTestFixture.Press(ButtonControl,System.Double,System.Double,System.Boolean)), [`Release(ButtonControl, double, double, bool)`](xref:UnityEngine.InputSystem.InputTestFixture.PressAndRelease(ButtonControl,System.Double,System.Double,System.Boolean)), [`PressAndRelease(ButtonControl, double, double, bool)`](xref:UnityEngine.InputSystem.InputTestFixture.PressAndRelease(ButtonControl,System.Double,System.Double,System.Boolean)), [`Set(InputControl, TValue, double, double, bool)`](xref:UnityEngine.InputSystem.InputTestFixture.Set``1(InputControl{``0},``0,System.Double,System.Double,System.Boolean)), and [`Trigger(InputAction)`](xref:UnityEngine.InputSystem.InputTestFixture.Trigger(InputAction)) helper methods provided by [`InputTestFixture`](xref:UnityEngine.InputSystem.InputTestFixture).
```CSharp
[Test]
@@ -221,4 +223,5 @@ Alternatively, you can use code to feed arbitrary input events into the system,
}
```
->__Note__: For reference, you can find the tests for the Input System itself in its [GitHub repository](https://github.com/Unity-Technologies/InputSystem/tree/stable/Assets/Tests/InputSystem).
+> [!NOTE]
+> For reference, you can find the tests for the Input System itself in its [GitHub repository](https://github.com/Unity-Technologies/InputSystem/tree/stable/Assets/Tests/InputSystem).
diff --git a/Packages/com.unity.inputsystem/Documentation~/Touch.md b/Packages/com.unity.inputsystem/Documentation~/Touch.md
index d50809eea8..1313a02430 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Touch.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Touch.md
@@ -3,72 +3,66 @@ uid: input-system-touch
---
# Touch support
-- [Touch support](#touch-support)
- - [`Touchscreen` Device](#touchscreen-device)
- - [Controls](#controls)
- - [Using touch with Actions](#using-touch-with-actions)
- - [`EnhancedTouch.Touch` Class](#enhancedtouchtouch-class)
- - [Touch Simulation](#touch-simulation)
- - [Reading all touches](#reading-all-touches)
-
Touch support is divided into:
* low-level support implemented in the [`Touchscreen`](#touchscreen-device) class.
* high-level support implemented in the [`EnhancedTouch.Touch`](#enhancedtouchtouch-class) class.
->__Note__: You should not use [`Touchscreen`](#touchscreen-device) for polling. If you want to read out touches similar to [`UnityEngine.Input.touches`](https://docs.unity3d.com/ScriptReference/Input-touches.html), see [`EnhancedTouch`](#enhancedtouchtouch-class). If you read out touch state from [`Touchscreen`](#touchscreen-device) directly inside of the `Update` or `FixedUpdate` methods, your app will miss changes in touch state.
+> [!NOTE]
+> You should not use [`Touchscreen`](#touchscreen-device) for polling. If you want to read out touches similar to [`UnityEngine.Input.touches`](xref:UnityEngine.Input.touches), see [`EnhancedTouch`](#enhancedtouchtouch-class). If you read out touch state from [`Touchscreen`](#touchscreen-device) directly inside of the `Update` or `FixedUpdate` methods, your app will miss changes in touch state.
Touch input is supported on Android, iOS, Windows, and the Universal Windows Platform (UWP).
->__Note__: To test your app on iOS or Android in the editor with touch input from your mobile device, you can use the Unity Remote as described [here](Debugging.md#unity-remote).
+> [!NOTE]
+> To test your app on iOS or Android in the editor with touch input from your mobile device, you can use the Unity Remote as described [here](xref:input-system-debugging#unity-remote).
## `Touchscreen` Device
-At the lowest level, a touch screen is represented by an [`InputSystem.Touchscreen`](../api/UnityEngine.InputSystem.Touchscreen.html) Device which captures the touch screen's raw state. Touch screens are based on the [`Pointer`](Pointers.md) layout.
+At the lowest level, a touch screen is represented by an [`InputSystem.Touchscreen`](xref:UnityEngine.InputSystem.Touchscreen) Device which captures the touch screen's raw state. Touch screens are based on the [`Pointer`](xref:input-system-pointers) layout.
-To query the touch screen that was last used or last added, use [`Touchscreen.current`](../api/UnityEngine.InputSystem.Touchscreen.html#UnityEngine_InputSystem_Touchscreen_current).
+To query the touch screen that was last used or last added, use [`Touchscreen.current`](xref:UnityEngine.InputSystem.Touchscreen.current).
### Controls
-Additional to the [Controls inherited from `Pointer`](Pointers.md#controls), touch screen Devices implement the following Controls:
+Additional to the [Controls inherited from `Pointer`](xref:input-system-pointers#controls), touch screen Devices implement the following Controls:
|Control|Type|Description|
|-------|----|-----------|
-|[`primaryTouch`](../api/UnityEngine.InputSystem.Touchscreen.html#UnityEngine_InputSystem_Touchscreen_primaryTouch)|[`TouchControl`](../api/UnityEngine.InputSystem.Controls.TouchControl.html)|A touch Control that represents the primary touch of the screen. The primary touch drives the [`Pointer`](Pointers.md) representation on the Device.|
-|[`touches`](../api/UnityEngine.InputSystem.Touchscreen.html#UnityEngine_InputSystem_Touchscreen_touches)|[`ReadOnlyArray`](../api/UnityEngine.InputSystem.Controls.TouchControl.html)|An array of touch Controls that represents all the touches on the Device.|
+|[`primaryTouch`](xref:UnityEngine.InputSystem.Touchscreen.primaryTouch)|[`TouchControl`](xref:UnityEngine.InputSystem.Controls.TouchControl)|A touch Control that represents the primary touch of the screen. The primary touch drives the [`Pointer`](xref:input-system-pointers) representation on the Device.|
+|[`touches`](xref:UnityEngine.InputSystem.Touchscreen.touches)|[`ReadOnlyArray`](xref:UnityEngine.InputSystem.Controls.TouchControl)|An array of touch Controls that represents all the touches on the Device.|
-A touch screen Device consists of multiple [`TouchControls`](../api/UnityEngine.InputSystem.Controls.TouchControl.html). Each of these represents a potential finger touching the Device. The [`primaryTouch`](../api/UnityEngine.InputSystem.Touchscreen.html#UnityEngine_InputSystem_Touchscreen_primaryTouch) Control represents the touch which is currently driving the [`Pointer`](Pointers.md) representation, and which should be used to interact with the UI. This is usually the first finger that touches the screen.
+A touch screen Device consists of multiple [`TouchControls`](xref:UnityEngine.InputSystem.Controls.TouchControl). Each of these represents a potential finger touching the Device. The [`primaryTouch`](xref:UnityEngine.InputSystem.Touchscreen.primaryTouch) Control represents the touch which is currently driving the [`Pointer`](xref:input-system-pointers) representation, and which should be used to interact with the UI. This is usually the first finger that touches the screen.
- [`primaryTouch`](../api/UnityEngine.InputSystem.Touchscreen.html#UnityEngine_InputSystem_Touchscreen_primaryTouch) is always identical to one of the entries in the [`touches`](../api/UnityEngine.InputSystem.Touchscreen.html#UnityEngine_InputSystem_Touchscreen_touches) array. The [`touches`](../api/UnityEngine.InputSystem.Touchscreen.html#UnityEngine_InputSystem_Touchscreen_touches) array contains all the touches that the system can track. This array has a fixed size, regardless of how many touches are currently active. If you need an API that only represents active touches, see the higher-level [`EnhancedTouch.Touch` class](#enhancedtouchtouch-class).
+ [`primaryTouch`](xref:UnityEngine.InputSystem.Touchscreen.primaryTouch) is always identical to one of the entries in the [`touches`](xref:UnityEngine.InputSystem.Touchscreen.touches) array. The [`touches`](xref:UnityEngine.InputSystem.Touchscreen.touches) array contains all the touches that the system can track. This array has a fixed size, regardless of how many touches are currently active. If you need an API that only represents active touches, see the higher-level [`EnhancedTouch.Touch` class](#enhancedtouchtouch-class).
-Each [`TouchControl`](../api/UnityEngine.InputSystem.Controls.TouchControl.html) on the Device, including [`primaryTouch`](../api/UnityEngine.InputSystem.Touchscreen.html#UnityEngine_InputSystem_Touchscreen_primaryTouch), is made up of the following child Controls:
+Each [`TouchControl`](xref:UnityEngine.InputSystem.Controls.TouchControl) on the Device, including [`primaryTouch`](xref:UnityEngine.InputSystem.Touchscreen.primaryTouch), is made up of the following child Controls:
|Control|Type|Description|
|-------|----|-----------|
-|[`position`](../api/UnityEngine.InputSystem.Controls.TouchControl.html#UnityEngine_InputSystem_Controls_TouchControl_position)|[`Vector2Control`](../api/UnityEngine.InputSystem.Controls.Vector2Control.html)|Absolute position on the touch surface.|
-|[`delta`](../api/UnityEngine.InputSystem.Controls.TouchControl.html#UnityEngine_InputSystem_Controls_TouchControl_delta)|[`Vector2Control`](../api/UnityEngine.InputSystem.Controls.Vector2Control.html)|The difference in `position` since the last frame.|
-|[`startPosition`](../api/UnityEngine.InputSystem.Controls.TouchControl.html#UnityEngine_InputSystem_Controls_TouchControl_startPosition)|[`Vector2Control`](../api/UnityEngine.InputSystem.Controls.Vector2Control.html)|The `position` where the finger first touched the surface.|
-|[`startTime`](../api/UnityEngine.InputSystem.Controls.TouchControl.html#UnityEngine_InputSystem_Controls_TouchControl_startTime)|[`DoubleControl`](../api/UnityEngine.InputSystem.Controls.IntegerControl.html)|The time when the finger first touched the surface.|
-|[`press`](../api/UnityEngine.InputSystem.Controls.TouchControl.html#UnityEngine_InputSystem_Controls_TouchControl_press)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|Whether the finger is pressed down.|
-|[`pressure`](../api/UnityEngine.InputSystem.Controls.TouchControl.html#UnityEngine_InputSystem_Controls_TouchControl_pressure)|[`AxisControl`](../api/UnityEngine.InputSystem.Controls.AxisControl.html)|Normalized pressure with which the finger is currently pressed while in contact with the pointer surface.|
-|[`radius`](../api/UnityEngine.InputSystem.Controls.TouchControl.html#UnityEngine_InputSystem_Controls_TouchControl_radius)|[`Vector2Control`](../api/UnityEngine.InputSystem.Controls.Vector2Control.html)|The size of the area where the finger touches the surface.|
-|[`touchId`](../api/UnityEngine.InputSystem.Controls.TouchControl.html#UnityEngine_InputSystem_Controls_TouchControl_touchId)|[`IntegerControl`](../api/UnityEngine.InputSystem.Controls.IntegerControl.html)|The ID of the touch. This allows you to distinguish individual touches.|
-|[`phase`](../api/UnityEngine.InputSystem.Controls.TouchControl.html#UnityEngine_InputSystem_Controls_TouchControl_phase)|[`TouchPhaseControl`](../api/UnityEngine.InputSystem.Controls.TouchPhaseControl.html)|A Control that reports the current [`TouchPhase`](../api/UnityEngine.InputSystem.TouchPhase.html) of the touch.|
-|[`tap`](../api/UnityEngine.InputSystem.Controls.TouchControl.html#UnityEngine_InputSystem_Controls_TouchControl_tap)|[`ButtonControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|A button Control that reports whether the OS recognizes a tap gesture from this touch.|
-|[`tapCount`](../api/UnityEngine.InputSystem.Controls.TouchControl.html#UnityEngine_InputSystem_Controls_TouchControl_tapCount)|[`IntegerControl`](../api/UnityEngine.InputSystem.Controls.ButtonControl.html)|Reports the number of consecutive [`tap`](../api/UnityEngine.InputSystem.Controls.TouchControl.html#UnityEngine_InputSystem_Controls_TouchControl_tap) reports from the OS. You can use this to detect double- and multi-tap gestures.|
+|[`position`](xref:UnityEngine.InputSystem.Controls.TouchControl.position)|[`Vector2Control`](xref:UnityEngine.InputSystem.Controls.Vector2Control)|Absolute position on the touch surface.|
+|[`delta`](xref:UnityEngine.InputSystem.Controls.TouchControl.delta)|[`Vector2Control`](xref:UnityEngine.InputSystem.Controls.Vector2Control)|The difference in `position` since the last frame.|
+|[`startPosition`](xref:UnityEngine.InputSystem.Controls.TouchControl.startPosition)|[`Vector2Control`](xref:UnityEngine.InputSystem.Controls.Vector2Control)|The `position` where the finger first touched the surface.|
+|[`startTime`](xref:UnityEngine.InputSystem.Controls.TouchControl.startTime)|[`DoubleControl`](xref:UnityEngine.InputSystem.Controls.IntegerControl)|The time when the finger first touched the surface.|
+|[`press`](xref:UnityEngine.InputSystem.Controls.TouchControl.press)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|Whether the finger is pressed down.|
+|[`pressure`](xref:UnityEngine.InputSystem.Controls.TouchControl.pressure)|[`AxisControl`](xref:UnityEngine.InputSystem.Controls.AxisControl)|Normalized pressure with which the finger is currently pressed while in contact with the pointer surface.|
+|[`radius`](xref:UnityEngine.InputSystem.Controls.TouchControl.radius)|[`Vector2Control`](xref:UnityEngine.InputSystem.Controls.Vector2Control)|The size of the area where the finger touches the surface.|
+|[`touchId`](xref:UnityEngine.InputSystem.Controls.TouchControl.touchId)|[`IntegerControl`](xref:UnityEngine.InputSystem.Controls.IntegerControl)|The ID of the touch. This allows you to distinguish individual touches.|
+|[`phase`](xref:UnityEngine.InputSystem.Controls.TouchControl.phase)|[`TouchPhaseControl`](xref:UnityEngine.InputSystem.Controls.TouchPhaseControl)|A Control that reports the current [`TouchPhase`](xref:UnityEngine.InputSystem.TouchPhase) of the touch.|
+|[`tap`](xref:UnityEngine.InputSystem.Controls.TouchControl.tap)|[`ButtonControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|A button Control that reports whether the OS recognizes a tap gesture from this touch.|
+|[`tapCount`](xref:UnityEngine.InputSystem.Controls.TouchControl.tapCount)|[`IntegerControl`](xref:UnityEngine.InputSystem.Controls.ButtonControl)|Reports the number of consecutive [`tap`](xref:UnityEngine.InputSystem.Controls.TouchControl.tap) reports from the OS. You can use this to detect double- and multi-tap gestures.|
### Using touch with Actions
-You can use touch input with Actions, like any other [`Pointer`](Pointers.md) Device. To do this, [bind](ActionBindings.md) to the [pointer Controls](Pointers.md#controls), like `/press` or `/delta`. This gets input from the primary touch, and any other non-touch pointer Devices.
+You can use touch input with Actions, like any other [`Pointer`](xref:input-system-pointers) Device. To do this, [bind](xref:input-system-action-bindings) to the [pointer Controls](xref:input-system-pointers#controls), like `/press` or `/delta`. This gets input from the primary touch, and any other non-touch pointer Devices.
However, if you want to get input from multiple touches in your Action, you can bind to individual touches by using Bindings like `/touch3/press`. Alternatively, use a wildcard Binding to bind one Action to all touches: `/touch*/press`.
-If you bind a single Action to input from multiple touches, you should set the Action type to [pass-through](RespondingToActions.md#pass-through) so the Action gets callbacks for each touch, instead of just one.
+If you bind a single Action to input from multiple touches, you should set the Action type to [pass-through](xref:input-system-responding#pass-through) so the Action gets callbacks for each touch, instead of just one.
## `EnhancedTouch.Touch` Class
-The [`EnhancedTouch.Touch`](../api/UnityEngine.InputSystem.EnhancedTouch.Touch.html) class provides a polling API for touches similar to [`UnityEngine.Input.touches`](https://docs.unity3d.com/ScriptReference/Input-touches.html). You can use it to query touches on a frame-by-frame basis.
+The [`EnhancedTouch.Touch`](xref:UnityEngine.InputSystem.EnhancedTouch.Touch) class provides a polling API for touches similar to [`UnityEngine.Input.touches`](xref:UnityEngine.Input.touches). You can use it to query touches on a frame-by-frame basis.
-Because the API comes with a certain overhead due to having to record touches as they happen, you must explicitly enable it. To do this, call [`EnhancedTouchSupport.Enable()`](../api/UnityEngine.InputSystem.EnhancedTouch.EnhancedTouchSupport.html#UnityEngine_InputSystem_EnhancedTouch_EnhancedTouchSupport_Enable):
+Because the API comes with a certain overhead due to having to record touches as they happen, you must explicitly enable it. To do this, call [`EnhancedTouchSupport.Enable()`](xref:UnityEngine.InputSystem.EnhancedTouch.EnhancedTouchSupport.Enable):
```
using UnityEngine.InputSystem.EnhancedTouch;
@@ -78,21 +72,23 @@ Because the API comes with a certain overhead due to having to record touches as
EnhancedTouchSupport.Enable();
```
->__Note__: [`Touchscreen`](../api/UnityEngine.InputSystem.Touchscreen.html) does not require [`EnhancedTouchSupport`](../api/UnityEngine.InputSystem.EnhancedTouch.EnhancedTouchSupport.html) to be enabled. You only need to call [`EnhancedTouchSupport.Enable()`](../api/UnityEngine.InputSystem.EnhancedTouch.EnhancedTouchSupport.html#UnityEngine_InputSystem_EnhancedTouch_EnhancedTouchSupport_Enable) if you want to use the [`EnhancedTouch.Touch`](../api/UnityEngine.InputSystem.EnhancedTouch.Touch.html) API.
+> [!NOTE]
+> [`Touchscreen`](xref:UnityEngine.InputSystem.Touchscreen) does not require [`EnhancedTouchSupport`](xref:UnityEngine.InputSystem.EnhancedTouch.EnhancedTouchSupport) to be enabled. You only need to call [`EnhancedTouchSupport.Enable()`](xref:UnityEngine.InputSystem.EnhancedTouch.EnhancedTouchSupport.Enable) if you want to use the [`EnhancedTouch.Touch`](xref:UnityEngine.InputSystem.EnhancedTouch.Touch) API.
-The [`EnhancedTouch.Touch`](../api/UnityEngine.InputSystem.EnhancedTouch.Touch.html) API is designed to provide access to touch information along two dimensions:
+The [`EnhancedTouch.Touch`](xref:UnityEngine.InputSystem.EnhancedTouch.Touch) API is designed to provide access to touch information along two dimensions:
-1. By finger: Each finger is defined as the Nth contact source on a [`Touchscreen`](../api/UnityEngine.InputSystem.Touchscreen.html). You can use [Touch.activeFingers](../api/UnityEngine.InputSystem.EnhancedTouch.Touch.html#UnityEngine_InputSystem_EnhancedTouch_Touch_activeFingers) to get an array of all currently active fingers.
+1. By finger: Each finger is defined as the Nth contact source on a [`Touchscreen`](xref:UnityEngine.InputSystem.Touchscreen). You can use [Touch.activeFingers](xref:UnityEngine.InputSystem.EnhancedTouch.Touch.activeFingers) to get an array of all currently active fingers.
-2. By touch: Each touch is a single finger contact with at least a beginning point ([`PointerPhase.Began`](../api/UnityEngine.InputSystem.TouchPhase.html)) and an endpoint ([`PointerPhase.Ended`](../api/UnityEngine.InputSystem.TouchPhase.html) or [`PointerPhase.Cancelled`](../api/UnityEngine.InputSystem.TouchPhase.html)). Between those two points, an arbitrary number of [`PointerPhase.Moved`](../api/UnityEngine.InputSystem.TouchPhase.html) and/or [`PointerPhase.Stationary`](../api/UnityEngine.InputSystem.TouchPhase.html) records exist. All records in a touch have the same [`touchId`](../api/UnityEngine.InputSystem.Controls.TouchControl.html#UnityEngine_InputSystem_Controls_TouchControl_touchId). You can use [Touch.activeTouches](../api/UnityEngine.InputSystem.EnhancedTouch.Touch.html#UnityEngine_InputSystem_EnhancedTouch_Touch_activeTouches) to get an array of all currently active touches. This lets you track how a specific touch moves over the screen, which is useful if you want to implement recognition of specific gestures.
+2. By touch: Each touch is a single finger contact with at least a beginning point ([`PointerPhase.Began`](xref:UnityEngine.InputSystem.TouchPhase)) and an endpoint ([`PointerPhase.Ended`](xref:UnityEngine.InputSystem.TouchPhase) or [`PointerPhase.Cancelled`](xref:UnityEngine.InputSystem.TouchPhase)). Between those two points, an arbitrary number of [`PointerPhase.Moved`](xref:UnityEngine.InputSystem.TouchPhase) and/or [`PointerPhase.Stationary`](xref:UnityEngine.InputSystem.TouchPhase) records exist. All records in a touch have the same [`touchId`](xref:UnityEngine.InputSystem.Controls.TouchControl.touchId). You can use [Touch.activeTouches](xref:UnityEngine.InputSystem.EnhancedTouch.Touch.activeTouches) to get an array of all currently active touches. This lets you track how a specific touch moves over the screen, which is useful if you want to implement recognition of specific gestures.
-See [`EnhancedTouch.Touch` API documentation](../api/UnityEngine.InputSystem.EnhancedTouch.Touch.html) for more details.
+See [`EnhancedTouch.Touch` API documentation](xref:UnityEngine.InputSystem.EnhancedTouch.Touch) for more details.
->__Note__: The [`Touch`](../api/UnityEngine.InputSystem.EnhancedTouch.Touch.html) and [`Finger`](../api/UnityEngine.InputSystem.EnhancedTouch.Finger.html) APIs don't generate GC garbage. The bulk of the data is stored in unmanaged memory that is indexed by wrapper structs. All arrays are pre-allocated.
+> [!NOTE]
+> The [`Touch`](xref:UnityEngine.InputSystem.EnhancedTouch.Touch) and [`Finger`](xref:UnityEngine.InputSystem.EnhancedTouch.Finger) APIs don't generate GC garbage. The bulk of the data is stored in unmanaged memory that is indexed by wrapper structs. All arrays are pre-allocated.
## Touch Simulation
-Touch input can be simulated from input on other kinds of [Pointer](./Pointers.md) devices such as [Mouse](./Mouse.md) and [Pen](./Pen.md) devices. To enable this, you can either add the [`TouchSimulation`](../api/UnityEngine.InputSystem.EnhancedTouch.TouchSimulation.html) `MonoBehaviour` to a `GameObject` in your scene or simply call [`TouchSimulation.Enable`](../api/UnityEngine.InputSystem.EnhancedTouch.TouchSimulation.html#UnityEngine_InputSystem_EnhancedTouch_TouchSimulation_Enable) somewhere in your startup code.
+Touch input can be simulated from input on other kinds of [Pointer](xref:input-system-pointers) devices such as [Mouse](xref:input-system-mouse) and [Pen](xref:input-system-pen) devices. To enable this, you can either add the [`TouchSimulation`](xref:UnityEngine.InputSystem.EnhancedTouch.TouchSimulation) `MonoBehaviour` to a `GameObject` in your scene or simply call [`TouchSimulation.Enable`](xref:UnityEngine.InputSystem.EnhancedTouch.TouchSimulation.Enable) somewhere in your startup code.
```CSharp
void OnEnable()
@@ -101,14 +97,14 @@ Touch input can be simulated from input on other kinds of [Pointer](./Pointers.m
}
```
-In the editor, you can also enable touch simulation by toggling "Simulate Touch Input From Mouse or Pen" on in the "Options" dropdown of the [Input Debugger](./Debugging.md).
+In the editor, you can also enable touch simulation by toggling "Simulate Touch Input From Mouse or Pen" on in the "Options" dropdown of the [Input Debugger](xref:input-system-debugging).
-[`TouchSimulation`](../api/UnityEngine.InputSystem.EnhancedTouch.TouchSimulation.html) will add a [`Touchscreen`](../api/UnityEngine.InputSystem.Touchscreen.html) device and automatically mirror input on any [`Pointer`](../api/UnityEngine.InputSystem.Pointer.html) device to the virtual touchscreen device.
+[`TouchSimulation`](xref:UnityEngine.InputSystem.EnhancedTouch.TouchSimulation) will add a [`Touchscreen`](xref:UnityEngine.InputSystem.Touchscreen) device and automatically mirror input on any [`Pointer`](xref:UnityEngine.InputSystem.Pointer) device to the virtual touchscreen device.
## Reading all touches
-To get all current touches from the touchscreen, use [`EnhancedTouch.Touch.activeTouches`](../api/UnityEngine.InputSystem.EnhancedTouch.Touch.html#UnityEngine_InputSystem_EnhancedTouch_Touch_activeTouches), as in this example:
+To get all current touches from the touchscreen, use [`EnhancedTouch.Touch.activeTouches`](xref:UnityEngine.InputSystem.EnhancedTouch.Touch.activeTouches), as in this example:
```C#
using Touch = UnityEngine.InputSystem.EnhancedTouch.Touch;
@@ -120,6 +116,7 @@ To get all current touches from the touchscreen, use [`EnhancedTouch.Touch.activ
}
```
->__Note__: You must first enable enhanced touch support by calling [`InputSystem.EnhancedTouchSupport.Enable()`](../api/UnityEngine.InputSystem.EnhancedTouch.EnhancedTouchSupport.html#UnityEngine_InputSystem_EnhancedTouch_EnhancedTouchSupport_Enable).
+> [!NOTE]
+> You must first enable enhanced touch support by calling [`InputSystem.EnhancedTouchSupport.Enable()`](xref:UnityEngine.InputSystem.EnhancedTouch.EnhancedTouchSupport.Enable).
-You can also use the lower-level [`Touchscreen.current.touches`](../api/UnityEngine.InputSystem.Touchscreen.html#UnityEngine_InputSystem_Touchscreen_touches) API.
+You can also use the lower-level [`Touchscreen.current.touches`](xref:UnityEngine.InputSystem.Touchscreen.touches) API.
diff --git a/Packages/com.unity.inputsystem/Documentation~/TrackedInputDevices.md b/Packages/com.unity.inputsystem/Documentation~/TrackedInputDevices.md
index 7d4d100c11..a5be7e0293 100644
--- a/Packages/com.unity.inputsystem/Documentation~/TrackedInputDevices.md
+++ b/Packages/com.unity.inputsystem/Documentation~/TrackedInputDevices.md
@@ -11,12 +11,12 @@ Use the Tracked Pose Driver component to synchronize a __GameObject__'s transfor
| **Property** | **Description** |
|-------------|-----------|
-|[`Tracking Type`](../api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html#UnityEngine_InputSystem_XR_TrackedPoseDriver_trackingType)|Specify which transform properties (position, rotation, or both) to update based on the tracked data.|
-|[`Update Type`](../api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html#UnityEngine_InputSystem_XR_TrackedPoseDriver_updateType)|Determine when updates to the transform occur within Unity's event loop, such as during rendering or gameplay.|
-|[`Ignore Tracking State`](../api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html#UnityEngine_InputSystem_XR_TrackedPoseDriver_ignoreTrackingState)| Enable to ignore the tracking state and assume that the input pose is valid, even when flagged otherwise.|
-|[`Position Input`](../api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html#UnityEngine_InputSystem_XR_TrackedPoseDriver_positionInput)|Set an input action that retrieves the position data (Vector3) of the tracked device.|
-|[`Rotation Input`](../api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html#UnityEngine_InputSystem_XR_TrackedPoseDriver_rotationInput)| Set an input action that retrieves the rotation data (Quaternion) of the tracked device.|
-|[`Tracking State Input`](../api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html#UnityEngine_InputSystem_XR_TrackedPoseDriver_trackingStateInput)|Set an input action that determines whether the tracking state (position or rotation) is valid (integer).|
+|[`Tracking Type`](xref:UnityEngine.InputSystem.XR.TrackedPoseDriver.trackingType)|Specify which transform properties (position, rotation, or both) to update based on the tracked data.|
+|[`Update Type`](xref:UnityEngine.InputSystem.XR.TrackedPoseDriver.updateType)|Determine when updates to the transform occur within Unity's event loop, such as during rendering or gameplay.|
+|[`Ignore Tracking State`](xref:UnityEngine.InputSystem.XR.TrackedPoseDriver.ignoreTrackingState)| Enable to ignore the tracking state and assume that the input pose is valid, even when flagged otherwise.|
+|[`Position Input`](xref:UnityEngine.InputSystem.XR.TrackedPoseDriver.positionInput)|Set an input action that retrieves the position data (Vector3) of the tracked device.|
+|[`Rotation Input`](xref:UnityEngine.InputSystem.XR.TrackedPoseDriver.rotationInput)| Set an input action that retrieves the rotation data (Quaternion) of the tracked device.|
+|[`Tracking State Input`](xref:UnityEngine.InputSystem.XR.TrackedPoseDriver.trackingStateInput)|Set an input action that determines whether the tracking state (position or rotation) is valid (integer).|
## Tracked Device Raycaster
@@ -28,8 +28,8 @@ The component also supports occlusion checks, custom ray distance limits, and fi
| **Property** | **Description** |
|-------------|-----------|
-|[`Ignore Reversed Graphics`](../api/UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.html#UnityEngine_InputSystem_UI_TrackedDeviceRaycaster_ignoreReversedGraphics)| Enable to ignore graphics whose normal faces away from the direction of the ray.|
-|[`Check For 2D Occlusion`](../api/UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.html#UnityEngine_InputSystem_UI_TrackedDeviceRaycaster_checkFor2DOcclusion)|Enable occlusion checks for 2D objects, such as sprites in the scene.|
-|[`Check For 3D Occulusion`](../api/UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.html#UnityEngine_InputSystem_UI_TrackedDeviceRaycaster_checkFor3DOcclusion)|Enable occlusion checks for 3D objects to prevent rays from passing through physical geometry.|
-|[`Max Distance`](../api/UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.html#UnityEngine_InputSystem_UI_TrackedDeviceRaycaster_maxDistance)|Set the maximum ray distance for interaction detection in world space coordinates.|
-|[`Blocking Mask`](../api/UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.html#UnityEngine_InputSystem_UI_TrackedDeviceRaycaster_blockingMask)|Define the layer mask used to check for occlusion when ray casting.|
+|[`Ignore Reversed Graphics`](xref:UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.ignoreReversedGraphics)| Enable to ignore graphics whose normal faces away from the direction of the ray.|
+|[`Check For 2D Occlusion`](xref:UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.checkFor2DOcclusion)|Enable occlusion checks for 2D objects, such as sprites in the scene.|
+|[`Check For 3D Occulusion`](xref:UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.checkFor3DOcclusion)|Enable occlusion checks for 3D objects to prevent rays from passing through physical geometry.|
+|[`Max Distance`](xref:UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.maxDistance)|Set the maximum ray distance for interaction detection in world space coordinates.|
+|[`Blocking Mask`](xref:UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.blockingMask)|Define the layer mask used to check for occlusion when ray casting.|
diff --git a/Packages/com.unity.inputsystem/Documentation~/UISupport.md b/Packages/com.unity.inputsystem/Documentation~/UISupport.md
index a904095279..8190de28fa 100644
--- a/Packages/com.unity.inputsystem/Documentation~/UISupport.md
+++ b/Packages/com.unity.inputsystem/Documentation~/UISupport.md
@@ -3,23 +3,6 @@ uid: input-system-ui-support
---
# UI support
-- [Overview and compatibility](#overview-and-compatibility)
-- [Setting up UI input](#setting-up-ui-input)
-- [Required Actions for UI](#required-actions-for-ui)
-- [The UI Input Module component](#the-ui-input-module-component)
- - [Using the UI Input Module](#using-the-ui-input-module)
- - [UI Input Module properties](#ui-input-module-properties)
- - [How the bindings work](#how-the-bindings-work)
- - [Other notes about the UI Input Module](#other-notes-about-the-ui-input-module)
-- [Multiplayer UIs](#multiplayer-uis)
-- [Virtual mouse cursor control](#virtual-mouse-cursor-control)
- - [Using the Virtual Mouse component](#using-the-virtual-mouse-component)
-- [Distinguishing between UI and game input](#distinguishing-between-ui-and-game-input)
- - [Handling ambiguities for pointer-type input](#handling-ambiguities-for-pointer-type-input)
- - [Handling ambiguities for navigation-type input](#handling-ambiguities-for-navigation-type-input)
-- [Immediate Mode GUI](#immediate-mode-gui)
-
-
## Overview and compatibility
Unity has [various UI solutions](https://docs.unity3d.com/Manual/UIToolkits.html). The Input System package's compatibility and workflow with these solutions varies depending on which UI solution you are using, and which version of Unity you are using.
@@ -30,7 +13,7 @@ The three main UI solutions are **UI Toolkit**, **Unity UI**, and **IMGUI**. The
**For [**UI Toolkit**](https://docs.unity3d.com/Manual/UIElements.html), also known as "UI Elements" (an XML/CSS style UI solution):**
-- From Unity 2023.2 and onwards, the UI actions defined in the default [project-wide actions](./ProjectWideActions.md) directly map to UI Toolkit input. You do not need to use the UI Input Module component.
+- From Unity 2023.2 and onwards, the UI actions defined in the default [project-wide actions](xref:project-wide-actions) directly map to UI Toolkit input. You do not need to use the UI Input Module component.
- In versions of Unity prior to 2023.2, you must use the UI Input Module component to define which actions are passed through from the Input System to the UI.
- Refer to UI Toolkit [Runtime UI event system and input handling](https://docs.unity3d.com/Manual/UIE-Runtime-Event-System.html) for more information on how to configure UI Toolkit input.
@@ -38,7 +21,7 @@ The three main UI solutions are **UI Toolkit**, **Unity UI**, and **IMGUI**. The
When using Unity UI (uGUI), you must always use the UI Input Module component to define which actions are passed through from the Input System to the UI.
-**For [**IMGUI**](https://docs.unity3d.com/Manual/GUIScriptingGuide.html) (a script-based "Immediate Mode" UI using the [`OnGUI`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnGUI.html) method):**
+**For [**IMGUI**](https://docs.unity3d.com/Manual/GUIScriptingGuide.html) (a script-based "Immediate Mode" UI using the [`OnGUI`](xref:MonoBehaviour.OnGUI) method):**
The Input System package is **not compatible** with IMGUI, however you can still use the Input System for other parts of your project such as gameplay. See the [Immediate Mode GUI](#immediate-mode-gui) section for more information.
@@ -54,7 +37,7 @@ IMGUI|No|n/a
## Setting up UI input
-The default [project-wide actions](./ProjectWideActions.md) comes with a "**UI**" Action Map, that contains all the actions required for UI interaction (shown in the image below). You can configure the bindings for these actions in the [Actions Editor](./ActionsEditor.md). Go to **Project Settings > Input System Package**, then select "**UI**" in the Action Maps column.
+The default [project-wide actions](xref:project-wide-actions) comes with a "**UI**" Action Map, that contains all the actions required for UI interaction (shown in the image below). You can configure the bindings for these actions in the [Actions Editor](xref:input-system-configuring-input). Go to **Project Settings > Input System Package**, then select "**UI**" in the Action Maps column.

@@ -64,7 +47,7 @@ The default project-wide actions comes with all the required actions to be compa
You can modify, add, or remove bindings to the named actions in the UI action map to suit your project, however in order to remain compatible with UI Toolkit, the name of the action map ("**UI**"), the names of the actions it contains, and their respective **Action Types** must remain the same.
-These specific actions and types, which are expected by the [UI Input Module](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html) class, are as follows:
+These specific actions and types, which are expected by the [UI Input Module](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule) class, are as follows:
**Action**|**Action Type**|**Control Type**|**Description**
-|-|-|-
@@ -77,17 +60,18 @@ RightClick|PassThrough|Button|The secondary button for [pointer-type](#pointer-t
MiddleClick|PassThrough|Button|The middle button for [pointer-type](#pointer-type-input) interaction.
ScrollWheel|PassThrough|Vector2|The scrolling gesture for [pointer-type](#pointer-type-input) interaction.
Tracked Device Position|PassThrough|Vector3|A 3D position of one or multiple spatial tracking devices, such as XR hand controllers. In combination with Tracked Device Orientation, this allows XR-style UI interactions by pointing at UI [selectables](https://docs.unity3d.com/Manual/script-Selectable.html) in space. See [tracked-type input](#tracked-type-input).
-Tracked Device Orientation|PassThrough|Quaternion|a `Quaternion` representing the rotation of one or multiple spatial tracking devices, such as XR hand controllers. In combination with [Tracked Device Position](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_trackedDevicePosition), this allows XR-style UI interactions by pointing at UI [selectables](https://docs.unity3d.com/Manual/script-Selectable.html) in space. See [tracked-type input](#tracked-type-input).
+Tracked Device Orientation|PassThrough|Quaternion|a `Quaternion` representing the rotation of one or multiple spatial tracking devices, such as XR hand controllers. In combination with [Tracked Device Position](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.trackedDevicePosition), this allows XR-style UI interactions by pointing at UI [selectables](https://docs.unity3d.com/Manual/script-Selectable.html) in space. See [tracked-type input](#tracked-type-input).
You can also reset the UI action map to its default bindings by selecting **Reset** from the **More (⋮)** menu, at the top right of the actions editor window. However, this will reset both the 'Player' and 'UI' action maps to their default bindings.
## The UI Input Module component
When working with Unity UI (uGUI), or when using UI Toolkit in versions of Unity prior to Unity 2023.2, you must use the **UI Input Module** component which defines which actions are passed through to your UI, as well as some other UI-related input settings.
-> **Note:**
-> If you have an instance of the [Input System UI Input Module](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html) component in your scene, the settings on that component takes priority and are used instead of the UI settings in your project-wide actions. Also, The UI action map will be enabled, along with the default action map specified on any UI Input Module component in the scene.
-The UI Input module is implemented in the class [`InputSystemUIInputModule`](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html).
+> [!NOTE]
+> If you have an instance of the [Input System UI Input Module](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule) component in your scene, the settings on that component takes priority and are used instead of the UI settings in your project-wide actions. Also, The UI action map will be enabled, along with the default action map specified on any UI Input Module component in the scene.
+
+The UI Input module is implemented in the class [`InputSystemUIInputModule`](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule).
### Using the UI Input Module
@@ -95,26 +79,24 @@ The UI Input Module is a component which you must add to a GameObject in your sc
1. Create a new empty GameObject
2. Click [**Add Component**](https://docs.unity3d.com/Manual/UsingComponents.html) in the inspector
-3. In the search field displayed, type "Input System UI Input Module"
+3. In the search field displayed, type `input system ui`.
4. Select **Input System UI Input Module** to add it to the GameObject.
-
+
### UI Input Module properties
-
-
-You can use the following properties to configure [InputSystemUIInputModule](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html):
+You can use the following properties to configure [InputSystemUIInputModule](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule):
|**Property**|**Description**|
|--------|-----------|
-|[Move Repeat Delay](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_moveRepeatDelay)|The initial delay (in seconds) between generating an initial [IMoveHandler.OnMove](https://docs.unity3d.com/Packages/com.unity.ugui@1.0/api/UnityEngine.EventSystems.IMoveHandler.html) navigation event and generating repeated navigation events when the __Move__ Action stays actuated.|
-|[Move Repeat Rate](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_moveRepeatDelay)|The interval (in seconds) between generating repeat navigation events when the __Move__ Action stays actuated. Note that this is capped by the frame rate; there will not be more than one move repeat event each frame so if the frame rate dips below the repeat rate, the effective repeat rate will be lower than this setting.|
-|[Actions Asset](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_actionsAsset)|An [Input Action Asset](ActionAssets.md) containing all the Actions to control the UI. You can choose which Actions in the Asset correspond to which UI inputs using the following properties. By default, this references a built-in Asset named *DefaultInputActions*, which contains common default Actions for driving UI. If you want to set up your own Actions, [create a custom Input Action Asset](ActionAssets.md#creating-input-action-assets) and assign it here. When you assign a new Asset reference to this field in the Inspector, the Editor attempts to automatically map Actions to UI inputs based on common naming conventions.|
-|[Deselect on Background Click](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_deselectOnBackgroundClick)|By default, when the pointer is clicked and does not hit any `GameObject`, the current selection is cleared. This, however, can get in the way of keyboard and gamepad navigation which will want to work off the currently selected object. To prevent automatic deselection, set this property to false.|
-|[Pointer Behavior](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_pointerBehavior)|How to deal with multiple pointers feeding input into the UI. See [pointer-type input](#pointer-type-input).|
-|[Cursor Lock Behavior](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_cursorLockBehavior)|Controls the origin point of UI raycasts when the cursor is locked. |
+|[Move Repeat Delay](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.moveRepeatDelay)|The initial delay (in seconds) between generating an initial [IMoveHandler.OnMove](https://docs.unity3d.com/Packages/com.unity.ugui@1.0/api/UnityEngine.EventSystems.IMoveHandler.html) navigation event and generating repeated navigation events when the __Move__ Action stays actuated.|
+|[Move Repeat Rate](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.moveRepeatDelay)|The interval (in seconds) between generating repeat navigation events when the __Move__ Action stays actuated. Note that this is capped by the frame rate; there will not be more than one move repeat event each frame so if the frame rate dips below the repeat rate, the effective repeat rate will be lower than this setting.|
+|[Actions Asset](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.actionsAsset)|An [Input Action Asset](xref:input-system-action-assets) containing all the Actions to control the UI. You can choose which Actions in the Asset correspond to which UI inputs using the following properties. By default, this references a built-in Asset named *DefaultInputActions*, which contains common default Actions for driving UI. If you want to set up your own Actions, [create a custom Input Action Asset](xref:input-system-action-assets#creating-input-action-assets) and assign it here. When you assign a new Asset reference to this field in the Inspector, the Editor attempts to automatically map Actions to UI inputs based on common naming conventions.|
+|[Deselect on Background Click](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.deselectOnBackgroundClick)|By default, when the pointer is clicked and does not hit any `GameObject`, the current selection is cleared. This, however, can get in the way of keyboard and gamepad navigation which will want to work off the currently selected object. To prevent automatic deselection, set this property to false.|
+|[Pointer Behavior](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.pointerBehavior)|How to deal with multiple pointers feeding input into the UI. See [pointer-type input](#pointer-type-input).|
+|[Cursor Lock Behavior](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.cursorLockBehavior)|Controls the origin point of UI raycasts when the cursor is locked. |
### How the bindings work
@@ -129,61 +111,63 @@ For each of these types of input, input is sourced and combined from a specific
#### Pointer-type input
-To the UI, a pointer is a position from which clicks and scrolls can be triggered to interact with UI elements at the pointer's position. Pointer-type input is sourced from [point](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_point), [leftClick](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_leftClick), [rightClick](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_rightClick), [middleClick](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_middleClick), and [scrollWheel](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_scrollWheel).
+To the UI, a pointer is a position from which clicks and scrolls can be triggered to interact with UI elements at the pointer's position. Pointer-type input is sourced from [point](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.point), [leftClick](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.leftClick), [rightClick](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.rightClick), [middleClick](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.middleClick), and [scrollWheel](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.scrollWheel).
-The UI input module does not have an association between pointers and cursors. In general, the UI is oblivious to whether a cursor exists for a particular pointer. However, for mouse and pen input, the UI input module will respect [Cusor.lockState](https://docs.unity3d.com/ScriptReference/Cursor-lockState.html) and pin the pointer position at `(-1,-1)` whenever the cursor is locked. This behavior can be changed through the [Cursor Lock Behavior](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_cursorLockBehavior) property of the [InputSystemUIInputModule](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html).
+The UI input module does not have an association between pointers and cursors. In general, the UI is oblivious to whether a cursor exists for a particular pointer. However, for mouse and pen input, the UI input module will respect [Cusor.lockState](xref:UnityEngine.Cursor.lockState) and pin the pointer position at `(-1,-1)` whenever the cursor is locked. This behavior can be changed through the [Cursor Lock Behavior](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.cursorLockBehavior) property of the [InputSystemUIInputModule](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule).
-Multiple pointer Devices may feed input into a single UI input module. Also, in the case of [Touchscreen](../api/UnityEngine.InputSystem.Touchscreen.html), a single Device can have the ability to have multiple concurrent pointers (each finger contact is one pointer).
+Multiple pointer Devices may feed input into a single UI input module. Also, in the case of [Touchscreen](xref:UnityEngine.InputSystem.Touchscreen), a single Device can have the ability to have multiple concurrent pointers (each finger contact is one pointer).
-Because multiple pointer Devices can feed into the same set of Actions, it is important to set the [action type](./RespondingToActions.md#action-types) to [PassThrough](../api/UnityEngine.InputSystem.InputActionType.html#UnityEngine_InputSystem_InputActionType_PassThrough). This ensures that no filtering is applied to input on these actions and that instead every input is relayed as is.
+Because multiple pointer Devices can feed into the same set of Actions, it is important to set the [action type](xref:input-system-responding#action-types) to [PassThrough](xref:UnityEngine.InputSystem.InputActionType.PassThrough). This ensures that no filtering is applied to input on these actions and that instead every input is relayed as is.
-From the perspective of [InputSystemUIInputModule](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html), each [InputDevice](../api/UnityEngine.InputSystem.InputDevice.html) that has one or more controls bound to one of the pointer-type actions is considered a unique pointer. Also, for each [Touchscreen](../api/UnityEngine.InputSystem.Touchscreen.html) devices, each separate [TouchControl](../api/UnityEngine.InputSystem.Controls.TouchControl.html) that has one or more of its controls bound to the those actions is considered its own unique pointer as well. Each pointer receives a unique [pointerId](https://docs.unity3d.com/Packages/com.unity.ugui@1.0/api/UnityEngine.EventSystems.PointerEventData.html#UnityEngine_EventSystems_PointerEventData_pointerId) which generally corresponds to the [deviceId](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_deviceId) of the pointer. However, for touch, this will be a combination of [deviceId](../api/UnityEngine.InputSystem.InputDevice.html#UnityEngine_InputSystem_InputDevice_deviceId) and [touchId](../api/UnityEngine.InputSystem.Controls.TouchControl.html#UnityEngine_InputSystem_Controls_TouchControl_touchId). Use [ExtendedPointerEventData.touchId](../api/UnityEngine.InputSystem.UI.ExtendedPointerEventData.html#UnityEngine_InputSystem_UI_ExtendedPointerEventData_touchId) to find the ID for a touch event.
+From the perspective of [InputSystemUIInputModule](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule), each [InputDevice](xref:UnityEngine.InputSystem.InputDevice) that has one or more controls bound to one of the pointer-type actions is considered a unique pointer. Also, for each [Touchscreen](xref:UnityEngine.InputSystem.Touchscreen) devices, each separate [TouchControl](xref:UnityEngine.InputSystem.Controls.TouchControl) that has one or more of its controls bound to the those actions is considered its own unique pointer as well. Each pointer receives a unique [pointerId](https://docs.unity3d.com/Packages/com.unity.ugui@1.0/api/UnityEngine.EventSystems.PointerEventData.html#UnityEngine_EventSystems_PointerEventData_pointerId) which generally corresponds to the [deviceId](xref:UnityEngine.InputSystem.InputDevice.deviceId) of the pointer. However, for touch, this will be a combination of [deviceId](xref:UnityEngine.InputSystem.InputDevice.deviceId) and [touchId](xref:UnityEngine.InputSystem.Controls.TouchControl.touchId). Use [ExtendedPointerEventData.touchId](xref:UnityEngine.InputSystem.UI.ExtendedPointerEventData.touchId) to find the ID for a touch event.
-You can influence how the input module deals with concurrent input from multiple pointers using the [Pointer Behavior](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_pointerBehavior) setting.
+You can influence how the input module deals with concurrent input from multiple pointers using the [Pointer Behavior](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.pointerBehavior) setting.
|**Pointer Behavior**|**Description**|
|------------------|-----------|
-|[Single Mouse or Pen But Multi Touch And Track](../api/UnityEngine.InputSystem.UI.UIPointerBehavior.html#UnityEngine_InputSystem_UI_UIPointerBehavior_SingleMouseOrPenButMultiTouchAndTrack)|Behaves like [Single Unified Pointer](../api/UnityEngine.InputSystem.UI.UIPointerBehavior.html#UnityEngine_InputSystem_UI_UIPointerBehavior_SingleUnifiedPointer) for all input that is not classified as touch or tracked input, and behaves like [All Pointers As Is](../api/UnityEngine.InputSystem.UI.UIPointerBehavior.html#UnityEngine_InputSystem_UI_UIPointerBehavior_AllPointersAsIs) for tracked and touch input. If concurrent input is received on a [Mouse](../api/UnityEngine.InputSystem.Mouse.html) and [`Pen`](../api/UnityEngine.InputSystem.Pen.html), for example, the input of both is fed into the same UI pointer instance. The position input of one will overwrite the position of the other. Note that when input is received from touch or tracked devices, the single unified pointer for mice and pens is __removed__ including [IPointerExit](https://docs.unity3d.com/Packages/com.unity.ugui@1.0/api/UnityEngine.EventSystems.IPointerExitHandler.html) events being sent in case the mouse/pen cursor is currently hovering over objects. This is the default behavior.|
-|[Single Unified Pointer](../api/UnityEngine.InputSystem.UI.UIPointerBehavior.html#UnityEngine_InputSystem_UI_UIPointerBehavior_SingleUnifiedPointer)|All pointer input is unified such that there is only ever a single pointer. This includes touch and tracked input. This means, for example, that regardless how many devices feed input into [Point](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_point), only the last such input in a frame will take effect and become the current UI pointer's position.|
-|[All Pointers As Is](../api/UnityEngine.InputSystem.UI.UIPointerBehavior.html#UnityEngine_InputSystem_UI_UIPointerBehavior_AllPointersAsIs)|The UI input module will not unify any pointer input. Any device, including touch and tracked devices that feed input pointer-type actions, will be its own pointer (or multiple pointers for touch input). Note: This might mean that there will be an arbitrary number of pointers in the UI, and several objects might be pointed at concurrently.|
+|[Single Mouse or Pen But Multi Touch And Track](xref:UnityEngine.InputSystem.UI.UIPointerBehavior.SingleMouseOrPenButMultiTouchAndTrack)|Behaves like [Single Unified Pointer](xref:UnityEngine.InputSystem.UI.UIPointerBehavior.SingleUnifiedPointer) for all input that is not classified as touch or tracked input, and behaves like [All Pointers As Is](xref:UnityEngine.InputSystem.UI.UIPointerBehavior.AllPointersAsIs) for tracked and touch input. If concurrent input is received on a [Mouse](xref:UnityEngine.InputSystem.Mouse) and [`Pen`](xref:UnityEngine.InputSystem.Pen), for example, the input of both is fed into the same UI pointer instance. The position input of one will overwrite the position of the other. Note that when input is received from touch or tracked devices, the single unified pointer for mice and pens is __removed__ including [IPointerExit](https://docs.unity3d.com/Packages/com.unity.ugui@1.0/api/UnityEngine.EventSystems.IPointerExitHandler.html) events being sent in case the mouse/pen cursor is currently hovering over objects. This is the default behavior.|
+|[Single Unified Pointer](xref:UnityEngine.InputSystem.UI.UIPointerBehavior.SingleUnifiedPointer)|All pointer input is unified such that there is only ever a single pointer. This includes touch and tracked input. This means, for example, that regardless how many devices feed input into [Point](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.point), only the last such input in a frame will take effect and become the current UI pointer's position.|
+|[All Pointers As Is](xref:UnityEngine.InputSystem.UI.UIPointerBehavior.AllPointersAsIs)|The UI input module will not unify any pointer input. Any device, including touch and tracked devices that feed input pointer-type actions, will be its own pointer (or multiple pointers for touch input). Note: This might mean that there will be an arbitrary number of pointers in the UI, and several objects might be pointed at concurrently.|
-If you bind a device to a pointer-type action such as [Left Click](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_leftClick) without also binding it to [Point](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_point), the UI input module will recognize the device as not being able to point and try to route its input into that of another pointer. For example, if you bind [Left Click](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_leftClick) to the `Space` key and [Point](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_point) to the position of the mouse, then pressing the space bar will result in a left click at the current position of the mouse.
+If you bind a device to a pointer-type action such as [Left Click](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.leftClick) without also binding it to [Point](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.point), the UI input module will recognize the device as not being able to point and try to route its input into that of another pointer. For example, if you bind [Left Click](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.leftClick) to the `Space` key and [Point](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.point) to the position of the mouse, then pressing the space bar will result in a left click at the current position of the mouse.
-For pointer-type input (as well as for [tracked-type input](#tracked-type-input)), [InputSystemUIInputModule](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html) will send [ExtendedPointerEventData](../api/UnityEngine.InputSystem.UI.ExtendedPointerEventData.html) instances which are an extended version of the base `PointerEventData`. These events contain additional data such as the [device](../api/UnityEngine.InputSystem.UI.ExtendedPointerEventData.html#UnityEngine_InputSystem_UI_ExtendedPointerEventData_device) and [pointer type](../api/UnityEngine.InputSystem.UI.ExtendedPointerEventData.html#UnityEngine_InputSystem_UI_ExtendedPointerEventData_pointerType) which the event has been generated from.
+For pointer-type input (as well as for [tracked-type input](#tracked-type-input)), [InputSystemUIInputModule](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule) will send [ExtendedPointerEventData](xref:UnityEngine.InputSystem.UI.ExtendedPointerEventData) instances which are an extended version of the base `PointerEventData`. These events contain additional data such as the [device](xref:UnityEngine.InputSystem.UI.ExtendedPointerEventData.device) and [pointer type](xref:UnityEngine.InputSystem.UI.ExtendedPointerEventData.pointerType) which the event has been generated from.
#### Navigation-type input
-Navigation-type input controls the current selection based on motion read from the [move](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_move) action. Additionally, input from
-[submit](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_submit) will trigger `ISubmitHandler` on the currently selected object and
-[cancel](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_cancel) will trigger `ICancelHandler` on it.
+Navigation-type input controls the current selection based on motion read from the [move](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.move) action. Additionally, input from
+[submit](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.submit) will trigger `ISubmitHandler` on the currently selected object and
+[cancel](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.cancel) will trigger `ICancelHandler` on it.
-Unlike with [pointer-type](#pointer-type-input), where multiple pointer inputs may exist concurrently (think two touches or left- and right-hand tracked input), navigation-type input does not have multiple concurrent instances. In other words, only a single [move](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_move) vector and a single [submit](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_submit) and [cancel](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_cancel) input will be processed by the UI module each frame. However, these inputs need not necessarily come from one single Device always. Arbitrary many inputs can be bound to the respective actions.
+Unlike with [pointer-type](#pointer-type-input), where multiple pointer inputs may exist concurrently (think two touches or left- and right-hand tracked input), navigation-type input does not have multiple concurrent instances. In other words, only a single [move](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.move) vector and a single [submit](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.submit) and [cancel](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.cancel) input will be processed by the UI module each frame. However, these inputs need not necessarily come from one single Device always. Arbitrary many inputs can be bound to the respective actions.
-While, [move](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_move) should be set to [PassThrough](../api/UnityEngine.InputSystem.InputActionType.html#UnityEngine_InputSystem_InputActionType_PassThrough) Action type, it is important that [submit](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_submit) and
-[cancel](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_cancel) be set to the [Button](../api/UnityEngine.InputSystem.InputActionType.html#UnityEngine_InputSystem_InputActionType_Button) Action type.
+While, [move](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.move) should be set to [PassThrough](xref:UnityEngine.InputSystem.InputActionType.PassThrough) Action type, it is important that [submit](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.submit) and
+[cancel](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.cancel) be set to the [Button](xref:UnityEngine.InputSystem.InputActionType.Button) Action type.
Navigation input is non-positional, that is, unlike with pointer-type input, there is no screen position associcated with these actions. Rather, navigation actions always operate on the current selection.
#### Tracked-type input
-Input from [tracked devices](../api/UnityEngine.InputSystem.TrackedDevice.html) such as [XR controllers](../api/UnityEngine.InputSystem.XR.XRController.html) and [HMDs](../api/UnityEngine.InputSystem.XR.XRHMD.html) essentially behaves like [pointer-type input](#pointer-type-input). The main difference is that the world-space device position and orientation sourced from [trackedDevicePosition](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_trackedDevicePosition) and [trackedDeviceOrientation](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_trackedDeviceOrientation) is translated into a screen-space position via raycasting.
+Input from [tracked devices](xref:UnityEngine.InputSystem.TrackedDevice) such as [XR controllers](xref:UnityEngine.InputSystem.XR.XRController) and [HMDs](xref:UnityEngine.InputSystem.XR.XRHMD) essentially behaves like [pointer-type input](#pointer-type-input). The main difference is that the world-space device position and orientation sourced from [trackedDevicePosition](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.trackedDevicePosition) and [trackedDeviceOrientation](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.trackedDeviceOrientation) is translated into a screen-space position via raycasting.
+
+> [!IMPORTANT]
+> Because multiple tracked Devices can feed into the same set of Actions, it is important to set the [action type](xref:input-system-responding#action-types) to [PassThrough](xref:UnityEngine.InputSystem.InputActionType.PassThrough). This ensures that no filtering is applied to input on these actions and that instead every input is relayed as is.
+
+For this raycasting to work, you need to add [TrackedDeviceRaycaster](xref:UnityEngine.InputSystem.UI.TrackedDeviceRaycaster) to the `GameObject` that has the UI's `Canvas` component. This `GameObject` will usually have a `GraphicRaycaster` component which, however, only works for 2D screen-space raycasting. You can put [TrackedDeviceRaycaster](xref:UnityEngine.InputSystem.UI.TrackedDeviceRaycaster) alongside `GraphicRaycaster` and both can be enabled at the same time without advserse effect.
-> **Important:**
->Because multiple tracked Devices can feed into the same set of Actions, it is important to set the [action type](./RespondingToActions.md#action-types) to [PassThrough](../api/UnityEngine.InputSystem.InputActionType.html#UnityEngine_InputSystem_InputActionType_PassThrough). This ensures that no filtering is applied to input on these actions and that instead every input is relayed as is.
+
-For this raycasting to work, you need to add [TrackedDeviceRaycaster](../api/UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.html) to the `GameObject` that has the UI's `Canvas` component. This `GameObject` will usually have a `GraphicRaycaster` component which, however, only works for 2D screen-space raycasting. You can put [TrackedDeviceRaycaster](../api/UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.html) alongside `GraphicRaycaster` and both can be enabled at the same time without advserse effect.
-
+
-
-Clicks on tracked devices do not differ from other [pointer-type input](#pointer-type-input). Therefore, actions such as [Left Click](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html#UnityEngine_InputSystem_UI_InputSystemUIInputModule_leftClick) work for tracked devices just like they work for other pointers.
+Clicks on tracked devices do not differ from other [pointer-type input](#pointer-type-input). Therefore, actions such as [Left Click](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule.leftClick) work for tracked devices just like they work for other pointers.
### Other notes about the UI Input Module
#### Upgrading from the Input Manager and the older Standalone Input Module
-The Unity UI (uGUI) package contains an older equivalent module called "**[Standalone Input Module](https://docs.unity3d.com/Manual/script-StandaloneInputModule.html)**" which performs the same kind of integration between the Unity UI and the legacy Input Manager system.
+The Unity UI (uGUI) package contains an older equivalent module called **[Standalone Input Module](https://docs.unity3d.com/Manual/script-StandaloneInputModule.html)** which performs the same kind of integration between the Unity UI and the legacy Input Manager system.
If you have one of these older Standalone Input Module components on a GameObject in your project, and the Input System is installed, Unity displays a button in the Inspector offering to automatically replace it with the equivalent newer Input System UI Input Module for you.
@@ -197,12 +181,12 @@ Input support for both [Unity UI](https://docs.unity3d.com/Manual/com.unity.ugui
Internally, UI Toolkit installs an event listener in the form of the `PanelEventHandler` component which intercepts events that `InputSystemUIInputModule` sends and translates them into UI Toolkit-specific events that are then routed into the visual tree. If you employ `EventSystem.SetUITookitEventSystemOverride`, this default mechanism is bypassed.
->**Note:**
->XR ([tracked-type input](#tracked-type-input)) is not yet supported in combination with UI Toolkit. This means that you cannot use devices such as VR controllers to operate interfaces created with UI Toolkit.
+> [!NOTE]
+> XR ([tracked-type input](#tracked-type-input)) is not yet supported in combination with UI Toolkit. This means that you cannot use devices such as VR controllers to operate interfaces created with UI Toolkit.
There are some additional things worth noting:
-* UI Toolkit handles raycasting internally. No separate raycaster component is needed like for uGUI. This means that [TrackedDeviceRaycaster](../api/UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.html) does not work together with UI Toolkit.
+* UI Toolkit handles raycasting internally. No separate raycaster component is needed like for uGUI. This means that [TrackedDeviceRaycaster](xref:UnityEngine.InputSystem.UI.TrackedDeviceRaycaster) does not work together with UI Toolkit.
* A pointer click and a gamepad submit action are distinct at the event level in UI Toolkit. This means that if you, for example, do
```CSharp
button.RegisterCallback(_ => ButtonWasClicked());
@@ -218,13 +202,13 @@ There are some additional things worth noting:
## Multiplayer UIs
-The Input System can also handle multiple separate UI instances on the screen controlled separately from different input Bindings. This is useful if you want to have multiple local players share a single screen with different controllers, so that every player can control their own UI instance. To allow this, you need to replace the [Event System](https://docs.unity3d.com/Manual/script-EventSystem.html) component from Unity with the Input System's [Multiplayer Event System](../api/UnityEngine.InputSystem.UI.MultiplayerEventSystem.html) component.
+The Input System can also handle multiple separate UI instances on the screen controlled separately from different input Bindings. This is useful if you want to have multiple local players share a single screen with different controllers, so that every player can control their own UI instance. To allow this, you need to replace the [Event System](https://docs.unity3d.com/Manual/script-EventSystem.html) component from Unity with the Input System's [Multiplayer Event System](xref:UnityEngine.InputSystem.UI.MultiplayerEventSystem) component.
-
+
-Unlike the Event System component, you can have multiple Multiplayer Event Systems active in the Scene at the same time. That way, you can have multiple players, each with their own UI Input Module and Multiplayer Event System components, and each player can have their own set of Actions driving their own UI instance. If you are using the [Player Input](PlayerInput.md) component, you can also set it to automatically configure the player's UI Input Module to use the player's Actions. See the documentation on [Player Input](PlayerInput.md#ui-input) to learn how.
+Unlike the Event System component, you can have multiple Multiplayer Event Systems active in the Scene at the same time. That way, you can have multiple players, each with their own UI Input Module and Multiplayer Event System components, and each player can have their own set of Actions driving their own UI instance. If you are using the [Player Input](xref:input-system-player-input) component, you can also set it to automatically configure the player's UI Input Module to use the player's Actions. See the documentation on [Player Input](xref:input-system-player-input#ui-input) to learn how.
-The properties of the Multiplayer Event System component are identical to those from the Event System component. Additionally, the Multplayer Event System component adds a [Player Root](../api/UnityEngine.InputSystem.UI.MultiplayerEventSystem.html#UnityEngine_InputSystem_UI_MultiplayerEventSystem_playerRoot) property, which you can set to a GameObject that contains all the UI [selectables](https://docs.unity3d.com/Manual/script-Selectable.html) this event system should handle in its hierarchy. Mouse input that this event system processes then ignores any UI selectables which are not on any GameObject in the Hierarchy under [Player Root](../api/UnityEngine.InputSystem.UI.MultiplayerEventSystem.html#UnityEngine_InputSystem_UI_MultiplayerEventSystem_playerRoot).
+The properties of the Multiplayer Event System component are identical to those from the Event System component. Additionally, the Multplayer Event System component adds a [Player Root](xref:UnityEngine.InputSystem.UI.MultiplayerEventSystem.playerRoot) property, which you can set to a GameObject that contains all the UI [selectables](https://docs.unity3d.com/Manual/script-Selectable.html) this event system should handle in its hierarchy. Mouse input that this event system processes then ignores any UI selectables which are not on any GameObject in the Hierarchy under [Player Root](xref:UnityEngine.InputSystem.UI.MultiplayerEventSystem.playerRoot).
## Virtual mouse cursor control
@@ -232,9 +216,10 @@ If your application uses gamepads and joysticks as an input, you can use the [na
The Input System package provides a **Virtual Mouse** component for this purpose.
-> **Note**: This component is only compatible with the [Unity UI](https://docs.unity3d.com/Manual/com.unity.ugui.html) (uGUI) system, and not UI Toolkit.
+> [!NOTE]
+> This component is only compatible with the [Unity UI](https://docs.unity3d.com/Manual/com.unity.ugui.html) (uGUI) system, and not UI Toolkit.
-To see an example of the Virtual Mouse in a project, see the [Gamepad Mouse Cursor sample](Installation.md#installing-samples) included with the Input System package.
+To see an example of the Virtual Mouse in a project, see the [Gamepad Mouse Cursor sample](xref:input-system-installation#install-samples) included with the Input System package.
### Using the Virtual Mouse component
@@ -247,32 +232,32 @@ To set up the Virtual Mouse component with the Unity UI system:
5. Add a **Virtual Mouse** component to the GameObject.
6. Drag the **Image** component of the pointer GameObject into the **Cursor Graphic** field of the Virtual Mouse component.
7. Drag the **Rect Transform** component of the pointer GameObject to the **Cursor Transform** field of the Virtual Mouse component.
-8. If you want the virtual mouse to control the system mouse cursor, set [Cursor Mode](../api/UnityEngine.InputSystem.UI.VirtualMouseInput.html#UnityEngine_InputSystem_UI_VirtualMouseInput_cursorMode) to **Hardware Cursor If Available**. In this mode, the **Cursor Graphic** is hidden when a system mouse is present and you use [Mouse.WarpCursorPosition](../api/UnityEngine.InputSystem.Mouse.html#UnityEngine_InputSystem_Mouse_WarpCursorPosition_UnityEngine_Vector2_) to move the system mouse cursor instead of the software cursor. The transform linked through **Cursor Transform** is not updated in that case.
+8. If you want the virtual mouse to control the system mouse cursor, set [Cursor Mode](xref:UnityEngine.InputSystem.UI.VirtualMouseInput.cursorMode) to **Hardware Cursor If Available**. In this mode, the **Cursor Graphic** is hidden when a system mouse is present and you use [Mouse.WarpCursorPosition](xref:UnityEngine.InputSystem.Mouse.WarpCursorPosition(UnityEngine.Vector2)) to move the system mouse cursor instead of the software cursor. The transform linked through **Cursor Transform** is not updated in that case.
9. To configure the input to drive the virtual mouse, either add bindings on the various actions (such as **Stick Action**), or enable **Use Reference** and link existing actions from an Input Actions asset.
-> **Important:**
+> [!IMPORTANT]
> Make sure the UI Input Module component on the UI's **Event System** does not receive navigation input from the same devices that feed into the Virtual Mouse component. If, for example, the Virtual Mouse component is set up to receive input from gamepads, and `Move`, `Submit`, and `Cancel` on the UI Input Module are also linked to the gamepad, then the UI receives input from the gamepad on two channels.
-
+
-At runtime, the component adds a virtual [Mouse](../api/UnityEngine.InputSystem.Mouse.html) device which the [InputSystemUIInputModule](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html) component picks up. The controls of the `Mouse` are fed input based on the actions configured on the [VirtualMouseInput](../api/UnityEngine.InputSystem.UI.VirtualMouseInput.html) component.
+At runtime, the component adds a virtual [Mouse](xref:UnityEngine.InputSystem.Mouse) device which the [InputSystemUIInputModule](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule) component picks up. The controls of the `Mouse` are fed input based on the actions configured on the [VirtualMouseInput](xref:UnityEngine.InputSystem.UI.VirtualMouseInput) component.
-Note that the resulting [Mouse](../api/UnityEngine.InputSystem.Mouse.html) input is visible in all code that picks up input from the mouse device. You can therefore use the component for mouse simulation elsewhere, not just with [InputSystemUIInputModule](../api/UnityEngine.InputSystem.UI.InputSystemUIInputModule.html).
+Note that the resulting [Mouse](xref:UnityEngine.InputSystem.Mouse) input is visible in all code that picks up input from the mouse device. You can therefore use the component for mouse simulation elsewhere, not just with [InputSystemUIInputModule](xref:UnityEngine.InputSystem.UI.InputSystemUIInputModule).
-> **Note**:
+> [!NOTE]
> Do not set up gamepads and joysticks for [navigation input](#navigation-type-input) while using the Virtual Mouse component. If both the Virtual Mouse component and navigation are configured, input is triggered twice: once via the pointer input path, and once via the navigation input path. If you encounter problems such as where buttons are pressed twice, this is likely the problem.
## Distinguishing between UI and game input
UI in Unity receives input through the same mechanisms as the input for the rest of your game or app. There is no automatic mechanism that implicitly ensures that if a certain input – such as a click – is consumed by the UI, it is not also received by your gameplay code.
-This can create ambiguities between, for example, code that responds to [`UI.Button.onClick`](https://docs.unity3d.com/Packages/com.unity.ugui@1.0/api/UnityEngine.UI.Button.html#UnityEngine_UI_Button_onClick) and code that responds to [`InputAction.performed`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_performed) of an Action bound to `/leftButton`.
+This can create ambiguities between, for example, code that responds to [`UI.Button.onClick`](https://docs.unity3d.com/Packages/com.unity.ugui@1.0/api/UnityEngine.UI.Button.html#UnityEngine_UI_Button_onClick) and code that responds to [`InputAction.performed`](xref:UnityEngine.InputSystem.InputAction.performed) of an Action bound to `/leftButton`.
Whether such ambiguities exist depends on *how* UIs are used. For example, you can avoid ambiguities by implementing your UI in one of the following ways:
* All interaction is performed through UI elements. A 2D/3D scene is rendered in the background but all interaction is performed through UI events (including those such as 'background' clicks on the `Canvas`).
* UI is overlaid over a 2D/3D scene but the UI elements cannot be interacted with directly.
-* UI is overlaid over a 2D/3D scene but there is a clear "mode" switch that determines if interaction is picked up by UI or by the game. For example, a first-person game on desktop may employ a [cursor lock](https://docs.unity3d.com/ScriptReference/Cursor-lockState.html) and direct input to the game while it is engaged whereas it may leave all interaction to the UI while the lock is not engaged.
+* UI is overlaid over a 2D/3D scene but there is a clear "mode" switch that determines if interaction is picked up by UI or by the game. For example, a first-person game on desktop may employ a [cursor lock](xref:UnityEngine.Cursor.lockState) and direct input to the game while it is engaged whereas it may leave all interaction to the UI while the lock is not engaged.
When ambiguities arise, they do so differently for [pointer-type](#pointer-type-input) and [navigation-type](#navigation-type-input).
@@ -283,12 +268,12 @@ When ambiguities arise, they do so differently for [pointer-type](#pointer-type-
Input from pointers (mice, touchscreens, pens) can be ambiguous depending on whether or not the pointer is over a UI element when initiating an interaction. For example, if there is a button on screen, then clicking on the button may lead to a different outcome than clicking outside of the button and within the game scene.
-If all pointer input is handled via UI events, no ambiguities arise as the UI will implicitly route input to the respective receiver. If, however, input within the UI is handled via UI events and input in the game is handled via [Actions](./Actions.md), pointer input will by default lead to *both* being triggered.
+If all pointer input is handled via UI events, no ambiguities arise as the UI will implicitly route input to the respective receiver. If, however, input within the UI is handled via UI events and input in the game is handled via [Actions](xref:input-system-actions), pointer input will by default lead to *both* being triggered.
-The easiest way to resolve such ambiguities is to respond to in-game actions by [polling](RespondingToActions.md#polling-actions) from inside [`MonoBehaviour.Update`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.Update.html) methods and using [`EventSystem.IsPointerOverGameObject`](https://docs.unity3d.com/Packages/com.unity.ugui@1.0/api/UnityEngine.EventSystems.EventSystem.html?q=ispointerovergameobject#UnityEngine_EventSystems_EventSystem_IsPointerOverGameObject) to find out whether the pointer is over UI or not. Another way is to use [`EventSystem.RaycastAll`](https://docs.unity3d.com/Packages/com.unity.ugui@1.0/api/UnityEngine.EventSystems.EventSystem.html?q=ispointerovergameobj#UnityEngine_EventSystems_EventSystem_RaycastAll_UnityEngine_EventSystems_PointerEventData_System_Collections_Generic_List_UnityEngine_EventSystems_RaycastResult__) to determine if the pointer is currently over UI.
+The easiest way to resolve such ambiguities is to respond to in-game actions by [polling](xref:input-system-responding#polling-actions) from inside [`MonoBehaviour.Update`](xref:MonoBehaviour.Update) methods and using [`EventSystem.IsPointerOverGameObject`](https://docs.unity3d.com/Packages/com.unity.ugui@1.0/api/UnityEngine.EventSystems.EventSystem.html?q=ispointerovergameobject#UnityEngine_EventSystems_EventSystem_IsPointerOverGameObject) to find out whether the pointer is over UI or not. Another way is to use [`EventSystem.RaycastAll`](https://docs.unity3d.com/Packages/com.unity.ugui@1.0/api/UnityEngine.EventSystems.EventSystem.html?q=ispointerovergameobj#UnityEngine_EventSystems_EventSystem_RaycastAll_UnityEngine_EventSystems_PointerEventData_System_Collections_Generic_List_UnityEngine_EventSystems_RaycastResult__) to determine if the pointer is currently over UI.
>[!NOTE]
->Calling [`EventSystem.IsPointerOverGameObject`](https://docs.unity3d.com/Packages/com.unity.ugui@1.0/api/UnityEngine.EventSystems.EventSystem.html?q=ispointerovergameobject#UnityEngine_EventSystems_EventSystem_IsPointerOverGameObject) from within [`InputAction`](../api/UnityEngine.InputSystem.InputAction.html) callbacks such as [`InputAction.performed`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_performed) will lead to a warning. The UI updates separately *after* input processing and UI state thus corresponds to that of the *last* frame/update while input is being processed.
+>Calling [`EventSystem.IsPointerOverGameObject`](https://docs.unity3d.com/Packages/com.unity.ugui@1.0/api/UnityEngine.EventSystems.EventSystem.html?q=ispointerovergameobject#UnityEngine_EventSystems_EventSystem_IsPointerOverGameObject) from within [`InputAction`](xref:UnityEngine.InputSystem.InputAction) callbacks such as [`InputAction.performed`](xref:UnityEngine.InputSystem.InputAction.performed) will lead to a warning. The UI updates separately *after* input processing and UI state thus corresponds to that of the *last* frame/update while input is being processed.
### Handling ambiguities for navigation-type input
diff --git a/Packages/com.unity.inputsystem/Documentation~/UseInEditor.md b/Packages/com.unity.inputsystem/Documentation~/UseInEditor.md
index 39ce07c6c0..046b99eae9 100644
--- a/Packages/com.unity.inputsystem/Documentation~/UseInEditor.md
+++ b/Packages/com.unity.inputsystem/Documentation~/UseInEditor.md
@@ -24,7 +24,8 @@ class MyEditorWindow : EditorWindow
This encompasses all code called from `OnGUI()` methods, which means that you can also use the Input System in property drawers, Inspectors, and other similar places.
->__Note__: Unity doesn't support Actions in Edit mode.
+> [!NOTE]
+> Unity doesn't support Actions in Edit mode.
## Coordinate System
diff --git a/Packages/com.unity.inputsystem/Documentation~/UserManagement.md b/Packages/com.unity.inputsystem/Documentation~/UserManagement.md
index 47fa81c315..6b306b861e 100644
--- a/Packages/com.unity.inputsystem/Documentation~/UserManagement.md
+++ b/Packages/com.unity.inputsystem/Documentation~/UserManagement.md
@@ -3,25 +3,27 @@ uid: input-system-user-management
---
# User Management
-The Input System supports multi-user management through the [`InputUser`](../api/UnityEngine.InputSystem.Users.InputUser.html) class. This comprises both user account management features on platforms that have these capabilities built into them (such as Xbox and PS4), as well as features to manage Device allocations to one or more local users.
+The Input System supports multi-user management through the [`InputUser`](xref:UnityEngine.InputSystem.Users.InputUser) class. This comprises both user account management features on platforms that have these capabilities built into them (such as Xbox and PS4), as well as features to manage Device allocations to one or more local users.
->__Note__: The user management API is quite low-level in nature. The stock functionality of Player Input Manager component (see [Player Input Manager](PlayerInputManager.md)) provides an easier way to set up user management. The API described here is useful when you want more control over user management.
+> [!NOTE]
+> The user management API is quite low-level in nature. The stock functionality of Player Input Manager component (see [Player Input Manager](xref:input-system-player-input-manager)) provides an easier way to set up user management. The API described here is useful when you want more control over user management.
-In the Input System, each [`InputUser`](../api/UnityEngine.InputSystem.Users.InputUser.html) represents a human interacting with the application. For example, you can have multiple users playing a game together on a single computer or device (local multiplayer), where each user has one or more [paired Input Devices](#device-pairing).
+In the Input System, each [`InputUser`](xref:UnityEngine.InputSystem.Users.InputUser) represents a human interacting with the application. For example, you can have multiple users playing a game together on a single computer or device (local multiplayer), where each user has one or more [paired Input Devices](#device-pairing).
-The [`PlayerInputManager`](PlayerInputManager.md) class uses [`InputUser`](../api/UnityEngine.InputSystem.Users.InputUser.html) internally to handle users.
+The [`PlayerInputManager`](xref:input-system-player-input-manager) class uses [`InputUser`](xref:UnityEngine.InputSystem.Users.InputUser) internally to handle users.
->__Note__: In the editor, all `InputUser` instances are automatically removed when exiting play mode thus also removing any device pairings. In essence, `InputUser` is considered a player-only API.
+> [!NOTE]
+> In the editor, all `InputUser` instances are automatically removed when exiting play mode thus also removing any device pairings. In essence, `InputUser` is considered a player-only API.
## Device pairing
-You can use the [`InputUser.PerformPairingWithDevice`](../api/UnityEngine.InputSystem.Users.InputUser.html#UnityEngine_InputSystem_Users_InputUser_PerformPairingWithDevice_UnityEngine_InputSystem_InputDevice_UnityEngine_InputSystem_Users_InputUser_UnityEngine_InputSystem_Users_InputUserPairingOptions_) method to create a new [`InputUser`](../api/UnityEngine.InputSystem.Users.InputUser.html) instance and pair it with an [`InputDevice`](../api/UnityEngine.InputSystem.InputDevice.html). You can also optionally pass in an existing [`InputUser`](../api/UnityEngine.InputSystem.Users.InputUser.html) instance to pair it with the Device, if you don't want to create a new user instance.
+You can use the [`InputUser.PerformPairingWithDevice`](xref:UnityEngine.InputSystem.Users.InputUser.PerformPairingWithDevice(UnityEngine.InputSystem.InputDevice,UnityEngine.InputSystem.Users.InputUser,UnityEngine.InputSystem.Users.InputUserPairingOptions)) method to create a new [`InputUser`](xref:UnityEngine.InputSystem.Users.InputUser) instance and pair it with an [`InputDevice`](xref:UnityEngine.InputSystem.InputDevice). You can also optionally pass in an existing [`InputUser`](xref:UnityEngine.InputSystem.Users.InputUser) instance to pair it with the Device, if you don't want to create a new user instance.
-To query the Devices paired to a specific [`InputUser`](../api/UnityEngine.InputSystem.Users.InputUser.html), use [`InputUser.pairedDevices`](../api/UnityEngine.InputSystem.Users.InputUser.html#UnityEngine_InputSystem_Users_InputUser_pairedDevices). To remove the pairing, use [`InputUser.UnpairDevice`](../api/UnityEngine.InputSystem.Users.InputUser.html#UnityEngine_InputSystem_Users_InputUser_UnpairDevice_UnityEngine_InputSystem_InputDevice_) or [`InputUser.UnpairDevices`](../api/UnityEngine.InputSystem.Users.InputUser.html#UnityEngine_InputSystem_Users_InputUser_UnpairDevices).
+To query the Devices paired to a specific [`InputUser`](xref:UnityEngine.InputSystem.Users.InputUser), use [`InputUser.pairedDevices`](xref:UnityEngine.InputSystem.Users.InputUser.pairedDevices). To remove the pairing, use [`InputUser.UnpairDevice`](xref:UnityEngine.InputSystem.Users.InputUser.UnpairDevice(UnityEngine.InputSystem.InputDevice)) or [`InputUser.UnpairDevices`](xref:UnityEngine.InputSystem.Users.InputUser.UnpairDevices).
### Initial engagement
-After you create a user, you can use [`InputUser.AssociateActionsWithUser`](../api/UnityEngine.InputSystem.Users.InputUser.html#UnityEngine_InputSystem_Users_InputUser_AssociateActionsWithUser_UnityEngine_InputSystem_IInputActionCollection_) to associate [Input Actions](Actions.md) to it, and use [`InputUser.ActivateControlScheme`](../api/UnityEngine.InputSystem.Users.InputUser.html#UnityEngine_InputSystem_Users_InputUser_ActivateControlScheme_System_String_) to associate and activate a [Control Scheme](ActionBindings.md#control-schemes). You can use [`InputControlScheme.FindControlSchemeForDevice`](../api/UnityEngine.InputSystem.InputControlScheme.html#UnityEngine_InputSystem_InputControlScheme_FindControlSchemeForDevice__1_UnityEngine_InputSystem_InputDevice___0_) to pick a control scheme that matches the selected Actions and Device:
+After you create a user, you can use [`InputUser.AssociateActionsWithUser`](xref:UnityEngine.InputSystem.Users.InputUser.AssociateActionsWithUser(UnityEngine.InputSystem.IInputActionCollection)) to associate [Input Actions](xref:input-system-actions) to it, and use [`InputUser.ActivateControlScheme`](xref:UnityEngine.InputSystem.Users.InputUser.ActivateControlScheme(System.String)) to associate and activate a [Control Scheme](xref:input-system-action-bindings#control-schemes). You can use [`InputControlScheme.FindControlSchemeForDevice`](xref:UnityEngine.InputSystem.InputControlScheme.FindControlSchemeForDevice``1(UnityEngine.InputSystem.InputDevice,``0)) to pick a control scheme that matches the selected Actions and Device:
```
var scheme = InputControlScheme.FindControlSchemeForDevice(user.pairedDevices[0], user.actions.controlsSchemes);
@@ -33,10 +35,10 @@ When you activate a Control Scheme, the Input System automatically switches the
### Loss of Device
-If paired Input Devices disconnect during the session, the system notifies the [`InputUser`](../api/UnityEngine.InputSystem.Users.InputUser.html) class. It still keeps track of the Device, and automatically re-pairs the Device if it becomes available again.
+If paired Input Devices disconnect during the session, the system notifies the [`InputUser`](xref:UnityEngine.InputSystem.Users.InputUser) class. It still keeps track of the Device, and automatically re-pairs the Device if it becomes available again.
-To get notifications about these changes, subscribe to the [`InputUser.onChange`](../api/UnityEngine.InputSystem.Users.InputUser.html#UnityEngine_InputSystem_Users_InputUser_onChange) event.
+To get notifications about these changes, subscribe to the [`InputUser.onChange`](xref:UnityEngine.InputSystem.Users.InputUser.onChange) event.
## Debugging
-Check the debugger documentation to learn [how to debug active users](Debugging.md#debugging-users-and-playerinput).
+Check the debugger documentation to learn [how to debug active users](xref:input-system-debugging#debugging-users-and-playerinput).
diff --git a/Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md b/Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md
index 102e9196d5..9c1a0056a5 100644
--- a/Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md
+++ b/Packages/com.unity.inputsystem/Documentation~/UsingProcessors.md
@@ -6,15 +6,15 @@ uid: input-system-processors
An Input Processor takes a value and returns a processed result for it. The received value and result value must be of the same type. For example, you can use a [clamp](#clamp) Processor to clamp values from a control to a certain range.
> [!NOTE]
-> To convert received input values into different types, refer to [composite Bindings](ActionBindings.md#composite-bindings).
+> To convert received input values into different types, refer to [composite Bindings](xref:input-system-action-bindings#composite-bindings).
## Using Processors
-You can install Processors on [bindings](ActionBindings.md), [actions](Actions.md) or on [controls](Controls.md). Refer to [How to apply Processors](HowToApplyProcessors.md) to learn more.
+You can install Processors on [bindings](xref:input-system-action-bindings), [actions](xref:input-system-actions) or on [controls](xref:input-system-controls). Refer to [How to apply Processors](xref:input-system-processors) to learn more.
-Each Processor is [registered](../api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_RegisterProcessor__1_System_String_) using a unique name. To replace an existing one, register your own under an existing name.
+Each Processor is [registered](xref:UnityEngine.InputSystem.InputSystem.RegisterProcessor``1(System.String)) using a unique name. To replace an existing one, register your own under an existing name.
-Processors can have parameters which can be booleans, integers, or floating-point numbers. When created in data such as [bindings](./ActionBindings.md), processors are described as strings that look like function calls:
+Processors can have parameters which can be booleans, integers, or floating-point numbers. When created in data such as [bindings](xref:input-system-action-bindings), processors are described as strings that look like function calls:
```CSharp
// This references the processor registered as "scale" and sets its "factor"
@@ -88,7 +88,8 @@ To apply the Processor, add it to the Binding, as shown in the image below.

->__Note__: This scenario uses the [Starter Assets](https://assetstore.unity.com/packages/essentials/starter-assets-thirdperson-updates-in-new-charactercontroller-pa-196526?srsltid=AfmBOoqLWdW2pU5Wt2reGYdWVodc1e0ko3cBKtfMQuPSgVqmL7yVA3dB), and the included PlayerScript is utilized to move the player.
+> [!NOTE]
+> This scenario uses the [Starter Assets](https://assetstore.unity.com/packages/essentials/starter-assets-thirdperson-updates-in-new-charactercontroller-pa-196526?srsltid=AfmBOoqLWdW2pU5Wt2reGYdWVodc1e0ko3cBKtfMQuPSgVqmL7yVA3dB), and the included PlayerScript is utilized to move the player.
### Scale
@@ -107,7 +108,8 @@ There are two Bindings attached to the Action. The input value ranges of the two


->__Note__: This scenario uses the [Starter Assets](https://assetstore.unity.com/packages/essentials/starter-assets-thirdperson-updates-in-new-charactercontroller-pa-196526?srsltid=AfmBOoqLWdW2pU5Wt2reGYdWVodc1e0ko3cBKtfMQuPSgVqmL7yVA3dB), and the included PlayerScript is utilized to rotate the camera.
+> [!NOTE]
+> This scenario uses the [Starter Assets](https://assetstore.unity.com/packages/essentials/starter-assets-thirdperson-updates-in-new-charactercontroller-pa-196526?srsltid=AfmBOoqLWdW2pU5Wt2reGYdWVodc1e0ko3cBKtfMQuPSgVqmL7yVA3dB), and the included PlayerScript is utilized to rotate the camera.
#### Example: Custom mouse sensitivity
@@ -126,7 +128,8 @@ You may want to use the Deadzone Processor to improve accessibility for physical
The default minimum value is overridden to allow a higher threshold for minimum input values. For the maximum value, the default is used to standardize the values across all gamepads (since not all gamepads may ever send the maximum value).
->__Note__: This scenario uses the [Starter Assets](https://assetstore.unity.com/packages/essentials/starter-assets-thirdperson-updates-in-new-charactercontroller-pa-196526?srsltid=AfmBOoqLWdW2pU5Wt2reGYdWVodc1e0ko3cBKtfMQuPSgVqmL7yVA3dB), and the included PlayerScript is utilized to rotate the camera.
+> [!NOTE]
+> This scenario uses the [Starter Assets](https://assetstore.unity.com/packages/essentials/starter-assets-thirdperson-updates-in-new-charactercontroller-pa-196526?srsltid=AfmBOoqLWdW2pU5Wt2reGYdWVodc1e0ko3cBKtfMQuPSgVqmL7yVA3dB), and the included PlayerScript is utilized to rotate the camera.
### Clamp
@@ -139,4 +142,5 @@ In the following image, you can see how a Clamp Processor can be used to restric

->__Note__: The Bindings can contain input values with very different ranges. In that case, a Scale Processor on the Bindings can help preprocess the values before clamping them (Processors on Actions are applied after Processors on Bindings).
+> [!NOTE]
+> The Bindings can contain input values with very different ranges. In that case, a Scale Processor on the Bindings can help preprocess the values before clamping them (Processors on Actions are applied after Processors on Bindings).
diff --git a/Packages/com.unity.inputsystem/Documentation~/Workflow-Actions.md b/Packages/com.unity.inputsystem/Documentation~/Workflow-Actions.md
index 6e63320bdc..a8eaf7baa8 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Workflow-Actions.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Workflow-Actions.md
@@ -14,7 +14,7 @@ In this workflow, you configure Actions in the [**Input Actions** editor](Action
Open the Input System settings by going to **Edit** > **Project Settings** > **Input System Package** > **Input Actions**.
-If you have not yet created and assigned the default [project-wide actions](ProjectWideActions.md), the Input System settings window displays a button to do this.
+If you have not yet created and assigned the default [project-wide actions](xref:project-wide-actions), the Input System settings window displays a button to do this.
Once you have created and assigned the default project-wide actions, the Actions Editor is displayed:
@@ -101,7 +101,7 @@ public class Example : MonoBehaviour
> You should avoid using `FindAction` in your `Update()` loop, because it performs a string-based lookup which could impact performance. This is why the Action references in the example above are found during the Start() function, and stored in variables after finding them.
> [!NOTE]
-> The [InputSystem.actions](../api/UnityEngine.InputSystem.InputSystem.html) API refers specifically to the Action Asset assigned as the [project-wide actions](ProjectWideActions.md). Most projects only require one Action Asset, but if you are using more than one Action Asset, you must create a reference using the type InputActionAsset to the asset you want to access.
+> The [InputSystem.actions](xref:UnityEngine.InputSystem.InputSystem) API refers specifically to the Action Asset assigned as the [project-wide actions](xref:project-wide-actions). Most projects only require one Action Asset, but if you are using more than one Action Asset, you must create a reference using the type InputActionAsset to the asset you want to access.
## Pros and Cons
@@ -109,4 +109,4 @@ This is the recommended workflow with the Input System Package, providing a flex
You benefit from the Action-based features such as Action Maps, Bindings, and the ability to configure them in the Actions Editor. You can also implement [user rebinding at runtime](ActionBindings.html#interactive-rebinding).
-This workflow alone doesn't provide built-in support for local multiplayer scenarios with multiple devices, so if you are producing a local multiplayer game you might want to consider using the [Actions and PlayerInput](./Workflow-PlayerInput.md) workflow.
+This workflow alone doesn't provide built-in support for local multiplayer scenarios with multiple devices, so if you are producing a local multiplayer game you might want to consider using the [Actions and PlayerInput](xref:input-system-workflow-player-input) workflow.
diff --git a/Packages/com.unity.inputsystem/Documentation~/Workflow-Direct.md b/Packages/com.unity.inputsystem/Documentation~/Workflow-Direct.md
index 6a260bcebb..6aaa58f474 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Workflow-Direct.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Workflow-Direct.md
@@ -6,7 +6,7 @@ uid: input-system-workflow-direct
-This is the simplest and most direct input workflow, but the least flexible. It bypasses the [Input Actions editor](ActionsEditor.md), so you do not benefit from all the features come with [Actions](Actions.md).
+This is the simplest and most direct input workflow, but the least flexible. It bypasses the [Input Actions editor](xref:input-system-configuring-input), so you do not benefit from all the features come with [Actions](xref:input-system-actions).
It can be useful if you want a quick implementation with one specific type of device. It's generally not the best choice if you want to provide your users with multiple types of input or if you want to target multiple platforms.
@@ -39,7 +39,7 @@ public class MyPlayerScript : MonoBehaviour
}
```
-The example above reads values directly from the right trigger, and the left stick, of the currently connected [gamepad](Gamepad.html). It does not use the input system’s "Action" class, and instead the conceptual actions in your game or app, such as "move" and "use", are implicitly defined by what your code does in response to the input. You can use the same approach for other Device types such as the [keyboard](../api/UnityEngine.InputSystem.Keyboard.html) or [mouse](../api/UnityEngine.InputSystem.Mouse.html).
+The example above reads values directly from the right trigger, and the left stick, of the currently connected [gamepad](Gamepad.html). It does not use the input system’s "Action" class, and instead the conceptual actions in your game or app, such as "move" and "use", are implicitly defined by what your code does in response to the input. You can use the same approach for other Device types such as the [keyboard](xref:UnityEngine.InputSystem.Keyboard) or [mouse](xref:UnityEngine.InputSystem.Mouse).
## Pros and Cons
diff --git a/Packages/com.unity.inputsystem/Documentation~/Workflow-PlayerInput.md b/Packages/com.unity.inputsystem/Documentation~/Workflow-PlayerInput.md
index f0c4457631..b2f45b6154 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Workflow-PlayerInput.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Workflow-PlayerInput.md
@@ -53,7 +53,7 @@ public class ExampleScript : MonoBehaviour
```
> [!NOTE]
-> As a general rule, if you are using the PlayerInput workflow, you should read input through callbacks as described above, however if you need to access the input actions asset directly while using the PlayerInput component, you should access the [PlayerInput component's copy of the actions](../api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_actions), not `InputSystem.actions`.
+> As a general rule, if you are using the PlayerInput workflow, you should read input through callbacks as described above, however if you need to access the input actions asset directly while using the PlayerInput component, you should access the [PlayerInput component's copy of the actions](xref:UnityEngine.InputSystem.PlayerInput.actions), not `InputSystem.actions`.
>
> This is because the PlayerInput component performs device filtering to automatically assign devices to multiple players, so each instance has its own copy of the actions filtered for each player. If you bypass this by reading `InputSystem.actions` directly, the automatic device assignment won't work.
diff --git a/Packages/com.unity.inputsystem/Documentation~/Workflows.md b/Packages/com.unity.inputsystem/Documentation~/Workflows.md
index a9d75753f5..9b1b8a3a79 100644
--- a/Packages/com.unity.inputsystem/Documentation~/Workflows.md
+++ b/Packages/com.unity.inputsystem/Documentation~/Workflows.md
@@ -14,9 +14,9 @@ The descriptions below describe these main workflows and link to more detailed d
| **Workflow** | **Interactions** |
|---|---|
-|[**Using Actions**](Workflow-Actions.md) This is the **recommended** workflow for most situations. In this workflow, you use the [Actions Editor window](./ActionsEditor.md) to configure sets of actions and bindings, then set up references and read the values for those actions in your code.||
-|[**Using Actions and the PlayerInput Component**](Workflow-PlayerInput.md) This workflow provides extra features that allow you to connect up **callbacks** directly from Actions to your own callback handler methods, removing the need to deal with Action references in your code. It also provides features that are useful in **local multiplayer** scenarios such as device assignment and split-screen functionality.||
-|[**Directly read device states**](Workflow-Direct.md) This workflow is a simplified, script-only approach which bypasses the Actions and Bindings features entirely. Instead your script explicitly references specific device controls (such as "left gamepad stick") and reads the values directly. This is suitable for **fast prototyping**, or single fixed platform scenarios. It is a **less flexible** workflow because it bypasses some of the main input system features||
+|[**Using Actions**](xref:input-system-workflow-project-wide-actions) This is the **recommended** workflow for most situations. In this workflow, you use the [Actions Editor window](xref:input-system-configuring-input) to configure sets of actions and bindings, then set up references and read the values for those actions in your code.||
+|[**Using Actions and the PlayerInput Component**](xref:input-system-workflow-player-input) This workflow provides extra features that allow you to connect up **callbacks** directly from Actions to your own callback handler methods, removing the need to deal with Action references in your code. It also provides features that are useful in **local multiplayer** scenarios such as device assignment and split-screen functionality.||
+|[**Directly read device states**](xref:input-system-workflow-direct) This workflow is a simplified, script-only approach which bypasses the Actions and Bindings features entirely. Instead your script explicitly references specific device controls (such as "left gamepad stick") and reads the values directly. This is suitable for **fast prototyping**, or single fixed platform scenarios. It is a **less flexible** workflow because it bypasses some of the main input system features||
diff --git a/Packages/com.unity.inputsystem/Documentation~/index.md b/Packages/com.unity.inputsystem/Documentation~/index.md
index e38763895d..e348399e11 100644
--- a/Packages/com.unity.inputsystem/Documentation~/index.md
+++ b/Packages/com.unity.inputsystem/Documentation~/index.md
@@ -15,8 +15,8 @@ Unity supports input through two separate systems, one older, and one newer.
The older system, which is built-in to the editor, is called the [Input Manager](https://docs.unity3d.com/Manual/class-InputManager.html). The Input Manager is part of the core Unity platform and is the default, if you do not install this Input System Package.
-This **Input System package** is a newer, more flexible system, which allows you to use any kind of Input Device to control your Unity content. It's intended to be a replacement for Unity's classic Input Manager. It is referred to as "The Input System Package", or just **"The Input System"**. To use it, you must [install it into your project using the Package Manager](Installation.md).
+This **Input System package** is a newer, more flexible system, which allows you to use any kind of Input Device to control your Unity content. It's intended to be a replacement for Unity's classic Input Manager. It is referred to as "The Input System Package", or just **"The Input System"**. To use it, you must [install it into your project using the Package Manager](xref:input-system-installation).
-During the installation process for the Input System package, the installer offers to automatically deactivate the older built-in system. ([Read more](Installation.md))
+During the installation process for the Input System package, the installer offers to automatically deactivate the older built-in system. ([Read more](xref:input-system-installation))
-To get started, see the [Installation](Installation.md) and [Workflows](Workflows.md) sections. For a demo project, see the [Warriors demo](https://github.com/UnityTechnologies/InputSystem_Warriors) on GitHub.
+To get started, see the [Installation](xref:input-system-installation) and [Workflows](xref:input-system-workflows) sections. For a demo project, see the [Warriors demo](https://github.com/UnityTechnologies/InputSystem_Warriors) on GitHub.
diff --git a/Packages/com.unity.inputsystem/Documentation~/timing-and-latency.md b/Packages/com.unity.inputsystem/Documentation~/timing-and-latency.md
index 2b3d2b8b58..c701a1504d 100644
--- a/Packages/com.unity.inputsystem/Documentation~/timing-and-latency.md
+++ b/Packages/com.unity.inputsystem/Documentation~/timing-and-latency.md
@@ -13,9 +13,9 @@ To minimize input latency, and to avoid missed or duplicate events, it helps to
| **Topic** | **Description** |
| :------------------------------ | :------------------------------- |
-| **[Input events queue](timing-input-events-queue.md)** | Understand how and when the Input System receives and processes input from devices. |
-| **[Select an input processing mode](timing-select-mode.md)** | How to select an appropriate **Update Mode** which controls when the Input System processes queued input events. |
-| **[Optimize for dynamic update](timing-optimize-dynamic-update.md)** | How to optimize input for use in `Update` calls. |
-| **[Optimize for fixed update](timing-optimize-fixed-update.md)** | How to optimize input for use in `FixedUpdate` calls. |
-| **[Avoid missed or duplicate events](timing-missed-duplicate-events.md)** | How to avoid missing or duplicated discrete input events like when a button was pressed or released. |
-| **[Mixed timing scenarios](timing-mixed-scenarios.md)** | How to optimize and avoid problems when using input in both `Update` and `FixedUpdate` calls. |
+| **[Input events queue](xref:input-system-timing-queue)** | Understand how and when the Input System receives and processes input from devices. |
+| **[Select an input processing mode](xref:input-system-timing-select)** | How to select an appropriate **Update Mode** which controls when the Input System processes queued input events. |
+| **[Optimize for dynamic update](xref:input-system-timing-optimize-dynamic)** | How to optimize input for use in `Update` calls. |
+| **[Optimize for fixed update](xref:input-system-timing-optimize-fixed)** | How to optimize input for use in `FixedUpdate` calls. |
+| **[Avoid missed or duplicate events](xref:input-system-timing-missed)** | How to avoid missing or duplicated discrete input events like when a button was pressed or released. |
+| **[Mixed timing scenarios](xref:input-system-timing-mixed)** | How to optimize and avoid problems when using input in both `Update` and `FixedUpdate` calls. |
diff --git a/Packages/com.unity.inputsystem/Documentation~/timing-input-events-queue.md b/Packages/com.unity.inputsystem/Documentation~/timing-input-events-queue.md
index cb05a3a48e..d52f03aa63 100644
--- a/Packages/com.unity.inputsystem/Documentation~/timing-input-events-queue.md
+++ b/Packages/com.unity.inputsystem/Documentation~/timing-input-events-queue.md
@@ -1,3 +1,6 @@
+---
+uid: input-system-timing-queue
+---
# The input events queue
The Input System receives information from hardware input devices as a stream of events. These events represent either system events received from the input device, or snapshots in time based on frequent samples from the device.
@@ -14,7 +17,7 @@ Because a device can cause events at times when the input system can't process t
Unity’s player loop repeats at frequent intervals depending on how fast your game or app is running. The player loop repeats once per frame, and performs the Update and FixedUpdate calls. However, the player loop in your game or app usually runs at a rate that's different to the rate of incoming events from input controls, which tend to have their own rate of operation.
-This means that each time an Update cycle occurs while a user is moving an input control, there's likely to be a queue of events representing the gradual change in values that occurred between the last frame and the current frame. This queue is processed at the beginning of the next Update or FixedUpdate, depending on which [**Input Update Mode**](timing-select-mode.md) you're using.
+This means that each time an Update cycle occurs while a user is moving an input control, there's likely to be a queue of events representing the gradual change in values that occurred between the last frame and the current frame. This queue is processed at the beginning of the next Update or FixedUpdate, depending on which [**Input Update Mode**](xref:input-system-timing-select) you're using.
## Event grouping and processing
diff --git a/Packages/com.unity.inputsystem/Documentation~/timing-missed-duplicate-events.md b/Packages/com.unity.inputsystem/Documentation~/timing-missed-duplicate-events.md
index d8ac7992c9..fb5c39a67b 100644
--- a/Packages/com.unity.inputsystem/Documentation~/timing-missed-duplicate-events.md
+++ b/Packages/com.unity.inputsystem/Documentation~/timing-missed-duplicate-events.md
@@ -1,9 +1,12 @@
+---
+uid: input-system-timing-missed
+---
# Avoid missed or duplicate discrete events
-Discrete events are simple on/off events that occur when a user presses or releases a control such as a gamepad button, key, mouse, or touch press. This is in contrast to continuously changing values like those from gamepad stick movement. You can poll for these types of discrete event by using [`WasPressedThisFrame`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasPressedThisFrame_) or [`WasReleasedThisFrame`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasReleasedThisFrame_). However, you can get incorrect results such as missing an event or appearing to receive multiple, if you check for them at the wrong time.
+Discrete events are simple on/off events that occur when a user presses or releases a control such as a gamepad button, key, mouse, or touch press. This is in contrast to continuously changing values like those from gamepad stick movement. You can poll for these types of discrete event by using [`WasPressedThisFrame`](xref:UnityEngine.InputSystem.InputAction.WasPressedThisFrame*) or [`WasReleasedThisFrame`](xref:UnityEngine.InputSystem.InputAction.WasReleasedThisFrame*). However, you can get incorrect results such as missing an event or appearing to receive multiple, if you check for them at the wrong time.
-If your Update Mode is set to **Process in FixedUpdate**, you must ensure that you only use [`WasPressedThisFrame`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasPressedThisFrame_) or [`WasReleasedThisFrame`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasReleasedThisFrame_) in **FixedUpdate** calls. Using them in Update might either miss events, or returns true across multiple consecutive frames depending on whether the frame rate is running slower or faster than the fixed time step.
+If your Update Mode is set to **Process in FixedUpdate**, you must ensure that you only use [`WasPressedThisFrame`](xref:UnityEngine.InputSystem.InputAction.WasPressedThisFrame*) or [`WasReleasedThisFrame`](xref:UnityEngine.InputSystem.InputAction.WasReleasedThisFrame*) in **FixedUpdate** calls. Using them in Update might either miss events, or returns true across multiple consecutive frames depending on whether the frame rate is running slower or faster than the fixed time step.
-Conversely, if your Update Mode is set to **process in Dynamic Update**, you must ensure that you only use [`WasPressedThisFrame`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasPressedThisFrame_) or [`WasReleasedThisFrame`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasReleasedThisFrame_) in `Update` calls. Using them in `FixedUpdate` might either miss events, or return true across multiple consecutive frames depending on whether the fixed time step is running slower or faster than your game’s frame rate.
+Conversely, if your Update Mode is set to **process in Dynamic Update**, you must ensure that you only use [`WasPressedThisFrame`](xref:UnityEngine.InputSystem.InputAction.WasPressedThisFrame*) or [`WasReleasedThisFrame`](xref:UnityEngine.InputSystem.InputAction.WasReleasedThisFrame*) in `Update` calls. Using them in `FixedUpdate` might either miss events, or return true across multiple consecutive frames depending on whether the fixed time step is running slower or faster than your game’s frame rate.
If you find that you're missing events that should have been detected, or are receiving multiple events for what should have been a single press or release of a control, the reason is probably that you either have your Input Update Mode set to the wrong setting, or that you're reading the state of these events in the wrong `Update` or `FixedUpdate` call.
diff --git a/Packages/com.unity.inputsystem/Documentation~/timing-mixed-scenarios.md b/Packages/com.unity.inputsystem/Documentation~/timing-mixed-scenarios.md
index 787a48c853..73d80eb27f 100644
--- a/Packages/com.unity.inputsystem/Documentation~/timing-mixed-scenarios.md
+++ b/Packages/com.unity.inputsystem/Documentation~/timing-mixed-scenarios.md
@@ -1,8 +1,11 @@
+---
+uid: input-system-timing-mixed
+---
# Mixed timing scenarios with fixed and dynamic input
-There are some situations where you might set the Update Mode **process in Dynamic Update** even when using input code in `FixedUpdate`, to minimize input latency, as described in the [previous section](./timing-optimize-fixed-update.md).
+There are some situations where you might set the Update Mode **process in Dynamic Update** even when using input code in `FixedUpdate`, to minimize input latency, as described in the [previous section](xref:input-system-timing-optimize-fixed).
-In this situation, for discrete events you must ensure that you use [`WasPressedThisFrame`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasPressedThisFrame_) or [`WasReleasedThisFrame`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasReleasedThisFrame_) in `Update`, and pass through a variable to your `FixedUpdate` code to indicate the event happened. There may still be some latency between the frame in which the event occurred, and the next `FixedUpdate` call.
+In this situation, for discrete events you must ensure that you use [`WasPressedThisFrame`](xref:UnityEngine.InputSystem.InputAction.WasPressedThisFrame*) or [`WasReleasedThisFrame`](xref:UnityEngine.InputSystem.InputAction.WasReleasedThisFrame*) in `Update`, and pass through a variable to your `FixedUpdate` code to indicate the event happened. There may still be some latency between the frame in which the event occurred, and the next `FixedUpdate` call.
For example:
@@ -47,7 +50,7 @@ public class ExampleScript : MonoBehaviour
A technique to give the user the feel of absolute minimum latency while still using `FixedUpdate` is to respond as fast as possible in `Update` giving some visual feedback, but also respond to that same input in `FixedUpdate` for your physics system code. For example, you could display the start of a "jump" animation immediately in `Update`, while applying physics to correspond with the "jump" animation in the next available `FixedUpdate` which might come slightly later.
-In this scenario, set your Update Mode **Process events in Dynamic Update** which gives you the fastest response in your `Update` call. However for the reasons mentioned in the previous section, this might mean you miss discrete events if you use methods like [`WasPressedThisFrame`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasPressedThisFrame_) in your `FixedUpdate` call. To avoid this problem, use a variable to pass through the pressed/released state of the discrete event from the event handler to your FixedUpdate call, and then clear it once your FixedUpdate code has acted on it. For example:
+In this scenario, set your Update Mode **Process events in Dynamic Update** which gives you the fastest response in your `Update` call. However for the reasons mentioned in the previous section, this might mean you miss discrete events if you use methods like [`WasPressedThisFrame`](xref:UnityEngine.InputSystem.InputAction.WasPressedThisFrame*) in your `FixedUpdate` call. To avoid this problem, use a variable to pass through the pressed/released state of the discrete event from the event handler to your FixedUpdate call, and then clear it once your FixedUpdate code has acted on it. For example:
```c#
using UnityEngine;
diff --git a/Packages/com.unity.inputsystem/Documentation~/timing-optimize-dynamic-update.md b/Packages/com.unity.inputsystem/Documentation~/timing-optimize-dynamic-update.md
index 0e13141018..d50ed9062c 100644
--- a/Packages/com.unity.inputsystem/Documentation~/timing-optimize-dynamic-update.md
+++ b/Packages/com.unity.inputsystem/Documentation~/timing-optimize-dynamic-update.md
@@ -1,3 +1,6 @@
+---
+uid: input-system-timing-optimize-dynamic
+---
# Optimize for dynamic update (non-physics) scenarios
If you're not working with the physics system or using `FixedUpdate`, always set the input system to process input in sync with the frame rate and `Update()` calls. This is the default setting, but to check or set this, go to **Project Settings** \> **Input System Package** \> **Input Settings**, and set **Update Mode** to **Process Events in Dynamic Update**.
@@ -10,7 +13,7 @@ Poll input in `Update` and use those values to control your game in `Update`. If

-Also use `Update` to poll for discrete on/off state changes using API such as [`WasPressedThisFrame`](../api/UnityEngine.InputSystem.InputAction.html#UnityEngine_InputSystem_InputAction_WasPressedThisFrame_) and **WasReleasedThisFrame**.
+Also use `Update` to poll for discrete on/off state changes using API such as [`WasPressedThisFrame`](xref:UnityEngine.InputSystem.InputAction.WasPressedThisFrame*) and **WasReleasedThisFrame**.
> [!NOTE]
> The input system doesn't detect multiple discrete on/off events that happen in a single frame when you use the poll driven approach. Multiple discrete on/off events might happen if your game is running at a low frame rate and a user repeatedly presses a button very rapidly, or if the user is using a type of game controller with a rapid "auto fire" mode. The polling technique also can't detect the order of multiple buttons were pressed on the same frame. Use event-driven input if you require this information.
diff --git a/Packages/com.unity.inputsystem/Documentation~/timing-optimize-fixed-update.md b/Packages/com.unity.inputsystem/Documentation~/timing-optimize-fixed-update.md
index 7bcc18522a..73bf84cdd1 100644
--- a/Packages/com.unity.inputsystem/Documentation~/timing-optimize-fixed-update.md
+++ b/Packages/com.unity.inputsystem/Documentation~/timing-optimize-fixed-update.md
@@ -1,6 +1,9 @@
+---
+uid: input-system-timing-optimize-fixed
+---
# Optimize for fixed-timestep or physics-based scenarios
-If you are working with the physics system or using `FixedUpdate` to control your game in a scenario where a small amount of input latency is acceptable (for example, a few frames), the simplest approach is to set the [input system update mode](./timing-select-mode.md) to **Process Events in Fixed Update**. This means your input code in `FixedUpdate` will operate as expected.
+If you are working with the physics system or using `FixedUpdate` to control your game in a scenario where a small amount of input latency is acceptable (for example, a few frames), the simplest approach is to set the [input system update mode](xref:input-system-timing-select) to **Process Events in Fixed Update**. This means your input code in `FixedUpdate` will operate as expected.
To get the minimum possible latency from the Input System and minimize lag, set the input system update mode to **Process Events in Dynamic Update**. However in doing this, you must understand how to avoid the problems which can arise when using this strategy. Although it might seem incorrect if you have code in `FixedUpdate`, for most cases, this approach minimizes lag compared with processing events in Fixed Update. The reasons for this are explained in detail on this page. Having a good understanding of how input is processed in each mode allows you to make your own decision about how best to process input for your particular project.
@@ -48,11 +51,11 @@ This has the counterintuitive effect that the processing of input on frame 4 act
To minimize input latency in input code in `FixedUpdate` calls, set the input system update mode to **Process Events in Dynamic Update**, which eliminates the problem of unprocessed time described previously. You can then use an event-driven or polling technique to read your input without missing events that occurred after the last fixed timestep but before the current frame.
-However, the **Process Events in Dynamic Update** mode might introduce the problem of missed or duplicate discrete events, such as attempting to read whether a button was pressed in a given frame. If you use this strategy, you must understand how to [avoid missed or duplicate events](./timing-missed-duplicate-events.md) in mixed timing scenarios requiring fixed and dynamic input.
+However, the **Process Events in Dynamic Update** mode might introduce the problem of missed or duplicate discrete events, such as attempting to read whether a button was pressed in a given frame. If you use this strategy, you must understand how to [avoid missed or duplicate events](xref:input-system-timing-missed) in mixed timing scenarios requiring fixed and dynamic input.
### Event-driven input with fixed update code
-For event-driven input, where the [Player Input component](./PlayerInput.md) calls events in your code, you should store the input values in variables which you can then read in your `FixedUpdate` call. For example:
+For event-driven input, where the [Player Input component](xref:input-system-player-input) calls events in your code, you should store the input values in variables which you can then read in your `FixedUpdate` call. For example:
```
using UnityEngine;
diff --git a/Packages/com.unity.inputsystem/Documentation~/timing-select-mode.md b/Packages/com.unity.inputsystem/Documentation~/timing-select-mode.md
index 895fd0af3a..dfd38cac8f 100644
--- a/Packages/com.unity.inputsystem/Documentation~/timing-select-mode.md
+++ b/Packages/com.unity.inputsystem/Documentation~/timing-select-mode.md
@@ -1,3 +1,6 @@
+---
+uid: input-system-timing-select
+---
# Select an appropriate input processing mode
The Input System **Update Mode** controls when the input system processes queued input events.
@@ -12,4 +15,4 @@ In cases where a small amount of input latency (a few frames) isn't an issue, se
## When minimum latency is a necessity
-In cases where minimum latency is a necessity, set the update mode to **Process Events in Dynamic Update**, even if you're using code in FixedUpdate to apply physics forces based on input. This strategy comes with some additional issues that you must be aware of. Refer to the section [Optimizing for fixed-timestep scenarios](timing-optimize-fixed-update.md) for more information.
+In cases where minimum latency is a necessity, set the update mode to **Process Events in Dynamic Update**, even if you're using code in FixedUpdate to apply physics forces based on input. This strategy comes with some additional issues that you must be aware of. Refer to the section [Optimizing for fixed-timestep scenarios](xref:input-system-timing-optimize-fixed) for more information.
diff --git a/Packages/com.unity.inputsystem/InputSystem/Actions/InputAction.cs b/Packages/com.unity.inputsystem/InputSystem/Actions/InputAction.cs
index b2da52368a..b95ae202a9 100644
--- a/Packages/com.unity.inputsystem/InputSystem/Actions/InputAction.cs
+++ b/Packages/com.unity.inputsystem/InputSystem/Actions/InputAction.cs
@@ -1248,8 +1248,9 @@ private int ExpectedFrame()
/// This method will disregard whether the action is currently enabled or disabled. It will keep returning
/// true for the duration of the frame even if the action was subsequently disabled in the frame.
///
- /// NOTE: If the is set to or and InputSystem.Update() is not called in
- /// the dynamic Update, use during dynamic Update instead.
+ /// > [!NOTE]
+ /// > If the is set to or and InputSystem.Update() is not called in
+ /// > the dynamic Update, use during dynamic Update instead.
///
///
///
@@ -1337,8 +1338,9 @@ public unsafe bool WasPressedThisDynamicUpdate()
/// This method will disregard whether the action is currently enabled or disabled. It will keep returning
/// true for the duration of the frame even if the action was subsequently disabled in the frame.
///
- /// NOTE: If the is set to or and InputSystem.Update() is not called in
- /// the dynamic Update, use during dynamic Update instead.
+ /// > [!NOTE]
+ /// > If the is set to or and InputSystem.Update() is not called in
+ /// > the dynamic Update, use during dynamic Update instead.
///
///
///
@@ -1437,8 +1439,9 @@ public unsafe bool WasReleasedThisDynamicUpdate()
/// This method will disregard whether the action is currently enabled or disabled. It will keep returning
/// true for the duration of the frame even if the action was subsequently disabled in the frame.
///
- /// NOTE: If the is set to or and InputSystem.Update() is not called in
- /// the dynamic Update, use when trying to access in dynamic Update instead.
+ /// > [!NOTE]
+ /// > If the is set to or and InputSystem.Update() is not called in
+ /// > the dynamic Update, use when trying to access in dynamic Update instead.
///
///
///
@@ -1546,8 +1549,9 @@ public unsafe bool WasPerformedThisDynamicUpdate()
/// true for the duration of the frame even if the action was subsequently disabled in the frame.
///
///
- /// NOTE: If the is set to or and InputSystem.Update() is not called in
- /// the dynamic Update, use to access this during dynamic Update instead.
+ /// > [!NOTE]
+ /// > If the is set to or and InputSystem.Update() is not called in
+ /// > the dynamic Update, use to access this during dynamic Update instead.
///
///
///
diff --git a/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionMap.cs b/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionMap.cs
index e5b5f2cb2f..0375f5865d 100644
--- a/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionMap.cs
+++ b/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionMap.cs
@@ -888,10 +888,11 @@ public bool Set(ReadOnlyArray? devices)
/// we don't even need a separate array but rather just need to find out which slice in the
/// bindings array corresponds to which action.
///
- /// NOTE: Bindings for individual actions aren't queried by the system itself during normal
- /// runtime operation so we only do this for cases where the user asks for the
- /// information. If the user never asks for bindings or controls on a per-action basis,
- /// none of this data gets initialized.
+ /// > [!NOTE]
+ /// > Bindings for individual actions aren't queried by the system itself during normal
+ /// > runtime operation so we only do this for cases where the user asks for the
+ /// > information. If the user never asks for bindings or controls on a per-action basis,
+ /// > none of this data gets initialized.
///
internal ReadOnlyArray GetBindingsForSingleAction(InputAction action)
{
diff --git a/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionPhase.cs b/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionPhase.cs
index 4147ae73f1..c99824f34f 100644
--- a/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionPhase.cs
+++ b/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionPhase.cs
@@ -84,13 +84,13 @@ public enum InputActionPhase
///
/// By default, an action is started as soon as a control moves away from its default value. This is
/// the case for both actions (which, however, does not yet have to mean
- /// that the button press threshold has been reached; see )
+ /// that the button press threshold has been reached; refer to )
/// and actions. does not use
/// the Started phase and instead goes straight to .
///
/// For actions, Started will immediately be followed by .
///
- /// Note that interactions (see ) can alter how an action does or does not progress through
+ /// Note that interactions (refer to ) can alter how an action does or does not progress through
/// the phases.
///
Started,
@@ -99,11 +99,11 @@ public enum InputActionPhase
/// The action has been performed. Leads to getting called.
///
/// By default, a action performs when a control crosses the button
- /// press threshold (see ), a
+ /// press threshold (refer to ), a
/// action performs on any value change that isn't the default value, and a
/// action performs on any value change including going back to the default value.
///
- /// Note that interactions (see ) can alter how an action does or does not progress through
+ /// Note that interactions (refer to ) can alter how an action does or does not progress through
/// the phases.
///
/// For a given action, finding out whether it was performed in the current frame can be done with .
@@ -120,14 +120,13 @@ public enum InputActionPhase
/// The action has stopped. Leads to getting called.
///
/// By default, a action cancels when a control falls back below the button
- /// press threshold (see ) and a
+ /// press threshold (refer to ) and a
/// action cancels when a control moves back to its default value. A action
/// does not generally cancel based on input on its controls.
///
- /// An action will also get canceled when it is disabled while in progress (see ).
- /// Also, when an that is
+ /// An action will also get canceled when it is disabled while in progress (refer to ).
///
- /// Note that interactions (see ) can alter how an action does or does not progress through
+ /// Note that interactions (refer to ) can alter how an action does or does not progress through
/// the phases.
///
Canceled
diff --git a/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionTrace.cs b/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionTrace.cs
index f3d4f377fd..cbeb641a92 100644
--- a/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionTrace.cs
+++ b/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionTrace.cs
@@ -192,8 +192,9 @@ public void UnsubscribeFromAll()
///
/// The action to be recorded.
///
- /// **Note:** This method does not prevent you from subscribing to the same action multiple times.
- /// If you subscribe to the same action multiple times, your event buffer will contain duplicate entries.
+ /// > [!NOTE]
+ /// > This method does not prevent you from subscribing to the same action multiple times.
+ /// > If you subscribe to the same action multiple times, your event buffer will contain duplicate entries.
///
/// If is null .
///
@@ -218,8 +219,9 @@ public void SubscribeTo(InputAction action)
///
/// The action-map containing all actions to be recorded.
///
- /// **Note:** This method does not prevent you from subscribing to the same action multiple times.
- /// If you subscribe to the same action multiple times, your event buffer will contain duplicate entries.
+ /// > [!NOTE]
+ /// > This method does not prevent you from subscribing to the same action multiple times.
+ /// > If you subscribe to the same action multiple times, your event buffer will contain duplicate entries.
///
/// Thrown if is null.
///
@@ -242,7 +244,8 @@ public void SubscribeTo(InputActionMap actionMap)
///
/// The action to unsubscribe from.
///
- /// **Note:** This method has no side effects if you attempt to unsubscribe from an action that you have not previously subscribed to.
+ /// > [!NOTE]
+ /// > This method has no side effects if you attempt to unsubscribe from an action that you have not previously subscribed to.
///
/// Thrown if is null .
///
@@ -269,7 +272,8 @@ public void UnsubscribeFrom(InputAction action)
///
/// The action-map containing actions to unsubscribe from.
///
- /// **Note:** This method has no side effects if you attempt to unsubscribe from an action-map that you have not previously subscribed to.
+ /// > [!NOTE]
+ /// > This method has no side effects if you attempt to unsubscribe from an action-map that you have not previously subscribed to.
///
/// Thrown if is null .
///
@@ -335,7 +339,8 @@ public unsafe void RecordAction(InputAction.CallbackContext context)
/// Clears all recorded data.
///
///
- /// **Note:** This method does not unsubscribe any actions that the instance is listening to, so after clearing the recorded data, new input on those subscribed actions will continue to be recorded.
+ /// > [!NOTE]
+ /// > This method does not unsubscribe any actions that the instance is listening to, so after clearing the recorded data, new input on those subscribed actions will continue to be recorded.
///
public void Clear()
{
diff --git a/Packages/com.unity.inputsystem/InputSystem/Controls/InputControl.cs b/Packages/com.unity.inputsystem/InputSystem/Controls/InputControl.cs
index 4634d67af7..97a07d3442 100644
--- a/Packages/com.unity.inputsystem/InputSystem/Controls/InputControl.cs
+++ b/Packages/com.unity.inputsystem/InputSystem/Controls/InputControl.cs
@@ -312,32 +312,27 @@ public string path
public InputStateBlock stateBlock => m_StateBlock;
///
- /// Whether the control is considered noisy.
+ /// Retrieves whether the control is considered [noisy](xref:input-system-controls#noisy-controls).
///
/// True if the control produces noisy input.
///
/// A control is considered "noisy" if it produces different values without necessarily requiring user
- /// interaction. A good example are sensors (see ). For example, the PS4 controller
- /// which has a gyroscope sensor built into the device. Whereas sticks and buttons on the device require
- /// user interaction to produce non-default values, the gyro will produce varying values even if the
- /// device just sits there without user interaction.
+ /// interaction. For example, XR head mounted displays
+ /// or sensors such as a . For more information, refer to
+ /// [Noisy controls](xref:input-system-controls#noisy-controls).
///
- /// The value of this property is determined by the layout ( ) that the
- /// control has been built from.
+ /// The value of this property is determined by the layout that the
+ /// control has been built from (using ).
///
- /// Note that for devices ( ) this property is true if any control on the device
+ /// > [!NOTE]
+ /// > For devices , this property is true if any control on the device
/// is marked as noisy.
///
- /// The primary effect of being noise is on and
+ /// The primary effect of being noisy is on and
/// on interactive rebinding (see ).
/// However, being noisy also affects automatic resetting of controls that happens when the application
- /// loses focus. While other controls are reset to their default value (except if Application.runInBackground
- /// is true and the device the control belongs to is marked as ),
- /// noisy controls will not be reset but rather remain at their current value. This is based on the assumption
- /// that noisy controls most often represent sensor values and snapping the last sampling value back to default
- /// will usually have undesirable effects on an application's simulation logic.
+ /// loses focus. For more information, refer to [Noisy controls](xref:input-system-controls#noisy-controls).
///
- ///
///
public bool noisy
{
@@ -361,29 +356,24 @@ internal set
}
///
- /// Whether the control is considered synthetic.
+ /// Retrieves whether the control is considered [synthetic](xref:input-system-controls#synthetic-controls).
///
/// True if the control does not represent an actual physical control on the device.
///
/// A control is considered "synthetic" if it does not correspond to an actual, physical control on the
- /// device. An example for this is or the up/down/left/right buttons added
- /// by .
+ /// device. For example, or the up/down/left/right buttons added
+ /// by . For more information, refer to
+ /// [Synthetic controls](xref:input-system-controls#synthetic-controls).
///
- /// The value of this property is determined by the layout ( ) that the
- /// control has been built from.
+ /// The value of this property is determined by the layout that the
+ /// control has been built from (using ).
///
- /// The primary effect of being synthetic is in interactive rebinding (see
- /// ) where non-synthetic
- /// controls will be favored over synthetic ones. This means, for example, that if both
- /// "<Gamepad>/leftStick/x" and "<Gamepad>/leftStick/left" are
- /// suitable picks, "<Gamepad>/leftStick/x" will be favored as it represents
- /// input from an actual physical control whereas "<Gamepad>/leftStick/left"
- /// represents input from a made-up control. If, however, the "left" button is the only
- /// viable pick, it will be accepted.
- ///
- /// A control layout will specify if it is synthetic using .
- /// See .
+ /// The primary effect of being synthetic is on interactive rebinding (see
+ /// ) where the input system favors
+ /// non-synthetic controls over synthetic ones for rebinding. For more information, refer to
+ /// [Synthetic controls](xref:input-system-controls#synthetic-controls).
///
+ /// .
public bool synthetic
{
get => (m_ControlFlags & ControlFlags.IsSynthetic) != 0;
diff --git a/Packages/com.unity.inputsystem/InputSystem/Controls/InputControlAttribute.cs b/Packages/com.unity.inputsystem/InputSystem/Controls/InputControlAttribute.cs
index aee60028d9..acf62fc7b0 100644
--- a/Packages/com.unity.inputsystem/InputSystem/Controls/InputControlAttribute.cs
+++ b/Packages/com.unity.inputsystem/InputSystem/Controls/InputControlAttribute.cs
@@ -302,7 +302,7 @@ public sealed class InputControlAttribute : PropertyAttribute
public string shortDisplayName { get; set; }
///
- /// Whether the control is noisy. Off by default.
+ /// Retrieves whether the control is [noisy](xref:input-system-controls#noisy-controls). Off by default.
///
/// Whether control is noisy.
///
@@ -310,7 +310,7 @@ public sealed class InputControlAttribute : PropertyAttribute
public bool noisy { get; set; }
///
- /// Whether the control is synthetic. Off by default.
+ /// Retrieves whether the control is [synthetic](xref:input-system-controls#synthetic-controls). Off by default.
///
/// Whether control is synthetic.
///
diff --git a/Packages/com.unity.inputsystem/InputSystem/Controls/InputControlPath.cs b/Packages/com.unity.inputsystem/InputSystem/Controls/InputControlPath.cs
index 85e5db8c62..de993f9c65 100644
--- a/Packages/com.unity.inputsystem/InputSystem/Controls/InputControlPath.cs
+++ b/Packages/com.unity.inputsystem/InputSystem/Controls/InputControlPath.cs
@@ -25,54 +25,8 @@ namespace UnityEngine.InputSystem
/// Control paths are a mini-language similar to regular expressions. They are used throughout
/// the input system as string "addresses" of input controls. At runtime, they can be matched
/// against the devices and controls present in the system to retrieve the actual endpoints to
- /// receive input from.
- ///
- /// Like on a file system, a path is made up of components that are each separated by a
- /// forward slash (/ ). Each such component in turn is made up of a set of fields that are
- /// individually optional. However, one of the fields must be present (e.g. at least a name or
- /// a wildcard).
- ///
- ///
- /// Field structure of each path component
- ///
- /// <Layout>{Usage}#(DisplayName)Name
- ///
- ///
- ///
- /// * Layout : The name of the layout that the control must be based on (either directly or indirectly).
- /// * Usage : The usage that the control or device has to have, i.e. must be found in This field can be repeated several times to require
- /// multiple usages (e.g. "{LeftHand}{Vertical}" ).
- /// * DisplayName : The name that of the control or device
- /// must match.
- /// * Name : The name that or one of the entries in
- /// must match. Alternatively, this can be a
- /// wildcard (* ) to match any name.
- ///
- /// Note that all matching is case-insensitive.
- ///
- ///
- /// Various examples of control paths
- ///
- /// // Matches all gamepads (also gamepads *based* on the Gamepad layout):
- /// "<Gamepad>"
- ///
- /// // Matches the "Submit" control on all devices:
- /// "*/{Submit}"
- ///
- /// // Matches the key that prints the "a" character on the current keyboard layout:
- /// "<Keyboard>/#(a)"
- ///
- /// // Matches the X axis of the left stick on a gamepad.
- /// "<Gamepad>/leftStick/x"
- ///
- /// // Matches the orientation control of the right-hand XR controller:
- /// "<XRController>{RightHand}/orientation"
- ///
- /// // Matches all buttons on a gamepad.
- /// "<Gamepad>/<Button>"
- ///
- ///
+ /// receive input from. For detailed information about the structure and syntax of control paths,
+ /// refer to the [Control paths](xref:input-system-controls#control-paths) topic in the user manual.
///
/// The structure of the API of this class is similar in spirit to System.IO.Path , i.e. it offers
/// a range of static methods that perform various operations on path strings.
diff --git a/Packages/com.unity.inputsystem/InputSystem/Controls/KeyControl.cs b/Packages/com.unity.inputsystem/InputSystem/Controls/KeyControl.cs
index 3e5b601583..d788916fea 100644
--- a/Packages/com.unity.inputsystem/InputSystem/Controls/KeyControl.cs
+++ b/Packages/com.unity.inputsystem/InputSystem/Controls/KeyControl.cs
@@ -12,8 +12,8 @@ namespace UnityEngine.InputSystem.Controls
/// have symbols associated with them which may change depending on keyboard layout as well as in combination
/// with other keys.
///
- /// Note:
- /// Unity input system key codes and input manager key codes are designed with game controls in mind.
+ /// > [!NOTE]
+ /// > Unity input system key codes and input manager key codes are designed with game controls in mind.
///
/// This means the way they are assigned is intended to preserve the location of keys on keyboards,
/// so that pressing a key in the same location on different keyboards should result in the same action
diff --git a/Packages/com.unity.inputsystem/InputSystem/Devices/Keyboard.cs b/Packages/com.unity.inputsystem/InputSystem/Devices/Keyboard.cs
index 2d3ee2d0c7..ce890f4f21 100644
--- a/Packages/com.unity.inputsystem/InputSystem/Devices/Keyboard.cs
+++ b/Packages/com.unity.inputsystem/InputSystem/Devices/Keyboard.cs
@@ -255,8 +255,8 @@ namespace UnityEngine.InputSystem
///
/// Named according to the US keyboard layout which is used as a reference layout.
///
- /// Note:
- /// Unity input system key codes and input manager key codes are designed with game controls in mind.
+ /// > [!NOTE]
+ /// > Unity input system key codes and input manager key codes are designed with game controls in mind.
///
/// This means the way they are assigned is intended to preserve the location of keys on keyboards,
/// so that pressing a key in the same location on different keyboards should result in the same action
diff --git a/Packages/com.unity.inputsystem/InputSystem/Devices/Mouse.cs b/Packages/com.unity.inputsystem/InputSystem/Devices/Mouse.cs
index 1740b9e3c2..7cbfd52515 100644
--- a/Packages/com.unity.inputsystem/InputSystem/Devices/Mouse.cs
+++ b/Packages/com.unity.inputsystem/InputSystem/Devices/Mouse.cs
@@ -28,7 +28,8 @@ public struct MouseState : IInputStateTypeInfo
/// Position of mouse on screen.
///
/// On Windows, delta originates from RAWINPUT API.
- /// Note: This value might not update every frame, particularly if your project is running at a high frame rates. This value might also update at a different time than the . If you need a delta value that correlates with position, you should compute it based on the previous position value.
+ /// > [!NOTE]
+ /// > This value might not update every frame, particularly if your project is running at a high frame rates. This value might also update at a different time than the . If you need a delta value that correlates with position, you should compute it based on the previous position value.
///
///
[InputControl(usage = "Point", dontReset = true)] // Mouse should stay put when we reset devices.
@@ -41,7 +42,8 @@ public struct MouseState : IInputStateTypeInfo
/// Mouse movement.
///
/// On Windows, delta originates from RAWINPUT API.
- /// Note: This value might not update every frame, particularly if your project is running at a high frame rates. This value might also update at a different time than the . If you need a delta value that correlates with position, you should compute it based on the previous position value.
+ /// > [!NOTE]
+ /// > This value might not update every frame, particularly if your project is running at a high frame rates. This value might also update at a different time than the . If you need a delta value that correlates with position, you should compute it based on the previous position value.
///
///
[InputControl(usage = "Secondary2DMotion", layout = "Delta")]
diff --git a/Packages/com.unity.inputsystem/InputSystem/Devices/Sensor.cs b/Packages/com.unity.inputsystem/InputSystem/Devices/Sensor.cs
index 674ed4dda9..c4cd9c952d 100644
--- a/Packages/com.unity.inputsystem/InputSystem/Devices/Sensor.cs
+++ b/Packages/com.unity.inputsystem/InputSystem/Devices/Sensor.cs
@@ -654,7 +654,8 @@ protected override void FinishSetup()
///
/// Hinge angle sensor.
/// This sensor is usually available on foldable devices.
- /// Note: The step resolution for angle is device dependentent, on Android you can query the sensor resolution by querying device capabilities.
+ /// > [!NOTE]
+ /// > The step resolution for angle is device dependentent, on Android you can query the sensor resolution by querying device capabilities.
///
[InputControlLayout(displayName = "Hinge Angle")]
public class HingeAngle : Sensor
diff --git a/Packages/com.unity.inputsystem/InputSystem/InputSystem.cs b/Packages/com.unity.inputsystem/InputSystem/InputSystem.cs
index 34d4462e22..f1adbb6f99 100644
--- a/Packages/com.unity.inputsystem/InputSystem/InputSystem.cs
+++ b/Packages/com.unity.inputsystem/InputSystem/InputSystem.cs
@@ -3923,7 +3923,8 @@ private static void Reset(bool enableRemoting = false, IInputRuntime runtime = n
/// Destroy the current setup of the input system.
///
///
- /// NOTE: This also de-allocates data we're keeping in unmanaged memory!
+ /// > [!NOTE]
+ /// > This also de-allocates data we're keeping in unmanaged memory!
///
private static void Destroy()
{
diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInput.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInput.cs
index 32ca9992e3..e257ff6ae0 100644
--- a/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInput.cs
+++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInput.cs
@@ -52,76 +52,72 @@ namespace UnityEngine.InputSystem
{
///
/// Represents a separate player in the game complete with a set of actions exclusive
- /// to the player and a set of paired device.
+ /// to the player and a set of paired devices.
///
///
- ///
- /// PlayerInput is a high-level wrapper around much of the input system's functionality
- /// which is meant to help getting set up with the new input system quickly. It takes
- /// care of bookkeeping and has a custom UI(requires the "Unity UI" package) to help
- /// setting up input.
+ /// The `PlayerInput` class is a high-level wrapper around much of the input system's functionality
+ /// which helps set up the new input system quickly. PlayerInput manages s
+ /// and has a custom UI to help set up input. Note that the input system's custom UI requires
+ /// the [Unity UI](https://docs.unity3d.com/Packages/com.unity.ugui@latest) package.
///
- /// The component supports local multiplayer implicitly. Each PlayerInput instance
- /// represents a distinct user with its own set of devices and actions. To orchestrate
- /// player management and facilitate mechanics such as joining by device activity, use
+ /// The [Player Input](xref:input-system-player-input) component supports local multiplayer implicitly.
+ /// Each PlayerInput instance represents a distinct user with its own set of devices and actions.
+ /// To orchestrate player management and facilitate mechanics, such as joining by device activity, use
/// .
///
- /// The way PlayerInput notifies script code of events is determined by .
- /// By default, this is set to which will use
- /// to send messages to the
- /// that PlayerInput sits on.
+ /// The way PlayerInput notifies script code of events is determined by the
+ /// property. By default, this is set to ,
+ /// which uses to send
+ /// messages to the that the PlayerInput is connected to.
///
- /// When enabled, PlayerInput will create an and pair devices to the
- /// user which are then specific to the player. The set of devices can be controlled explicitly
- /// when instantiating a PlayerInput through
- /// or . This also makes it possible
- /// to assign the same device to two different players, e.g. for split-keyboard play.
+ /// When enabled, PlayerInput creates an instance and pairs devices to the
+ /// user which are then associated to the player. If you instantiate a PlayerInput through
+ ///
+ /// or , you can also control the set of
+ /// devices explicitly through the PlayerInput instance. This also makes it possible to assign the same
+ /// device to two different players, for example for split-keyboard play:
///
- ///
///
/// var p1 = PlayerInput.Instantiate(playerPrefab,
/// controlScheme: "KeyboardLeft", device: Keyboard.current);
/// var p2 = PlayerInput.Instantiate(playerPrefab,
/// controlScheme: "KeyboardRight", device: Keyboard.current);
///
- ///
///
- /// If no specific devices are given to a PlayerInput, the component will look for compatible
- /// devices present in the system and pair them to itself automatically. If the PlayerInput's
- /// have control schemes defined for them, PlayerInput will look for a
- /// control scheme for which all required devices are available and not paired to any other player.
- /// It will try first (if set), but then fall back to trying
- /// all available schemes in order. Once a scheme is found for which all required devices are
- /// available, PlayerInput will pair those devices to itself and select the given scheme.
+ /// If a PlayerInput instance isn't paired to a specific device, the Player Input component looks for
+ /// compatible devices present in the input system and pairs them to the PlayerInput instance automatically.
+ /// If the PlayerInput's set of have control schemes defined, the PlayerInput looks for a
+ /// control scheme for which all required devices are available and doesn't pair to any other player.
+ /// The PlayerInput tries to pair using the first (if set). If the pairing is unsuccessful,
+ /// it tries each available scheme in order. After it finds a scheme where all required devices are
+ /// available, PlayerInput pairs those devices to itself and selects the given scheme.
///
- /// If no control schemes are defined, PlayerInput will try to bind as many as-of-yet unpaired
- /// devices to itself as it can match to bindings present in the . This means
- /// that if, for example, there's binding for both keyboard and gamepad and there is one keyboard
- /// and two gamepads available when PlayerInput is enabled, all three devices will be paired to
- /// the player.
+ /// If no control schemes are defined, PlayerInput tries to bind as many unpaired
+ /// devices to itself as it can match to the bindings present in its set of . For example,
+ /// when the PlayerInput is enabled, if it finds a binding for both keyboard and gamepad, and one keyboard
+ /// and two gamepads are available in the input system, the PlayerInput pairs all three devices to the player.
///
- /// Note that when using , device pairing to players is controlled
- /// from the joining logic. In that case, PlayerInput will automatically pair the device from which
- /// the player joined. If control schemes are present in , the first one compatible
- /// with that device is chosen. If additional devices are required, these will be paired from the pool
- /// of currently unpaired devices.
+ /// > [!NOTE]
+ /// > When you use the [Player Input Manager](xref:input-system-player-input-manager) component, the
+ /// itself controls pairing devices to players through the joining logic.
+ /// For more information, refer to the class documentation.
///
- /// Device pairings can be changed at any time by either manually controlling pairing through
- /// (and related methods) using a PlayerInput's
- /// assigned or by switching control schemes (e.g. using
- /// ), if any are present in the PlayerInput's
- /// .
+ /// To change device pairings at any time, you can use either of these techniques:
+ /// - Use (and related methods) to manually control pairing
+ /// using a PlayerInput's assigned property.
+ /// - Switch control schemes (for example, using ),
+ /// if any are present in the PlayerInput's set of .
///
- /// When a player loses a device paired to it (e.g. when it is unplugged or loses power),
- /// will signal which is also surfaced as a message,
+ /// When a player loses a paired device (such as when it is unplugged or loses power),
+ /// signals which is also surfaced as a message,
/// , or (depending on ).
- /// When a device is reconnected, will signal
+ /// When the device reconnects, signals
/// which also is surfaced as a message, as , or
/// (depending on ).
///
/// When there is only a single active PlayerInput in the game, joining is not enabled (see
- /// ), and is not
- /// set to true , device pairings for the player will also update automatically based on device usage.
+ /// ), and if is not
+ /// set to true , device pairings for the player also update automatically based on device usage.
///
/// If control schemes are present in , then if a device is used (not merely plugged in
/// but rather receives input on a non-noisy, non-synthetic control) which is compatible with a control scheme
diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputManager.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputManager.cs
index fde6eae7bb..115033127a 100644
--- a/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputManager.cs
+++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputManager.cs
@@ -20,14 +20,20 @@ namespace UnityEngine.InputSystem
/// Manages joining and leaving of players.
///
///
- /// This is a singleton component. Only one instance is meant to be active in a game
- /// at any one time. To retrieve the current instance, use .
+ /// This is a singleton component. Only one instance should be active in a game at any one time. To retrieve the
+ /// current instance, use the property.
///
- /// Note that a PlayerInputManager is not strictly required to have multiple components.
- /// What PlayerInputManager provides is the implementation of specific player join mechanisms
- /// ( ) as well as automatic assignment of split-screen areas ( ).
- /// However, you can always implement your own custom logic instead and simply instantiate multiple GameObjects with
+ /// PlayerInputManager provides the implementation of specific player joining mechanisms ( ).
+ /// It also automatically assigns split-screen areas . The input system does not require
+ /// the PlayerInputManager to have multiple components. However, you can always implement
+ /// your own custom logic instead and simply instantiate multiple s with
/// yourself.
+ ///
+ /// When you use PlayerInputManager, the join behavior you define controls pairing devices to players. This means
+ /// that automatically pairs the device from which the player joined. If control schemes
+ /// are present in the PlayerInput's set of , the input system selects the first compatible
+ /// device for pairing. If additional devices are required, the input system selects them from the pool of currently
+ /// unpaired devices.
///
[AddComponentMenu("Input/Player Input Manager")]
[HelpURL(InputSystem.kDocUrl + "/manual/PlayerInputManager.html")]
diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs
index 667a833494..853d28bac9 100644
--- a/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs
+++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs
@@ -187,7 +187,8 @@ internal GameObject localMultiPlayerRoot
///
/// You can set this to a negative value to invert the scroll direction. A value of zero prevents mousewheel scrolling from working at all.
///
- /// Note: this has no effect on UI Toolkit content, only uGUI components.
+ /// > [!NOTE]
+ /// > This has no effect on UI Toolkit content, only uGUI components.
///
public float scrollDeltaPerTick
{
diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/XInput/XboxGamepadMacOS.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/XInput/XboxGamepadMacOS.cs
index ed5e870044..5a49cad7ca 100644
--- a/Packages/com.unity.inputsystem/InputSystem/Plugins/XInput/XboxGamepadMacOS.cs
+++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/XInput/XboxGamepadMacOS.cs
@@ -419,9 +419,10 @@ public class XboxGamepadMacOSNative : XInputController
///
///
/// An Xbox One wireless gamepad connected to a mac using Bluetooth.
- /// Note: only the latest version of Xbox One wireless gamepads support Bluetooth. Older models only work
- /// with a proprietary Xbox wireless protocol, and cannot be used on a Mac.
- /// Unlike wired controllers, bluetooth-cabable Xbox One controllers do not need a custom driver to work on older macOS versions
+ /// > [!NOTE]
+ /// > Only the latest version of Xbox One wireless gamepads support Bluetooth. Older models only work
+ /// > with a proprietary Xbox wireless protocol, and cannot be used on a Mac.
+ /// Unlike wired controllers, bluetooth-capable Xbox One controllers do not need a custom driver to work on older macOS versions
///
[InputControlLayout(displayName = "Wireless Xbox Controller", stateType = typeof(XInputControllerWirelessOSXState), hideInUI = true)]
public class XboxOneGampadMacOSWireless : XInputController
@@ -436,8 +437,9 @@ public class XboxOneGampadMacOSWireless : XInputController
/// The reason this is different from is that some Xbox Controllers have
/// different View and Share button bit mapping. So we need to use a different layout for those controllers. It seems
/// that some Xbox One and Xbox Series controller share the same mappings so this combines them all.
- /// Note: only the latest version of Xbox One wireless gamepads support Bluetooth. Older models only work
- /// with a proprietary Xbox wireless protocol, and cannot be used on a Mac.
+ /// > [!NOTE]
+ /// > Only the latest version of Xbox One wireless gamepads support Bluetooth. Older models only work
+ /// > with a proprietary Xbox wireless protocol, and cannot be used on a Mac.
/// Unlike wired controllers, bluetooth-cabable Xbox One controllers do not need a custom driver to work on older macOS versions
///
[InputControlLayout(displayName = "Wireless Xbox Controller", stateType = typeof(XInputControllerWirelessOSXStateV2), hideInUI = true)]