Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Feedback Binding mask is too limited

Discussion in 'Input System' started by OndrejP, Apr 5, 2022.

  1. OndrejP

    OndrejP

    Joined:
    Jul 19, 2017
    Posts:
    307
    Binding mask feature are very limited.
    The only useful usage is masking by
    group
    .

    Masking by
    action
    is nice, but not very useful, because you can enable / disable individual actions outside.

    Masking by
    path
    is totally useless, because it does not support wildcards (not even talking about generalization). It does not seem take into account effective path, only original path (which might or might not be what you want).

    Lets say I want to disable Mouse for specific ActionMap, how am I supposed to do that?
    It seems that I have to create separate scheme for Mouse and disable that...but that breaks Rebinding, which only supports SINGLE group. I'd prefer single scheme for Mouse and Keyboard.

    This is not some edge case, this is normal usage of input like in other games (PUBG, Elden Ring)
    You open inventory, gameplay mouse input gets disabled, while gameplay keyboard input is still active (you can run around).

    At least the masks could support negation (allowing bindings which does not match the mask)

    EDIT:
    It seems that there's
    InputActionMap.devices
    , which does what I want.
    I have to update that when detected devices change, but at least it seems to work.
     
    Last edited: Apr 5, 2022
  2. OndrejP

    OndrejP

    Joined:
    Jul 19, 2017
    Posts:
    307
    Instead of limited binding mask, I'd expect some delegate, which could be assigned as filter (to asset, action map and action) and do whatever logic and combination of
    group
    ,
    path
    ,
    device
    ,
    action
    or other parameters I need.

    Delegate would be invoked for each binding and would have access to binding and action (which has references to actionMap and asset).

    I would be able to implement negation logic easily and it could be much faster, because I could use for example GUID lookups instead of PARSING and comparing strings!