Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Focus issue with UI Toolkit and New Input System

Discussion in 'Input System' started by dlorre, Jan 26, 2022.

  1. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    699
    CASE 1398316

    Unity 2021.2.8f1


    I was planning to use both UIToolkit and New Input System for my project, but sadly, as it is, one of the two must go.

    My problem is very simple: I have a panel with a few controls, such as sliders, dropdown and buttons and I must be able to interact with them with the gamepad and the gamepad only. The reason why I need this is because Steam Deck is on the way and it has a gamepad kind of input.

    With UIToolkit and New Input System together this is a no go, because the UI does not get the focus until after I have clicked with the mouse. There are also several other issues that I have reported such as tabindex not working with the gamepad, dropdown menu not restoring focus to the dropdown after having been closed, and it's quite difficult to figure out which of the two packages is causing the issues. I have found some workaround but this focus issue is a killer bug because I can't tell someone using a gamepad to grab a mouse in order to be able to use UI.

    The project I have submitted is very simple, there is a red cube that is inactive, by pressing the first button with Enter key, it will appear. With the old input system it works like a charm, with the new input system, I have to click the window first before I can activate it with enter.

    ETA: more precisely it is caused by the EventSystem, as soon as I add an EventSystem to the scene, whether with old or new input system the focus is not given on start.
     
    Last edited: Jan 26, 2022
    ShokWayve, g-t, garrettmmoore and 2 others like this.
  2. ShokWayve

    ShokWayve

    Joined:
    Jan 16, 2013
    Posts:
    136
    Greetings. Was this challenge ever resolved?

    Thanks.
     
  3. TomTheMan59

    TomTheMan59

    Joined:
    Mar 8, 2021
    Posts:
    355