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

Ui input module conflicting with similar binded keys from another action map?

Discussion in 'Input System' started by JFR, Sep 15, 2022.

  1. JFR

    JFR

    Joined:
    Feb 21, 2014
    Posts:
    65
    Hiya all,

    I have been hammering on this problem for the afternoon and haven't found a solution yet: if I press the binded A keyboard key on an Action I have made in a test Action map I have made, the A button action doesn't get called. If I bind this action to another key, like 'I', it works.

    I wasn't able to figure out what was wrong until I deactivated the Ui input module inside the canvas. Then it worked. So my guess is there is some sort of conflict of keys going on. I have noticed that the Ui Action map is generating events all the time, regardless of what Action map is selected, which I guess is intended behavior. And also, the 'A' key is binded to forward inside the UI Action map.

    So I am guessing the A key is in conflict because both the Ui Action map and the Test Action map are active.

    Basically, I have an input manager that has a PlayerInput component that contains a reference to the Ui Input module (along with the EventSystem component) and has its default map to the Test Action Map in question.

    Based on these observations, I am wondering the following:
    • Is this a conflict, and if so, is there a way to detect it through code, so I can inform the player of those restrictions?
    • Is this a bug in the input system?
    • Or maybe a bad setup on my part?
    Thanks for any help on this,
    - Jeff
     
  2. JFR

    JFR

    Joined:
    Feb 21, 2014
    Posts:
    65
    Ok thanks for the link. I still think it would be better to receive both events since I will need to write code for when the Ui gets the focus so I can toggle the ui action map on and off, so my on screen buttons can receive events. A bit overkill if you ask me, and I can see a couple of overlapping cases where this can lead to problems. Hopefully this gets fixed.
     
  3. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    700
    In the EventSystem you can disable some kind of events like UI/Navigation under Move, but you can also replace the ActionMap with one of your own.