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

InputAction.GetBindingDisplayString returns different names for the same binding

Discussion in 'Input System' started by BorjaFAC90, Aug 12, 2020.

  1. BorjaFAC90

    BorjaFAC90

    Joined:
    Jul 21, 2020
    Posts:
    8
    I am working on a rebinding inputs feature for my project and I am using the RebindActionUI that comes with the Input System sample projects, and I am having a small issue:

    When the gamepad scheme gets activated, the name that I receive from an action of a type Value and a control type Axis, with the binding Scroll/Y [Mouse] and with path <Mouse>/scroll/y, it's different than with the keyboard scheme. With gamepad, the name is Scroll/Y and with keyboard, the name is Scroll Wheel.

    Is this kind of a bug or an intented (and strange IMHO) behaviour?

    edit: happens also with some gamepad button names, for example if the name contains a slash (for example RS/up), with the gamepad scheme the slash goes away, and with the keyboard it comes again...

    edit2: another question, what would happen with non latin keyboard layouts? Would work the binding thing (and also the key name)?

    edit3: another doubt that comes up now, is there a way to block any key from being binded? For example if I don't want any input to be the Escape button. I am looking through the API but can't find out a way to do that

    Thanks!
     
    Last edited: Aug 12, 2020
  2. BorjaFAC90

    BorjaFAC90

    Joined:
    Jul 21, 2020
    Posts:
    8
    For the blocking key thing, I just found out that I can use the WithControlsExcluding with a path to the binding, but here comes in the edit2 question, what happens with a different language keyboard?

    Also, if I exclude the Escape, and I try to use it on a rebinding, what actually does is to set "Any Key", any way to just cancel the rebinding? (for more info, I am getting the OnComplete callback called after trying to set an excluded binding, instead of the OnCancel)
     
    Last edited: Aug 12, 2020