Search Unity

What does "Submit" map to? And can it be changed?

Discussion in 'Input System' started by CDF, Jan 22, 2021.

  1. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,311
  2. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    The InputSystemUIModule links to the actions from which it sources input.

    upload_2021-1-29_18-21-30.png

    By default, that's the DefaultInputActions.inputactions asset that comes with the package.

    You can link to your own customized version of the asset and customize the bindings of the Submit action.

    upload_2021-1-29_18-23-28.png
     
  3. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,311
    Sorry I was referring to the "Submit [Any]" binding.
    How is that determined?

    I know just from experience it's "Enter" on keyboards, "ButtonSouth" on gamepad etc.
    But how does the Input system know that? Where does "Submit [Any]" determine that it's the Enter key on desktop and some other key on controller?

    What for example, would "Submit [Any]" map to on a Racing Wheel, or some other device?

    Same could be said for "Cancel [Any]", why does cancel map to the "B" button on controller and "Esc" on keyboard? And is it possible to change that binding?

    Is this something the OS tells you? or is the mapping kinda hidden away in the native low level side?
     
  4. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,311
    Bumpin for the sweet sweet knowledge

    any.png

    I'd like to know what all these "Any" bindings map to on different devices.
    What exactly is "Menu [Any]" on keyboard? or "SecondaryAction [Any]" on a gampad/tv remote?

    is there just an "Any [Any]" binding?

    so many questions, so little time.
     
  5. Aristonaut

    Aristonaut

    Joined:
    May 4, 2019
    Posts:
    15
    After scouring the code, it looks like keyboard has the following usage tags:

    {Submit} -> Enter
    {Cancel} -> Escape
    {Back} -> Escape

    I could be looking at the wrong thing, not sure, but to find them I:
    1. Find the state layout in question (e.g. https://github.com/Unity-Technologi...y.inputsystem/InputSystem/Devices/Keyboard.cs )
    2. Search for "usage" and "usages" to find the InputControlAttributes that are assigned the usage in question. You can also maybe search for the usage in quotes, if needed. (e.g. Searching for "Submit" or "Cancel" with quotes around them.)

    If anyone knows an easier way to find these than scouring the code, that would be helpful.
     
    Perocket likes this.
  6. simonpushelberg

    simonpushelberg

    Joined:
    Dec 7, 2019
    Posts:
    3
    Can we get another answer on this? Can you remap the Enter key as UI / Submit to something else? I would like Space key to do UI / Submit and dont know how to do that.
     
  7. Fep310

    Fep310

    Joined:
    Apr 30, 2018
    Posts:
    10
    In this case you could just remove the Submit [Any] binding and replace it with the Space [Keyboard] binding.