You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Packages/com.unity.inputsystem/Documentation~/Architecture.md
+21-17Lines changed: 21 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,23 +3,24 @@ uid: input-system-architecture
3
3
---
4
4
# Architecture
5
5
6
-
The Input System has a layered architecture that consists of a low-level layer and a high-level layer.
6
+
The Input System architecture has two layers: low-level high-level. It interacts with the built-in back end in the Unity Editor.
7
7
8
-
#Native backend
8
+
## The built-in back end
9
9
10
-
The foundation of the Input System is the native backend code. This is platform-specific code that collects information about available devices and input data from devices. This code isn't part of the Input System package; it's 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.
10
+
The foundation of the Input System is the built-in back end code. This is platform-specific code that collects information about available devices and input data from devices. This code isn't part of the Input System package; it's 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.
11
11
12
-
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) and any updates to the Device states. For efficiency and to avoid creating garbage, the native backend reports these events as a simple buffer of raw, unmanaged memory containing a stream of events.
12
+
The Input System interfaces with the built-in back end in one of two ways:
13
13
14
-
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.
14
+
- With [events](input-events.md) that the built-in back end sends. These events notify the system of the creation and removal of [Input devices](devices.md) and any updates to the device states. For efficiency, the built-in back end reports these events as a simple buffer of raw, unmanaged memory containing a stream of events.
15
+
- Sending data back to the built-in back end in the form of [commands](device-commands.md) sent to devices, which are also buffers of memory that the built-in back end interprets. These commands can have different meanings for different device types and platforms.
15
16
16
-
#Input System (low-level)
17
+
## Low-level diagram
17
18
18
19
The diagram of the low-level Input System reads top-to-bottom as a layered pipeline:
19
20
20
-
1. The native platform backends at the bottom feed the InputManager.
21
+
1. The built-in platform back ends feed the InputManager.
21
22
1. The InputManager uses layouts to build devices.
22
-
1. The device's state is stored in Input State Memory at the top.
23
+
1. The device's state is stored in Input State Memory.
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 lowlevel system, or dynamically at runtime, as in the case of[generic HIDs](hid-specification.md).
196
+
The high-level Input System code uses [layouts](layouts.md) to interpret the data in a device's state buffers. The layoutsdescribe a device's data and its controls in memory. The Input System creates layouts from either the predefined structs of commonly known devices supplied by the low-level system, or dynamically at runtime, for example, for[generic HIDs](hid-specification.md).
196
197
197
-
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.
198
+
Based on the information in the layouts, the Input System creates representations for each of the device's [controls](controls.md). You can now read the state of each of the device's controls individually.
198
199
199
-
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).
200
+
As part of the high-level system, you can also:
201
+
202
+
- Build another abstraction layer to map 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).
203
+
- 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 commit comments