Skip to content

Commit 5f02b48

Browse files
authored
NEW: Expose displayIndex via the Touch object (#1677)
* Recreate change from Tony for touch displayIndex support
1 parent 412e854 commit 5f02b48

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ however, it has to be formatted properly to pass verification tests.
1414
- Added `InputSystem.customBindingPathValidators` interface to allow showing warnings in the `InputAsset` Editor for specific InputBindings and draw custom UI in the properties panel.
1515
- Added `InputSystem.runInBackground` to be used internally by specific platforms packages. Allows telling the input system that a specific platform runs in background. It allows fixing of [case UUM-6744](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-6744).
1616
- Added new UIToolkit version of the `InputActionsAsset` editor. Currently this is incomplete (view-only) and the existing editor is still used by default.
17+
- Added `displayIndex` field to the Touch struct to expose the index of the display that was touched.
1718

1819
### Changed
1920
- Changed XR Layout build behavior to create Axis2D control devices with `StickControl` type instead of `Vector2Control`.

Packages/com.unity.inputsystem/InputSystem/Plugins/EnhancedTouch/Touch.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,14 @@ public struct Touch : IEquatable<Touch>
235235
/// <seealso cref="TouchControl.tap"/>
236236
public bool isTap => state.isTap;
237237

238+
/// <summary>
239+
/// The index of the display containing the touch.
240+
/// </summary>
241+
/// <value>A zero based number representing the display index containing the touch.</value>
242+
/// <seealso cref="TouchControl.displayIndex"/>
243+
/// <seealso cref="Display"/>
244+
public int displayIndex => state.displayIndex;
245+
238246
/// <summary>
239247
/// Whether the touch is currently in progress, i.e. has a <see cref="phase"/> of
240248
/// <see cref="TouchPhase.Began"/>, <see cref="TouchPhase.Moved"/>, or <see cref="TouchPhase.Stationary"/>.

0 commit comments

Comments
 (0)