This commit is contained in:
2026-11-24 15:51:02 +01:00
parent cca4d73e41
commit f4aa17114a
22092 changed files with 5042406 additions and 0 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a3e12f7b92d6e49c0b430ae7813c2398
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c0f26b555bfc14351a9f8ec342fd6ae8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,18 @@
{
"name": "Unity.InputSystem.DocCodeSamples",
"rootNamespace": "",
"references": [
"GUID:75469ad4d38634e559750d17036d5f7c"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": true,
"precompiledReferences": [],
"autoReferenced": false,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 41b01d3964f844d8b43923c18b3a9a6f
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,53 @@
using UnityEngine;
using UnityEngine.InputSystem;
namespace DocCodeSamples.Tests
{
internal class GamepadExample : MonoBehaviour
{
void Start()
{
// Print all connected gamepads
Debug.Log(string.Join("\n", Gamepad.all));
}
void Update()
{
var gamepad = Gamepad.current;
// No gamepad connected.
if (gamepad == null)
{
return;
}
// Check if "Button North" was pressed this frame
if (gamepad.buttonNorth.wasPressedThisFrame)
{
Debug.Log("Button North was pressed");
}
// Check if the button control is being continuously actuated and read its value
if (gamepad.rightTrigger.IsActuated())
{
Debug.Log("Right trigger value: " + gamepad.rightTrigger.ReadValue());
}
// Read left stick value and perform some code based on the value
Vector2 move = gamepad.leftStick.ReadValue();
{
// Use the Vector2 move for the game logic here
}
// Creating haptic feedback while "Button South" is pressed and stopping it when released.
if (gamepad.buttonSouth.wasPressedThisFrame)
{
gamepad.SetMotorSpeeds(0.2f, 1.0f);
}
else if (gamepad.buttonSouth.wasReleasedThisFrame)
{
gamepad.ResetHaptics();
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 898672c95e554f2fb492125d78b11af2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,48 @@
using UnityEngine;
using UnityEngine.InputSystem;
namespace DocCodeSamples.Tests
{
internal class GamepadHapticsExample : MonoBehaviour
{
bool hapticsArePaused = false;
void Update()
{
var gamepad = Gamepad.current;
// No gamepad connected, no need to continue.
if (gamepad == null)
return;
float leftTrigger = gamepad.leftTrigger.ReadValue();
float rightTrigger = gamepad.rightTrigger.ReadValue();
// Only set motor speeds if haptics were not paused and if trigger is actuated.
// Both triggers must be actuated past 0.2f to start haptics.
if (!hapticsArePaused &&
(gamepad.leftTrigger.IsActuated() || gamepad.rightTrigger.IsActuated()))
gamepad.SetMotorSpeeds(
leftTrigger < 0.2f ? 0.0f : leftTrigger,
rightTrigger < 0.2f ? 0.0f : rightTrigger);
// Toggle haptics "playback" when "Button South" is pressed.
// Notice that if you release the triggers after pausing,
// and press the button again, haptics will resume.
if (gamepad.buttonSouth.wasPressedThisFrame)
{
if (hapticsArePaused)
gamepad.ResumeHaptics();
else
gamepad.PauseHaptics();
hapticsArePaused = !hapticsArePaused;
}
// Notice that if you release the triggers after pausing,
// and press the Start button, haptics will be reset.
if (gamepad.startButton.wasPressedThisFrame)
gamepad.ResetHaptics();
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3bbc200178984676a2dcb977a2fe3bae
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,42 @@
#if UNITY_INPUT_SYSTEM_ENABLE_UI
using UnityEngine;
using UnityEngine.InputSystem.UI;
namespace DocCodeSamples.Tests
{
internal class InputSystemUIInputModuleAssignActionsExample : MonoBehaviour
{
// Reference to the InputSystemUIInputModule component, needs to be provided in the Inspector
public InputSystemUIInputModule uiModule;
void Start()
{
// Assign default actions
AssignActions();
}
void AssignActions()
{
if (uiModule != null)
uiModule.AssignDefaultActions();
else
Debug.LogError("InputSystemUIInputModule not found.");
}
void UnassignActions()
{
if (uiModule != null)
uiModule.UnassignActions();
else
Debug.LogError("InputSystemUIInputModule not found.");
}
void OnDestroy()
{
// Unassign actions when the object is destroyed
UnassignActions();
}
}
}
#endif
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 026e1117180341c1bf7847a2cc61f75b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,5 @@
inputactions
playerinput
inputsystemuiinputmodule
gravitysensor
deadzone
@@ -0,0 +1,23 @@
---
uid: input-system-actions
---
# Actions
**Actions** allow you to separate the purpose of an input from the device controls which perform that input, and associate the purpose and device controls together in a flexible way.
For example, the purpose of an input in a game might be to make the player's character move. The device control associated with that action might be the left gamepad stick.
To associate an action with one or more device controls, you set up input bindings in the [Input Actions Editor](actions-editor.md). Then you can refer to those actions in your code, instead of the specific devices. The input bindings define which device's controls are used to perform the action. For example this screenshot shows the "Move" action's bindings to the left gamepad stick and the keyboard's arrow keys.
![The Actions panel of the Input Actions Editor in Project Settings](Images/ActionsBinding.png)<br/>
*The Actions panel of the Input Actions Editor in Project Settings*
When you get a reference to an action in your code, you can use it to check its value, or attach a callback method to be notified when it is performed. For a simple example script demonstrating this, refer to [Workflow Overview - Actions](using-actions-workflow.md).
Actions also make it simpler to create a system that lets your players [customize their bindings at runtime](rebind-action-runtime.md), which is a common requirement for games.
> [!NOTE]
> - Actions are a runtime only feature. You can't use them in [Editor window code](https://docs.unity3d.com/ScriptReference/EditorWindow.html).
>
> - 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](using-direct-workflow.md).
>
@@ -0,0 +1,34 @@
---
uid: input-system-architecture
---
# Architecture
The Input System has a layered architecture that consists of a low-level layer and a high-level layer.
# Native backend
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](input-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 can also send data back to the native backend in the form of [commands](device-commands.md) 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)
![Low-Level Architecture](Images/InputArchitectureLowLevel.png)
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](control-state.md) 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.
# Input System (high-level)
![High-Level Architecture](Images/InputArchitectureHighLevel.png)
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-specification.md).
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.
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](bindings.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](set-callbacks-on-actions.md). You can also specify more complex behaviors for your Actions using [Processors](processors.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).
@@ -0,0 +1,19 @@
---
uid: input-system-contributing
---
# Contribute to the Input System source code
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.
## Reporting bugs
To report documentation problems, please use the feedback section at the bottom of the page containing the problem.
To report bugs related to the Input System Please follow Unity's standard [bug reporting guidelines](https://unity3d.com/unity/qa/bug-reporting). Don't forget to submit a Project that the developer who picks up your report can use to reproduce the issue. Be sure to mention that the bug is specific to the Input System package in the description, so it gets forwarded to the correct team at Unity.
## Discussion
To ask questions or discuss the Input System, see the [dedicated section on Unity's forum](https://forum.unity.com/forums/new-input-system.103/). This is also the best place to post feature requests.
@@ -0,0 +1,25 @@
---
uid: input-debugging
---
# Debugging
Learn how to investigate and troubleshoot the Input System when something isn't working as expected.
| **Topic** | **Description** |
| :--- | :--- |
| **[The input debugger window](the-input-debugger-window.md)** | Open the Input Debugger to inspect devices, actions, users, and layouts in the Editor and connected players. |
| **[Debug a device](debug-device.md)** | Inspect a device's controls, state, and events in the Input Debugger. |
| **[Debug an action](debug-action.md)** | Verify enabled actions, bindings, and mapped controls during Play mode. |
| **[Debug users and PlayerInput](debug-users-playerinput.md)** | Inspect InputUser and Player Input pairings, devices, and actions in the Users list. |
| **[Debug layouts](debug-layouts.md)** | Browse registered control and device layouts in the Input Debugger. |
| **[Trace actions](trace-actions.md)** | Generate a log of all activity that happened on a particular set of Actions. |
| **[Visualizers](visualizers.md)** | Monitor controls and actions in real time with the Visualizers sample. |
| **[Device Simulation](device-simulation.md)** | Learn how the Unity Device Simulator feeds touchscreen input into the Input System. |
## Additional resources
- [See and record input event flow](see-record-input-event-flow.md)
- [Testing](testing.md)
- [Binding resolution](binding-resolution.md)
- [Debug Player Input Component](debug-player-input-component.md)
@@ -0,0 +1,9 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
}
}
@@ -0,0 +1,22 @@
---
uid: input-system-editor-features
---
# Editor features
Use the Input System while developing in the Unity Editor—not only during Play mode in a built player.
Read input from custom Editor windows, stream touch and sensor data from a mobile device with Unity Remote, and trace or record how events flow through the system.
| **Topic** | **Description** |
| :--- | :--- |
| **[Read input in Editor Windows](read-input-editor-windows.md)** | Read pen, keyboard, and other device input from `EditorWindow` code outside Play mode. |
| **[Use mobile device input in the Editor (Unity Remote)](use-mobile-device-input-editor-unity-remote.md)** | Stream mobile touch and sensor input into the Editor while in Play mode using the Unity Remote app. |
| **[See and record input event flow](see-record-input-event-flow.md)** | Trace and record events with `InputEventTrace` to inspect how input moves through the system. |
## Additional resources
- [Debugging](debugging.md)
- [The input debugger window](the-input-debugger-window.md)
- [Testing](testing.md)
- [See and record input event flow](see-record-input-event-flow.md)
@@ -0,0 +1,56 @@
---
uid: input-system-how-do-i
---
# 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](quick-start-guide.md), and the [Concepts](understanding-input.md) and [Workflows](Workflows.md) 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?](xref:UnityEngine.InputSystem.Controls.ButtonControl)
- [check if any key or button was pressed](xref:UnityEngine.InputSystem.InputSystem)
- [find all connected gamepads?](xref:UnityEngine.InputSystem.Gamepad)
- [find the gamepad that the player is currently using?](xref:UnityEngine.InputSystem.Gamepad)
- [know when a new device was plugged in?](monitor-devices.md)
- [create my own custom devices?](hid-create-custom-layout.md)
- create a simple "Fire" type action?</br>
Use the same techniques shown for the "Jump" action in the [Workflows section](Workflows.md)
- [require a button to be held down for some duration before triggering an action?](built-in-interactions.md#hold)
- [use a "positive" and a "negative" button to drive an axis?](configure-bindings-from-code.md#1d-axis)
- [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?](xref:UnityEngine.InputSystem.XR.XRController)
- [make my left-hand XR controller my right-hand one?](xref:UnityEngine.InputSystem.XR.XRController)
- [get all current touches from the touchscreen?](touch-polling.md#read-all-touches)
- [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?](native-devices.md)
- [add deadzoning to my gamepad sticks?](query-gamepads.md#add-a-deadzone-to-a-gamepad)
- [give my head tracking an extra update before rendering?](xref:UnityEngine.InputSystem.XR.XRHMD)
- [record events flowing through the system?](see-record-input-event-flow.md)
- [see events as they're processed?](see-record-input-event-flow.md)
- [see what Devices I have and what state they're in?](debug-device.md)
@@ -0,0 +1,8 @@
{
"folders": [
{
"path": "."
}
],
"settings": {}
}
@@ -0,0 +1,54 @@
---
uid: input-system-installation
---
# Install the Input System package
Install the Input System package and enable the input back end for your project.
## Install the package
Unity 6.1 and later include the Input System package in projects created from some templates.
If your project doesn't include the Input System package, you can install it:
1. In the main menu, go to **Window** > **Package Manager**.
1. Go to **Unity Registry**.
1. From the package list, select **Input System**.
1. Select **Install**.
1. Follow any prompts to [enable the backends](#select-a-back-end).
## Select a back end
The Unity Editor has two back end options:
- The Input Manager for backwards compatibility.
- The Input System package for new or upgraded projects.
When you install the Input System package in your project, Unity asks whether to enable the Input System back ends. Select **Yes** to enable the Input System back ends and disable the Input Manager back ends. The Editor restarts to complete the change.
To manually select a back end:
1. In the main menu, go to **Edit** > **Project Settings** > **Player**.
1. In the **Other Settings** section, set **Active Input Handling** to select a back end:
- Input Manager (Old): Builds have the `ENABLE_LEGACY_INPUT_MANAGER=1` C# `#define`.
- Input System Package (New): Builds have the `ENABLE_INPUT_SYSTEM=1` C# `#define`.
- Both: Builds have both of the C# `#define`.
The Editor restarts with a new back end.
## Import samples and demos
The Input System package includes several samples. To import a sample into your project:
1. Go to **Window** > **Package Manager**.
1. Select the Input System package.
1. Select **Samples**.
1. To import a sample, select **Import** next to its name.
For a more comprehensive demo, use the [Warriors](https://github.com/UnityTechnologies/InputSystem_Warriors) project.
## Additional resources
* [Quickstart guide](quick-start-guide.md)
* [Migrate from the old input system](migrate-from-old-input-system.md)
* [Input System workflows](Workflows.md)
@@ -0,0 +1,22 @@
---
uid: input-system-interactions
---
# Interactions
Use interactions to interpret specific input patterns from controls that define action behavior.
| **Topic** | **Description** |
| :--- | :--- |
| [**Introduction to interactions**](introduction-interactions.md) | Use interactions on bindings and actions to read control input patterns and trigger Actions. |
| [**Apply interactions to bindings**](apply-interactions-bindings.md) | Apply interactions to individual bindings. |
| [**Apply interactions to actions**](apply-interactions-actions.md) | Apply Interactions to actions, and all the bindings associated with that action. |
| [**Predefined interactions**](predefined-interactions.md) | Use the Input System's default and built-in interactions on your actions and bindings. |
| [**Write custom interactions**](write-custom-interactions.md) | Write your own custom interactions for your actions and bindings. |
## Additional resources
- [Bindings](bindings.md)
- [Processors](processors.md)
- [Configure actions](configure-actions.md)
- [Responding to input](respond-to-input.md)
@@ -0,0 +1,36 @@
---
uid: input-system-known-limitations
---
# Known limitations
The following is a list of known limitations that the Input System currently has.
## Compatibility with other Unity features
* Input processing in the background is tied to `Application.runInBackground` (That is, the "Run In Background" setting in "Player Preferences") which, however, Unity always forces to `true` in __development__ players. This means that in development players, input will always be processed, even if the app is in the background. Of course, this only pertains to platforms where the player can actually run in the background (iOS and Android are thus unaffected).
* `PlayerInput` split-screen support does not work with Cinemachine virtual cameras.
* The Input System cannot generate input for IMGUI.
* UI Toolkit can be used with `InputSystemUIInputModule` but only pointer (mouse, pen, touch) and gamepad input is supported at the moment. XR support is coming.
* Also, UI Toolkit support currently requires use of an `EventSystem` setup in order to interface the Input System with UITK.
### uGUI
* After enabling, the UI will not react to a pointer's position until the position is changed.
* The new input system cannot yet feed text input into uGUI and TextMesh Pro input field components. This means that text input ATM is still picked up directly and internally from the Unity native runtime.
* The UI will not consume input such that it will not also trigger in-game actions.
## Device support
* Currently, devices whose input sources depend on application focus (generally, keyboards and pointers but can be any device depending on platform) will not automatically sync their current state when the app loses and subsequently regains focus. This means that, for example, if the W key is held when application comes back into the foreground, the key needs to be depressed and pressed again for the input to come through.
* This is being worked on.
* (Desktop) We do not yet support distinguishing input from multiple pointers (mouse, pen, touch) or keyboards. There will be a single Mouse, Pen, Touch, and Keyboard device.
* (Windows) Pen input will not work with Wacom devices if "Windows Ink" support is turned off.
* (Windows) HID input is not currently supported in 32-bit players. This means that devices such as the PS4 controller will not work in 32-bit standalone players. Use the 64-bit standalone player instead.
* (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.
## Features Supported by Old Input Manager
* Unity Remote doesn't currently support the Input System. This is being worked on.
@@ -0,0 +1,25 @@
---
uid: input-system-layouts
---
# Layouts
Define how the Input System represents input devices and controls in memory.
Layouts are an advanced feature you use when you support custom devices or change how existing devices behave. Each layout describes a memory format for input and the controls that read and write that data. The Input System uses layouts to create the correct device types and interpret incoming input.
For end-to-end custom device setup, refer to [Custom devices](custom-devices.md).
| **Topic** | **Description** |
| :--- | :--- |
| **[About layouts](about-layouts.md)** | Learn what layouts are, how the Input System loads them, and when you need them. |
| **[Layout formats](layout-formats.md)** | Add layouts from C# types, JSON, or the layout builder API. |
| **[Layout inheritance](layout-inheritance.md)** | Derive a layout from an existing layout to reuse and extend control definitions. |
| **[Control items](control-items.md)** | Configure the controls in a layout and set their properties. |
| **[Override layout definitions](override-layout-definitions.md)** | Change an existing layout without replacing the original definition. |
| **[Precompiled layouts](precompiled-layouts.md)** | Speed up device creation by baking layouts into precompiled C# code. |
## Additional resources
- [Custom devices](custom-devices.md)
- [Debug layouts](debug-layouts.md)
- [Human Interface Device specification](hid-specification.md)
@@ -0,0 +1,22 @@
---
uid: input-system-processors
---
# Processors
Use an input processor to apply processing to input values and return the result. For example, you can use a [clamp](built-in-processors.md) processor to clamp values to within a certain range.
| **Topic** | **Description** |
| :--- | :--- |
| [**Introduction to processors**](introduction-to-processors.md) | Learn what processors can do to alter input values, and how they interact with bindings, actions, and controls. |
| [**Built-in processors**](built-in-processors.md) | Explore the processors that come built into the Input System. |
| [**Write custom processors**](write-custom-processors.md) | Create and register your own processors for use with bindings, actions, and controls. |
| [**Add processors to bindings and actions**](add-processors-bindings-actions.md) | Add processors to individual bindings, or to all bindings on an action, with the Editor or with code. |
| [**Add processors to controls**](add-processors-controls.md) | Add processors to specific control inputs, including custom controls. |
## Additional resources
- [Bindings](bindings.md)
- [Interactions](Interactions.md)
- [Configure actions](configure-actions.md)
- [Configure bs from code](configure-bindings-from-code.md)
@@ -0,0 +1,7 @@
---
uid: input-system-settings
---
To configure the Input System individually for each project, go to __Edit__ > __Project Settings…__ > __Input System Package__ from Unity's main menu.
This section describes each input setting in detail.
@@ -0,0 +1,265 @@
* [Introduction](index.md)
* [Install the Input System package](Installation.md)
* [Concepts](understanding-input.md)
* [Workflows](Workflows.md)
* [Using the Actions Workflow](using-actions-workflow.md)
* [Using the PlayerInput Workflow](using-playerinput-workflow.md)
* [Using the Direct Workflow](using-direct-workflow.md)
* [Video resources](videos.md)
* [Quick start guide](quick-start-guide.md)
* [Setting up input](setting-up-input.md)
* [Actions](actions.md)
* [Input action assets](action-assets.md)
* [About action assets](about-action-assets.md)
* [About project-wide actions](about-project-wide-actions.md)
* [Create and assign a default project-wide actions asset](create-project-wide-actions.md)
* [Create an empty action asset](create-empty-action-asset.md)
* [Assign an existing action asset as project-wide](assign-project-wide-actions.md)
* [Default actions](default-actions.md)
* [Generate C# API from actions](generate-cs-api-from-actions.md)
* [Create action maps](create-edit-delete-action-maps.md)
* [Create, edit and delete actions](create-edit-delete-actions.md)
* [Configure actions](configure-actions.md)
* [Action and control types](action-and-control-types.md)
* [About action and control types](about-action-control-types.md)
* [Configure action type](configure-action-type.md)
* [Action types reference](action-type-reference.md)
* [Configure control type](configure-control-type.md)
* [Bindings](bindings.md)
* [Introduction to bindings](introduction-to-bindings.md)
* [Binding types](binding-types.md)
* [Composite bindings](composite-bindings.md)
* [Add, duplicate or delete a binding](add-duplicate-delete-binding.md)
* [Select a control for binding](select-control-binding.md)
* [Edit composite bindings](edit-composite-bindings.md)
* [Group bindings to control schemes](group-binding-to-control-scheme.md)
* [Binding resolution](binding-resolution.md)
* [Restrict binding to a specific device](restrict-binding-resolution-to-device.md)
* [Binding conflicts](binding-conflicts.md)
* [Initial state checks](binding-initial-state-checks.md)
* [Controls](controls.md)
* [Introduction to controls](introduction-to-controls.md)
* [Control hierarchies](control-hierarchies.md)
* [Control types reference](control-types-reference.md)
* [Control usages](control-usages.md)
* [Control paths](control-paths.md)
* [Control state](control-state.md)
* [Record control state history](record-control-state-history.md)
* [Control actuation](control-actuation.md)
* [Noisy controls](noisy-controls.md)
* [Synthetic controls](synthetic-controls.md)
* [Optimizing controls](optimize-controls.md)
* [Controls schemes](control-schemes.md)
* [Interactions](Interactions.md)
* [Introduction to interactions](introduction-interactions.md)
* [Apply interactions to bindings](apply-interactions-bindings.md)
* [Apply Interactions to actions](apply-interactions-actions.md)
* [Predefined interactions](predefined-interactions.md)
* [Default Interactions](default-interactions.md)
* [Built-in Interactions](built-in-interactions.md)
* [Write custom interactions](write-custom-interactions.md)
* [Processors](processors.md)
* [Introduction to processors](introduction-to-processors.md)
* [Built-in processors](built-in-processors.md)
* [Write custom processors](write-custom-processors.md)
* [Add processors to bindings and actions](add-processors-bindings-actions.md)
* [Add processors to controls](add-processors-controls.md)
* [Input Actions Editor references](actions-editor.md)
* [Input Actions Editor window reference](input-actions-editor-window-reference.md)
* [Action Properties panel reference](action-properties-panel-reference.md)
* [Binding Properties panel reference](binding-properties-panel-reference.md)
* [Control Schemes and Devices menu reference](control-schemes-devices-menu-reference.md)
* [Configure input from code](configure-input-from-code.md)
* [Declare stand alone actions](declare-standalone-actions.md)
* [Configure input from JSON](configure-input-from-json.md)
* [Create actions in code](create-actions-in-code.md)
* [Configure bindings from code](configure-bindings-from-code.md)
* [Responding to input](respond-to-input.md)
* [About responding to input](about-responding-to-input.md)
* [Enabling actions](enable-actions.md)
* [Polling actions](polling-actions.md)
* [Set callbacks on actions](set-callbacks-on-actions.md)
* [Read devices directly](read-devices-directly.md)
* [Scripting with actions API overview](api-overview.md)
* [The Player Input component](player-input-component.md)
* [About the Player Input Component](about-player-input-component.md)
* [Get started with the Player Input component](get-started-player-input-component.md)
* [Select a notification behavior](select-notification-behavior.md)
* [Configure Unity Events](configure-unity-events.md)
* [Device Assignments](device-assignments.md)
* [Debug Player Input Component](debug-player-input-component.md)
* [Use PlayerInput Component with UI](use-player-input-component-ui.md)
* [Local multiplayer scenarios](local-multiplayer-scenarios.md)
* [Set up PlayerInput Component for local multiplayer](set-up-player-input-component-local-multiplayer.md)
* [The Player Input Manager Component](player-input-manager-component.md)
* [Get started with the Player Input Manager component](get-started-player-input-mananger-component.md)
* [Configure the Player Input Manager](configure-player-input-manager-component.md)
* [Set up split-screen local multiplayer](set-up-split-screen-local-multiplayer.md)
* [User rebinding at runtime](user-rebinding-runtime.md)
* [Look up bindings](look-up-bindings.md)
* [Display bindings](display-bindings.md)
* [Rebind an action at runtime](rebind-action-runtime.md)
* [Save and load rebinds](save-load-rebinds.md)
* [Restore original bindings](restore-original-bindings.md)
* [Input settings](input-settings.md)
* [Create a settings asset](create-settings-asset.md)
* [Update Mode](update-mode.md)
* [Background behavior](background-behavior.md)
* [Compensate orientation](compensate-orientation.md)
* [Default value properties](default-value-properties.md)
* [Supported devices](supported-devices.md)
* [Platform-specific settings](platform-specific-settings.md)
* [Devices](devices.md)
* [Types of input devices](devices-overview.md)
* [Pointer devices](devices-pointers.md)
* [Pointer devices introduction](pointers-introduction.md)
* [Touch devices](devices-touch.md)
* [Touch devices introduction](touch-introduction.md)
* [Touch polling](touch-polling.md)
* [Simulate touches](simulate-touch-input.md)
* [Bind touch input to an action](bind-touch-input.md)
* [Mouse devices](devices-mouse.md)
* [Mouse devices introduction](mouse-introduction.md)
* [Query and control mouse devices in code](query-mouse-devices.md)
* [Pen devices](devices-pen.md)
* [Pen devices introduction](pen-introduction.md)
* [Query pen devices in code](query-pen-devices.md)
* [Keyboards](devices-keyboard.md)
* [Keyboard devices introduction](keyboards-introduction.md)
* [Query keyboard devices in code](query-keyboards.md)
* [Read text input](read-keyboard-text-input.md)
* [Joystick support](devices-joysticks.md)
* [Gamepads](devices-gamepads.md)
* [Gamepads introduction](gamepads-introduction.md)
* [PlayStation gamepads](gamepads-p.md)
* [Switch gamepads](gamepads-s.md)
* [Xbox gamepads](gamepads-xbox.md)
* [Query and control gamepads in code](query-gamepads.md)
* [Gamepad polling](gamepad-polling.md)
* [Gamepad haptics](gamepad-haptics.md)
* [Sensors](devices-sensors.md)
* [Introduction to sensors](sensors-introduction.md)
* [Query sensors in code](query-sensors.md)
* [Supported sensors reference](supported-sensors-reference.md)
* [Tracked Input Devices](TrackedInputDevices.md)
* [Human Interface Device specification](hid-specification.md)
* [Human Interface Device specification introduction](hid-specification-introduction.md)
* [Create a custom device layout](hid-create-custom-layout.md)
* [Use an existing input device to create a layout](hid-create-custom-layout-existing.md)
* [Use a custom class to create a layout](hid-create-custom-layout-class.md)
* [Supported devices reference](supported-devices-reference.md)
* [Devices (scripting)](devices-scripting.md)
* [Device descriptions](device-descriptions.md)
* [Device capabilities](device-capabilities.md)
* [Device matching](device-matching.md)
* [Device lifecycle](device-lifecycle.md)
* [Create a device](create-device.md)
* [Remove a device](remove-device.md)
* [Reset a device](reset-device.md)
* [Sync a device](sync-device.md)
* [Enable and disable devices](enable-disable-devices.md)
* [Device background and focus changes](device-background-focus-changes.md)
* [Devices and domain reloads](devices-domain-reloads.md)
* [Native devices](native-devices.md)
* [Device IDs](device-ids.md)
* [Device usages](device-usages.md)
* [Device commands](device-commands.md)
* [Send a command to a device](send-command-to-device.md)
* [Add a custom device command](add-custom-device-command.md)
* [Device states](device-states.md)
* [Monitor device state changes](monitor-device-state-changes.md)
* [Synthesize a device state change](synthesize-device-state-change.md)
* [Working with devices](working-with-devices.md)
* [Monitor devices](monitor-devices.md)
* [Manually add and remove devices](manually-add-remove-devices.md)
* [Custom devices](custom-devices.md)
* [Input events](input-events.md)
* [Types of events](types-of-events.md)
* [Listen to events](listen-to-events.md)
* [Read state events](read-state-events.md)
* [Create events](create-events.md)
* [Record events](record-events.md)
* [Event processing](event-processing.md)
* [Event merging](event-merging.md)
* [Create a custom device](create-custom-device.md)
* [Step 1 The state struct](step-1-state-struct.md)
* [Step 2 The Device class](step-2-device-class.md)
* [Step 3 The Update method](step-3-update-method.md)
* [Step 4 Device registration and creation](step-4-device-registration-creation.md)
* [Step 5 current and all (optional)](step-5-current-all-optional.md)
* [Step 6 Device Commands (Optional)](step-6-device-commands-optional.md)
* [Input for user interfaces](ui-input.md)
* [Supported UI systems](supported-ui-systems.md)
* [Understand UI system compatibility](understand-ui-compatibility.md)
* [Using UI Input Module for UI support](using-ui-input-module.md)
* [Introduction to the UI Input Module](introduction-ui-input-module.md)
* [Supported input types in the UI Input Module](supported-ui-input-types.md)
* [Pointer input UI support](supported-ui-input-types-pointer.md)
* [Navigation input UI support](supported-ui-input-types-navigation.md)
* [Tracked input UI support](supported-ui-input-types-tracked.md)
* [Access the UI Input Module](access-ui-input-module.md)
* [UI Input Module component reference](ui-input-module-reference.md)
* [Use IMGUI alongside the Input System package](use-imgui-alongside-input-system.md)
* [Configure UI Input Actions](configure-ui-input-action-map.md)
* [Default UI Action Map reference](ui-action-map-reference.md)
* [Handling input target ambiguity](handling-input-target-ambiguity.md)
* [Use a Virtual Mouse for UI cursor control](virtual-mouse-ui-cursor-control.md)
* [Introduction to Virtual Mouse for UI cursor control](introduction-virtual-mouse.md)
* [Configure a Virtual Mouse](configure-virtual-mouse-input.md)
* [Virtual Mouse component reference](virtual-mouse-component-reference.md)
* [Multiplayer UI input](multiplayer-ui-input.md)
* [Introduction to multiplayer UI input](introduction-multiplayer-ui-input.md)
* [Configure multiplayer UI input](configure-multiplayer-ui-input.md)
* [Create on-screen controls](on-screen-controls.md)
* [Introduction to on-screen controls](introduction-on-screen-controls.md)
* [Create an on-screen button control](create-on-screen-button-control.md)
* [Create an on-screen stick control](create-on-screen-stick-control.md)
* [Create a custom on-screen control](create-custom-on-screen-control.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)
* [Editor features](EditorFeatures.md)
* [Read input in Editor Windows](read-input-editor-windows.md)
* [Use mobile device input in the Editor (Unity Remote)](use-mobile-device-input-editor-unity-remote.md)
* [See and record input event flow](see-record-input-event-flow.md)
* [Debugging](debugging.md)
* [The input debugger window](the-input-debugger-window.md)
* [Debug a device](debug-device.md)
* [Debug an action](debug-action.md)
* [Debug users and PlayerInput](debug-users-playerinput.md)
* [Debug layouts](debug-layouts.md)
* [Trace actions](trace-actions.md)
* [Visualizers](visualizers.md)
* [Visualise input controls](visualise-input-controls.md)
* [Visualise actions](visualise-actions.md)
* [Device Simulation](device-simulation.md)
* [Testing](testing.md)
* [Set up test assemblies](set-up-test-assemblies.md)
* [Set up test fixtures](set-up-test-fixtures.md)
* [Write tests](write-tests.md)
* [Layouts](layouts.md)
* [About layouts](about-layouts.md)
* [Layout formats](layout-formats.md)
* [Add a layout from C#](add-layout-from-cs.md)
* [Add a layout from JSON](add-layout-from-json.md)
* [Add a layout using Layout Builder](add-layout-using-layout-builder.md)
* [Layout inheritance](layout-inheritance.md)
* [Control items](control-items.md)
* [Override layout definitions](override-layout-definitions.md)
* [Precompiled layouts](precompiled-layouts.md)
* [Create a precompiled layout](create-precompiled-layout.md)
* [User management](user-management.md)
* [About user management](about-user-management.md)
* [Create a user paired with an input device](create-user-paired-with-input-device.md)
* [Handle loss of a device](handle-loss-of-device.md)
* [Migrate from the old input system](migrate-from-old-input-system.md)
* [Enable the correct input system](enable-correct-input-system.md)
* [Corresponding old and new APIs](corresponding-old-new-api.md)
* [How do I...?](HowDoI.md)
* [Architecture](Architecture.md)
* [Contribute to the Input System source code](Contributing.md)
* [Known limitations](KnownLimitations.md)
@@ -0,0 +1,21 @@
---
uid: input-system-testing
---
# Testing
Write automated input tests that drive the Input System from code without physical devices.
The Input System includes support for automated input tests. Generated input in tests is treated the same as input from platform backends at runtime, so you can verify gameplay and UI logic without depending on connected hardware. Work through the topics below in order: configure your test assemblies, set up a test fixture, then write tests.
| **Topic** | **Description** |
| :--- | :--- |
| **[Set up test assemblies](set-up-test-assemblies.md)** | Configure your project so Input System test code is included in test builds. |
| **[Set up test fixtures](set-up-test-fixtures.md)** | Run each test against an isolated Input System instance using InputTestFixture. |
| **[Write tests](write-tests.md)** | Add devices and simulate input using the InputTestFixture API. |
## Additional resources
- [Actions](actions.md)
- [The Player Input component](player-input-component.md)
- [Layouts](layouts.md)

Some files were not shown because too many files have changed in this diff Show More