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
  3. Dismiss Notice

Question BackgroundBehaviour.IgnoreFocus how does it work?

Discussion in 'Input System' started by tabulatouch, May 13, 2024.

  1. tabulatouch

    tabulatouch

    Joined:
    Mar 12, 2015
    Posts:
    26
    Hello,
    We are struggling to get input (gamepad) focus to be maintained even when the game window is not in focus.
    In our case we have an external editor on one monitor, and the Unity game window on another monitor.
    We only get input when the game window is focused (click on icon on taskbar), but this disallows using the mouse/keyboard for editing on the desktop companion app, we cannot do both.

    However I am pretty sure that in former Unity versions (don't remember which) once the gamepad was connected with the window in focus, the input continued being detected despite the window focus changing.
    Also it seems we get this behaviour on development builds.

    We tried experimenting with BackgroundBehaviour.IgnoreFocus but that creates even stranger behaviours, like we need to click many times before a gamepad is detected, and don't get input events if the window is out of focus.
    We are using now 2023.3.16f1 and InputSystem 1.7.0

    Thank you!
    @Schubkraft :)