Search Unity

Key release is not detected until another input is made

Discussion in 'Input System' started by masakimasa, Dec 8, 2021.

  1. masakimasa

    masakimasa

    Joined:
    Oct 19, 2020
    Posts:
    4
    I'm using Unity 2021.2.5, macOS Monterey, Input System 1.2.0.

    Since 2021.2.2, there has been a problem that the release of the key is sometimes not detected and the character keeps moving. Updating to 2021.2.5 is not solved this.

    I have checked the keyboard input by Input Debugger and noticed that sometimes key release signal is not fired immediately.
    In this state, the release signal does not occur until I move the mouse cursor or press another key.

    This also happened in a newly created project.

    Is this a bug of input system?

    I would appreciate any information on this issue.
    Thanks.

    [ScreenShots]

    This is a normal state.
    スクリーンショット 2021-12-08 8.34.47.png

    This is the state that no key release was detected.
    スクリーンショット 2021-12-08 8.35.58.png
     
    DiegoR likes this.
  2. gfenn

    gfenn

    Joined:
    Jan 28, 2021
    Posts:
    4
    I'm seeing this same problem.

    I have PlayerInput hooked up with `Invoke Unity Events`. I have a method called `TestInput` that takes `InputAction.CallbackContext input` and directly logs the value.

    If I just sit there and push the button, 90% of the time it will properly log the True and False as the button is pressed and released.

    However, the other 10% of the time, it only logs the True, despite the button being released. I can sit there for a while and nothing happens. Once I move the mouse, however, the False is logged for that button.

    Seems like something under the hood is going to sleep and re-awakened by the mouse movements?
     
    adslitw, DiegoR and masakimasa like this.
  3. DiegoR

    DiegoR

    Joined:
    Oct 31, 2012
    Posts:
    33
    I was about to report exactly the same problem. I tried with Unity 2021.2.3 and then with Unity 2021.2.5 and got this issue (I am using the Silicon version of the editor and macOS Monterey 12.0.1)

    Then I returned to Unity 2021.1.28 (Intel) and everything worked as expected.

    Is there a workaround?
     
    masakimasa likes this.
  4. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
    I've reported it, the QA person had trouble reproducing it though so I had to send some videos of it happening. Maybe the QA person didn't have an M1 machine or something. I haven't figured out a workaround yet, it's very frustrating!

    @masakimasa I have the problem using the default (old) input system, so I don't think it's a problem with the Input System package itself, I think it's more fundamental.
     
    masakimasa likes this.
  5. masakimasa

    masakimasa

    Joined:
    Oct 19, 2020
    Posts:
    4
    Thank you for the information!
    Debugging is really tough because of this problem.

    I updated Unity to 2021.2.6f1 but it didn't fix this.

    I also noticed that this only happens in Unity Editor.
    It does not occur in the app built for both macOS and Windows.

    I hope the problem will be fixed soon.