Search Unity

Bug Player Input Auto-Switch breaks On-Screen Controls

Discussion in 'Input System' started by HellGate94, Jul 12, 2021.

  1. HellGate94

    HellGate94

    Joined:
    Sep 21, 2017
    Posts:
    132
    this has been an issue forever now and now that it is no longer in preview i expected it to be fixed.

    here a video of the issue:


    i guess things happen as follows:
    touch events get consumed by on-screen stick => sends gamepad input => player input switches to gamepad => touch event gets canceled since gamepad is now active

    am i simply configuring it wrong or how come this has not come up yet anywhere?
     
  2. dmytro_at_unity

    dmytro_at_unity

    Unity Technologies

    Joined:
    Feb 12, 2021
    Posts:
    212
    Would you mind please to file a bug (Help->Report a Bug) and we will have a look, thanks!

    I was recently fixing related issue to Keyboard.current going null related to On-Screen controls getting enabled/disabled, so likely there is a similar situation where on-screen control calls MakeCurrent and confuses Player Input.

    We probably need to rethink whole Device.current situation, it feels like a suboptimal approach, maybe Device.any would make more sense, e.g. Keyboard.any.spaceKey.wasPressedThisFrame would cover both physical keyboard and on-screen keyboard at a same time.
     
  3. HellGate94

    HellGate94

    Joined:
    Sep 21, 2017
    Posts:
    132
    bug is reported.

    yea not sure what the optimal solution to this is. i have not yet needed multiple input devices so not sure how any would work with that
     
  4. OmarOfMA

    OmarOfMA

    Joined:
    Sep 6, 2022
    Posts:
    13
    Hello @HellGate94
    Do you a link to the bug report?
    I seem to have the same issue or similar.
     
  5. gabagpereira

    gabagpereira

    Joined:
    Jan 21, 2019
    Posts:
    24
    Can't believe this is still an issue, almost 3 years later. What's the use of filing a bug report if a simple core feature that should work normally takes years and years to be tackled (if it ever gets to be taken care of).