diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index 3ac0e72ff1..6773efbc0a 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -12,6 +12,7 @@ however, it has to be formatted properly to pass verification tests. ### Fixed - Fixed an issue where all action maps were enabled initially for project wide actions, which overrode the PlayerInput action map configuration. [ISXB-920](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-920) +- Fixed an issue where ButtonStates are not fully updated when switching SingleUnifiedPointer. [ISXB-1356](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1356) ### Changed - Changed enum value `Key.IMESelected` to obsolete which was not a real key. Please use the ButtonControl `imeSelected`. diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs index b4b9202b18..f2443f4fa7 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs @@ -1931,6 +1931,15 @@ private int GetPointerStateIndexFor(InputControl control, bool createIfNotExists // Make sure these don't linger around when we switch to a different kind of pointer. eventData.trackedDeviceOrientation = default; eventData.trackedDevicePosition = default; + + // We only have a single pointer state and current frame press state values was based on previous eventData. + // Make sure these get updated when we switch. + if (m_PointerBehavior == UIPointerBehavior.SingleUnifiedPointer) + { + pointer.leftButton.OnEndFrame(); + pointer.rightButton.OnEndFrame(); + pointer.middleButton.OnEndFrame(); + } } if (pointerType == UIPointerType.Touch)