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

Question Who is this "Cancel [Any]" ?

Discussion in 'Input System' started by equal, Mar 28, 2023.

  1. equal


    Dec 14, 2012

    i am converting to the new input system of Unity.
    I thought this would be straight forward but im facing a problem. Here i have the current InputMap


    This is crystal clear. I have a UI Map -> Click Action -> Left Button (on Mouse)

    And here we have "Cancel [Any]", what does this mean?
    This currently would mean UI Map -> Cancel Action -> Cancel [on Anything]
    But i dont have a Cancel Key on the Keyboard.

    My intuition tells me that this is most likly the Escape Button on the Keyboard, nothing on the Mouse and "B" on the Snes Controller, is this correct?

    My concrete questions:

    What is "Cancel [Any]" on "Any" of those devices ?

    How would i allow the User to remap input like "Cancel [Any]" ?

    Here is the scenario where i would like to replace the Input.GetKeyDown with an "Escape" Action -> caused by "Escape"-button on [Keyboard]
    Code (CSharp):
    1.   if (Input.GetKeyDown(KeyCode.Escape) && !isDragging)
    2.         {
    3.             EscapeMenuOnce();
    4.             GameManager.Inst.PlayerInfo.DebuggingMode = DebuggingMode.NONE;
    5.         }
    Is the ambigious "Cancel [Any]" the proper ActionButton what i am looking for?
    Any help is welcome!

    Attached Files: