1.4.3 Two Modifiers The InputEventPtr is not valid

This isn’t a problem in version 1.3.0 but is in 1.4.3 (don’t know about any other 1.4.x version)

InvalidOperationException: The InputEventPtr is not valid.
UnityEngine.InputSystem.LowLevel.InputEventPtr.set_handled (System.Boolean value) (at Library/PackageCache/com.unity.inputsystem@1.4.3/InputSystem/Events/InputEventPtr.cs:66)
UnityEngine.InputSystem.InputActionState.ChangePhaseOfActionInternal (System.Int32 actionIndex, UnityEngine.InputSystem.InputActionState+TriggerState* actionState, UnityEngine.InputSystem.InputActionPhase newPhase, UnityEngine.InputSystem.InputActionState+TriggerState& trigger) (at Library/PackageCache/com.unity.inputsystem@1.4.3/InputSystem/Actions/InputActionState.cs:2407)
UnityEngine.InputSystem.InputActionState.ChangePhaseOfAction (UnityEngine.InputSystem.InputActionPhase newPhase, UnityEngine.InputSystem.InputActionState+TriggerState& trigger, UnityEngine.InputSystem.InputActionPhase phaseAfterPerformedOrCanceled) (at Library/PackageCache/com.unity.inputsystem@1.4.3/InputSystem/Actions/InputActionState.cs:2357)
UnityEngine.InputSystem.InputActionState.ChangePhaseOfInteraction (UnityEngine.InputSystem.InputActionPhase newPhase, UnityEngine.InputSystem.InputActionState+TriggerState& trigger, UnityEngine.InputSystem.InputActionPhase phaseAfterPerformed, System.Boolean processNextInteractionOnCancel) (at Library/PackageCache/com.unity.inputsystem@1.4.3/InputSystem/Actions/InputActionState.cs:2249)
UnityEngine.InputSystem.InputInteractionContext.PerformedAndStayPerformed () (at Library/PackageCache/com.unity.inputsystem@1.4.3/InputSystem/Actions/InputInteractionContext.cs:183)
UnityEngine.InputSystem.Interactions.HoldInteraction.Process (UnityEngine.InputSystem.InputInteractionContext& context) (at Library/PackageCache/com.unity.inputsystem@1.4.3/InputSystem/Actions/Interactions/HoldInteraction.cs:61)
UnityEngine.InputSystem.InputActionState.ProcessTimeout (System.Double time, System.Int32 mapIndex, System.Int32 controlIndex, System.Int32 bindingIndex, System.Int32 interactionIndex) (at Library/PackageCache/com.unity.inputsystem@1.4.3/InputSystem/Actions/InputActionState.cs:2063)
UnityEngine.InputSystem.InputActionState.UnityEngine.InputSystem.LowLevel.IInputStateChangeMonitor.NotifyTimerExpired (UnityEngine.InputSystem.InputControl control, System.Double time, System.Int64 mapControlAndBindingIndex, System.Int32 interactionIndex) (at Library/PackageCache/com.unity.inputsystem@1.4.3/InputSystem/Actions/InputActionState.cs:1333)
UnityEngine.InputSystem.InputManager.ProcessStateChangeMonitorTimeouts () (at Library/PackageCache/com.unity.inputsystem@1.4.3/InputSystem/InputManagerStateMonitors.cs:440)
UnityEngine.InputSystem.InputManager.OnUpdate (UnityEngine.InputSystem.LowLevel.InputUpdateType updateType, UnityEngine.InputSystem.LowLevel.InputEventBuffer& eventBuffer) (at Library/PackageCache/com.unity.inputsystem@1.4.3/InputSystem/InputManager.cs:3292)
UnityEngine.InputSystem.LowLevel.NativeInputRuntime+<>c__DisplayClass7_0.<set_onUpdate>b__0 (UnityEngineInternal.Input.NativeInputUpdateType updateType, UnityEngineInternal.Input.NativeInputEventBuffer* eventBufferPtr) (at Library/PackageCache/com.unity.inputsystem@1.4.3/InputSystem/NativeInputRuntime.cs:65)
UnityEngine.InputSystem.LowLevel.<>c__DisplayClass7_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*)
UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr) (at /Users/bokken/buildslave/unity/build/Modules/Input/Private/Input.cs:120)

1 Like

I got the same error when I call InputInteractionContext.Performed() after a timer in a custom interactrion.

        public void Process(ref InputInteractionContext context)
        {
            if (context.timerHasExpired) {
                context.PerformedAndStayStarted(); // InvalidOperationException: The InputEventPtr is not valid.
                context.SetTimeout(duration);
                return;
            }

            if (context.isWaiting && context.ControlIsActuated()) {
                context.PerformedAndStayStarted();
                context.SetTimeout(duration);
                return;
            }

            if (context.isStarted && !context.ControlIsActuated()) {
                context.Canceled();
                return;
            }
        }

This is fixed in the next release (>1.4.3). You can try it out today on develop branch here if you want to check it works for you.

2 Likes

It works.