Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ myAction.AddCompositeBinding("Axis")
.With("Negative", "<Gamepad>/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.isPartOfComposiste`](../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`](../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.

Note that each composite part can be bound arbitrary many times.

Expand Down Expand Up @@ -511,7 +511,7 @@ playerInput.actions.FindActionMap("gameplay").ChangeBinding(0).Erase();

### Adding Bindings

New bindings can be added to an Action using [`AddAction`](../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`](../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_).

```CSharp
// Add a binding for the left mouse button to the "fire" action.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public interface IInputInteraction
/// if (actuationTime >= 1)
/// context.Performed();
/// else
/// context.Cancelled();
/// context.Canceled();
/// }
///
/// // Control changed value somewhere above 3/4 of its actuation. Doesn't
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ public static string GetBindingDisplayString(this InputAction action, int bindin
/// <paramref name="action"/> for which to get a display string.</param>
/// <param name="deviceLayoutName">Receives the name of the <see cref="InputControlLayout"/> used for the
/// device in the given binding, if applicable. Otherwise is set to <c>null</c>. If, for example, the binding
/// is <c>"&lt;Gamepad&gt;/buttonSouth"</c>, the resulting value is <c>"Gamepad</c>.</param>
/// is <c>"&lt;Gamepad&gt;/buttonSouth"</c>, the resulting value is <c>"Gamepad"</c>.</param>
/// <param name="controlPath">Receives the path to the control on the device referenced in the given binding,
/// if applicable. Otherwise is set to <c>null</c>. If, for example, the binding is <c>"&lt;Gamepad&gt;/leftStick/x"</c>,
/// the resulting value is <c>"leftStick/x"</c>.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public struct InputBinding : IEquatable<InputBinding>
/// // A binding that belongs to the "Keyboard&amp;Mouse" and "Gamepad" group.
/// new InputBinding
/// {
/// path = "*/{PrimaryAction},
/// path = "*/{PrimaryAction}",
/// groups = "Keyboard&amp;Mouse;Gamepad"
/// };
/// </code>
Expand Down Expand Up @@ -281,7 +281,7 @@ public string overrideProcessors
/// <code>
/// new InputBinding
/// {
/// path = "*/{PrimaryAction},
/// path = "*/{PrimaryAction}",
/// // Associate the binding both with the "KeyboardMouse" and
/// // the "Gamepad" group.
/// groups = "KeyboardMouse;Gamepad",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public static string ToHumanReadableString(string path,
/// </summary>
/// <param name="path">A control path such as "&lt;XRController>{LeftHand}/position".</param>
/// <param name="deviceLayoutName">Receives the name of the device layout that the control path was resolved to.
/// This is useful </param>
/// This is useful if you want to decide on an icon to display that represents the device.</param>
/// <param name="controlPath">Receives the path to the referenced control on the device or <c>null</c> if not applicable.
/// For example, with a <paramref name="path"/> of <c>"&lt;Gamepad&gt;/dpad/up"</c>, the resulting control path
/// will be <c>"dpad/up"</c>. This is useful when trying to look up additional resources (such as images) based on the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public ReadOnlyArray<InputDevice> lostDevices
/// cref="ActivateControlScheme(InputControlScheme)"/> and related APIs like <see cref="controlScheme"/>
/// and <see cref="controlSchemeMatch"/>).
///
/// Note that is generally does not make sense for users to share actions. Instead, each user should
/// Note that it generally does not make sense for users to share actions. Instead, each user should
/// receive a set of actions private to the user.
/// </remarks>
/// <seealso cref="AssociateActionsWithUser(IInputActionCollection)"/>
Expand Down