diff --git a/Packages/com.unity.inputsystem/Documentation~/built-in-interactions.md b/Packages/com.unity.inputsystem/Documentation~/built-in-interactions.md index b863b75893..b311ca2f4e 100644 --- a/Packages/com.unity.inputsystem/Documentation~/built-in-interactions.md +++ b/Packages/com.unity.inputsystem/Documentation~/built-in-interactions.md @@ -93,12 +93,12 @@ A [`SlowTapInteraction`](xref:UnityEngine.InputSystem.Interactions.SlowTapIntera ## MultiTap -A [`MultiTapInteraction`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction) requires the user to press and release a Control within [`tapTime`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction) seconds [`tapCount`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction) times, with no more then [`tapDelay`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction) seconds passing between taps, for the Interaction to trigger. You can use this to detect double-click or multi-click gestures. +You can use `MultiTap` to detect double-click or multi-click gestures. For a [`MultiTapInteraction`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction) to trigger, the user must press a control and release it within [`tapTime`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction) seconds, repeating the press-and-release process [`tapCount`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction) times. There can't be more than [`tapDelay`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction) seconds between taps. |__Parameters__|Type|Default value| |---|---|---| |[`tapTime`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction)|`float`|[`InputSettings.defaultTapTime`](xref:UnityEngine.InputSystem.InputSettings)| -|[`tapDelay`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction)|`float`|2 * [`tapTime`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction)| +|[`tapDelay`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction)|`float`| Falls back to `InputSettings.multiTapDelayTime` when `tapDelay` is unset. | |[`tapCount`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction)|`int`|2| |[`pressPoint`](xref:UnityEngine.InputSystem.Interactions.MultiTapInteraction)|`float`|[`InputSettings.defaultButtonPressPoint`](xref:UnityEngine.InputSystem.InputSettings)| diff --git a/Packages/com.unity.inputsystem/Documentation~/device-capabilities.md b/Packages/com.unity.inputsystem/Documentation~/device-capabilities.md index 972a874552..99e9e165c7 100644 --- a/Packages/com.unity.inputsystem/Documentation~/device-capabilities.md +++ b/Packages/com.unity.inputsystem/Documentation~/device-capabilities.md @@ -4,4 +4,4 @@ uid: input-system-device-capabilities # Device capabilities -Part of the Device description can be a [`capabilities`](xref:UnityEngine.InputSystem.Layouts.InputDeviceDescription) string in JSON format. This string describes characteristics that 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-specification-introduction.md). WebGL, Android, and Linux use similar mechanisms to report available Controls on connected gamepads. +Part of the Device description can be a [`capabilities`](xref:UnityEngine.InputSystem.Layouts.InputDeviceDescription) string in JSON format. This string describes characteristics that 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-specification-introduction.md). Web, Android, and Linux use similar mechanisms to report available Controls on connected gamepads. diff --git a/Packages/com.unity.inputsystem/Documentation~/event-processing.md b/Packages/com.unity.inputsystem/Documentation~/event-processing.md index b734e74ddf..231d9461cc 100644 --- a/Packages/com.unity.inputsystem/Documentation~/event-processing.md +++ b/Packages/com.unity.inputsystem/Documentation~/event-processing.md @@ -8,7 +8,7 @@ uid: input-system-event-processing Each time input is processed, [`InputSystem.Update`](xref:UnityEngine.InputSystem.InputSystem) is called implicitly by the Unity runtime. -The interval at which this happens is determined by the ["Update Mode"](update-mode.md) 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](update-mode.md) 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. @@ -17,8 +17,8 @@ When using [`UpdateMode.ProcessEventsInFixedUpdate`](xref:UnityEngine.InputSyste The other exception are [`BeforeRender`](xref:UnityEngine.InputSystem.LowLevel.InputUpdateType) 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`](xref:UnityEngine.InputSystem.InputSystem) 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). +> Manually calling `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). -Methods such as [`InputAction.WasPerformedThisFrame`](xref:UnityEngine.InputSystem.InputAction) and [`InputAction.WasPerformedThisFrame`](xref:UnityEngine.InputSystem.InputAction) 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) operate implicitly based on the `InputSystem.Update` cadence described above. Meaning, they refer to the state as it was in the __last__ fixed, dynamic, or manual update happened. You can query the [current/last update type](xref:UnityEngine.InputSystem.LowLevel.InputState) and [count](xref:UnityEngine.InputSystem.LowLevel.InputState) from [`InputState`](xref:UnityEngine.InputSystem.LowLevel.InputState). diff --git a/Packages/com.unity.inputsystem/Documentation~/gamepads-p.md b/Packages/com.unity.inputsystem/Documentation~/gamepads-p.md index 683f55c9a0..4035b11075 100644 --- a/Packages/com.unity.inputsystem/Documentation~/gamepads-p.md +++ b/Packages/com.unity.inputsystem/Documentation~/gamepads-p.md @@ -12,7 +12,7 @@ The Input System implements PlayStation gamepads as different derived types of t * [`DualShock4GampadiOS`](xref:UnityEngine.InputSystem.iOS.DualShock4GampadiOS): A DualShock 4 controller connected to an iOS Device with Bluetooth. Requires iOS 13 or higher. * [`SetLightBarColor(Color)`](xref:UnityEngine.InputSystem.DualShock.DualShockGamepad.SetLightBarColor(UnityEngine.Color)): Used to set the color of the light bar on the controller. -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 supports PlayStation controllers on Web 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. For more information on platform support for PlayStation gamepads, refer to [Supported devices reference](supported-devices-reference.md). diff --git a/Packages/com.unity.inputsystem/Documentation~/gamepads-xbox.md b/Packages/com.unity.inputsystem/Documentation~/gamepads-xbox.md index 48dfe168c6..73f58de3da 100644 --- a/Packages/com.unity.inputsystem/Documentation~/gamepads-xbox.md +++ b/Packages/com.unity.inputsystem/Documentation~/gamepads-xbox.md @@ -18,6 +18,6 @@ On other platforms, Unity uses derived classes to represent Xbox controllers: XInput controllers on macOS 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. macOS natively supports these controllers as [HID devices](hid-specification-introduction.md) without any additional drivers when connected with 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. +Unity supports Xbox controllers on Web 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. For more information on platform support for Xbox gamepads, refer to [Supported devices reference](supported-devices-reference.md). diff --git a/Packages/com.unity.inputsystem/Documentation~/supported-devices-reference.md b/Packages/com.unity.inputsystem/Documentation~/supported-devices-reference.md index 7b4f7ef9e2..f53330245f 100644 --- a/Packages/com.unity.inputsystem/Documentation~/supported-devices-reference.md +++ b/Packages/com.unity.inputsystem/Documentation~/supported-devices-reference.md @@ -10,7 +10,7 @@ This page lists Input Device types and products that the Input System package su Support for the following Devices doesn't require specialized support of particular products. -|Device|Windows|Mac|Linux|UWP|Android|iOS|tvOS|Xbox(3)|PS4(3)|Switch(3)|WebGL| +|Device|Windows|Mac|Linux|UWP|Android|iOS|tvOS|Xbox(3)|PS4(3)|Switch(3)|Web| |------|-------|---|-----|---|-------|---|----|----|---|------|-----| |[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| @@ -27,7 +27,7 @@ Support for the following Devices doesn't require specialized support of particu ## Gamepads -|Device|Windows|Mac|Linux|UWP(13)|Android|iOS(6)|tvOS(6)|Xbox(7)|PS4/PS5(7)|Switch(7)|WebGL| +|Device|Windows|Mac|Linux|UWP(13)|Android|iOS(6)|tvOS(6)|Xbox(7)|PS4/PS5(7)|Switch(7)|Web| |------|-------|---|-----|---|-------|---|----|----|---|------|-----| |Xbox 360 (4)|Yes|Yes (3)|Yes|Yes|No|No|No|Yes|No|No|Sometimes (2)| |Xbox One|Yes (1)|Yes (3)|Yes (1)|Yes|Yes (1)|Yes (6)|Yes (6)|Yes|No|No|Sometimes (2)| @@ -38,7 +38,7 @@ Support for the following Devices doesn't require specialized support of particu > [!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. +> 2. Web 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 light bar 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 light bar are not working correctly. @@ -53,15 +53,16 @@ Support for the following Devices doesn't require specialized support of particu > - 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). +> 14. In Unity 6.0, the WebGL build target was renamed to Web. However, to maintain backward compatibility, the Input System APIs, device layouts, and interface names retain the WebGL prefix (for example, WebGLGamepad). -### WebGL +### Web 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. +> Unity's Web platform currently doesn't support rumble. ## Other gamepads, joysticks, and racing wheels diff --git a/Packages/com.unity.inputsystem/Documentation~/supported-sensors-reference.md b/Packages/com.unity.inputsystem/Documentation~/supported-sensors-reference.md index af58c695ca..8b33dee155 100644 --- a/Packages/com.unity.inputsystem/Documentation~/supported-sensors-reference.md +++ b/Packages/com.unity.inputsystem/Documentation~/supported-sensors-reference.md @@ -6,7 +6,7 @@ uid: input-system-supported-sensors-ref Each sensor device implements a single control which represents the data read by the sensor. The following sensors are available: -| Sensor | Description | Android | iOS | WebGL | +| Sensor | Description | Android | iOS | Web | | :---- | :---- | :---- | :---- | :---- | | [`Accelerometer`](xref:UnityEngine.InputSystem.Accelerometer) | Measures the acceleration of a device. | Yes | Yes | Yes | | [`Gyroscope`](xref:UnityEngine.InputSystem.Gyroscope) | Measures the angular velocity of a device. | Yes | Yes | Yes | diff --git a/Packages/com.unity.inputsystem/Documentation~/write-custom-interactions.md b/Packages/com.unity.inputsystem/Documentation~/write-custom-interactions.md index 3d53d81bd9..4b78874465 100644 --- a/Packages/com.unity.inputsystem/Documentation~/write-custom-interactions.md +++ b/Packages/com.unity.inputsystem/Documentation~/write-custom-interactions.md @@ -26,7 +26,7 @@ public class MyExampleInteraction : IInputInteraction switch (context.phase) { case InputActionPhase.Waiting: - if (context.Control.ReadValue() == 1) + if (context.control.ReadValue() == 1) { context.Started(); context.SetTimeout(duration); @@ -34,7 +34,7 @@ public class MyExampleInteraction : IInputInteraction break; case InputActionPhase.Started: - if (context.Control.ReadValue() == -1) + if (context.control.ReadValue() == -1) context.Performed(); break; }