Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Resolved State format KEYS from event does not match state format MOUS of device Mouse:/Mouse

Discussion in 'Input System' started by jakesee, Dec 13, 2023.

  1. jakesee

    jakesee

    Joined:
    Jan 7, 2020
    Posts:
    81
    How can I fix the below error? Not sure bug or what.

    I am using the Unity Test Framework to do testing and an unknown cause is throwing the below error. The first time I got this error, I reset the Player Settings to remove support for the default Input Manager completely. The second time I shutdown Editor and relaunch it again.

    Code (CSharp):
    1. ArgumentException: State format KEYS from event does not match state format MOUS of device Mouse:/Mouse
    2. Parameter name: eventPtr
    3. UnityEngine.InputSystem.LowLevel.InputState.Change (UnityEngine.InputSystem.InputDevice device, UnityEngine.InputSystem.LowLevel.InputEventPtr eventPtr, UnityEngine.InputSystem.LowLevel.InputUpdateType updateType) (at ./Library/PackageCache/com.unity.inputsystem@1.7.0/InputSystem/State/InputState.cs:80)
    4. UnityEngine.InputSystem.Pointer.OnStateEvent (UnityEngine.InputSystem.LowLevel.InputEventPtr eventPtr) (at ./Library/PackageCache/com.unity.inputsystem@1.7.0/InputSystem/Devices/Pointer.cs:245)
    5. UnityEngine.InputSystem.Mouse.OnStateEvent (UnityEngine.InputSystem.LowLevel.InputEventPtr eventPtr) (at ./Library/PackageCache/com.unity.inputsystem@1.7.0/InputSystem/Devices/Mouse.cs:312)
    6. UnityEngine.InputSystem.FastMouse.OnStateEvent (UnityEngine.InputSystem.LowLevel.InputEventPtr eventPtr) (at ./Library/PackageCache/com.unity.inputsystem@1.7.0/InputSystem/Devices/Precompiled/FastMouse.partial.cs:29)
    7. UnityEngine.InputSystem.FastMouse.UnityEngine.InputSystem.LowLevel.IInputStateCallbackReceiver.OnStateEvent (UnityEngine.InputSystem.LowLevel.InputEventPtr eventPtr) (at ./Library/PackageCache/com.unity.inputsystem@1.7.0/InputSystem/Devices/Precompiled/FastMouse.partial.cs:49)
    8. UnityEngine.InputSystem.InputManager.OnUpdate (UnityEngine.InputSystem.LowLevel.InputUpdateType updateType, UnityEngine.InputSystem.LowLevel.InputEventBuffer& eventBuffer) (at ./Library/PackageCache/com.unity.inputsystem@1.7.0/InputSystem/InputManager.cs:3390)
    9. 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.7.0/InputSystem/NativeInputRuntime.cs:65)
    10. UnityEngine.InputSystem.LowLevel.<>c__DisplayClass7_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*)
    11. UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr)
    12.  
    13.  
     
  2. jakesee

    jakesee

    Joined:
    Jan 7, 2020
    Posts:
    81
    This happens when InputTestFixture was not allowed to TearDown sucessfully. The Editor InputSystem will be in an undefined state and unusable in future Play Mode, until the Editor is shutdown and relaunched.

    To resolve this, make sure to override the InputTestFixture.TearDown() method and call base.TearDown() before your own code. Do not create your own TearDown function.