diff --git a/Runtime/UXComponent/UX/UXHotkey.cs b/Runtime/UXComponent/UX/UXHotkey.cs index 111f85d..330335b 100644 --- a/Runtime/UXComponent/UX/UXHotkey.cs +++ b/Runtime/UXComponent/UX/UXHotkey.cs @@ -116,7 +116,7 @@ internal static class UXHotkeyComponent { hotkeyInfo = registrations[i]; registrations.RemoveAt(i); - _hotkeyRegistry.Remove(actionId); + if (_sharedHandlers.TryGetValue(actionId, out var handlerInfo)) { var (handler, pressType) = handlerInfo; @@ -128,6 +128,7 @@ internal static class UXHotkeyComponent { actionRef.action.Disable(); _sharedHandlers.Remove(actionId); + _hotkeyRegistry.Remove(actionId); } switch (pressType)