From f6e8ad2c0c6198b6ee24f1da48255a05b0173343 Mon Sep 17 00:00:00 2001 From: Simon Wittber Date: Tue, 25 Jun 2024 14:01:24 +0800 Subject: [PATCH] changed Submit and Cancel actions to use WasPerformed instead of WasPressed. --- Packages/com.unity.inputsystem/CHANGELOG.md | 1 + .../InputSystem/Plugins/UI/InputSystemUIInputModule.cs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index 6709462374..f911dd5b78 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. ### Change - Added warning messages to both `OnScreenStick` and `OnScreenButton` Inspector editors that would display a warning message in case on-screen control components are added to a `GameObject` not part of a valid UI hierarchy. +- Submit and Cancel UI actions will now respect configured interactions. [ISXB-841](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-841) ### Fixed - Avoid potential crashes from `NullReferenceException` in `FireStateChangeNotifications`. diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs index 66c4f95bb1..8f89b751fe 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs @@ -709,9 +709,9 @@ internal void ProcessNavigation(ref NavigationModel navigationState) var cancelAction = m_CancelAction?.action; var data = GetBaseEventData(); - if (cancelAction != null && cancelAction.WasPressedThisFrame()) + if (cancelAction != null && cancelAction.WasPerformedThisFrame()) ExecuteEvents.Execute(eventSystem.currentSelectedGameObject, data, ExecuteEvents.cancelHandler); - if (!data.used && submitAction != null && submitAction.WasPressedThisFrame()) + if (!data.used && submitAction != null && submitAction.WasPerformedThisFrame()) ExecuteEvents.Execute(eventSystem.currentSelectedGameObject, data, ExecuteEvents.submitHandler); } }