Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

2 or 3 OnClick Events Lost When Game Regains Focus

Discussion in 'Input System' started by ChristopherKroll, Feb 25, 2022.

  1. ChristopherKroll

    ChristopherKroll

    Joined:
    Feb 12, 2015
    Posts:
    7
    After switching to the new Input System, there is a lag in button clicks registering after the application regains focus.

    1. Mouse is clicked outside of game window.
    2. Mouse is clicked inside of game window (focus regained).
    3. Buttons are clicked 2 or 3 times with no click event, button hover state is correctly displaying.

    Any way to remedy this?
     
  2. OddViz

    OddViz

    Joined:
    Dec 17, 2019
    Posts:
    9
    Try to call InputSystem.ResetDevice(Mouse.current, true) in an OnApplicationFocus method.
    The first click (the one that returns focus to the game) still won't be registered though.