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. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Resolved While Rebinding, how to awoid existing keys that used in other action maps?

Discussion in 'Input System' started by kei233, Oct 27, 2021.

  1. kei233

    kei233

    Joined:
    Dec 16, 2019
    Posts:
    47
    e.g. I would like to use "b" for bag, "C" for character... all these are in one Action Map "InterfaceMap".
    Another map for skills hotkeys, like 1,2,3... , as "skillMap"
    While rebinding skills, how to awoid all keys in "InterfaceMap"?
     
  2. dmytro_at_unity

    dmytro_at_unity

    Unity Technologies

    Joined:
    Feb 12, 2021
    Posts:
    212
    You could check current rebound key and show a warning to the user if there are any conflicts. Similar how you set shortcuts in some apps and they warn you if shortcut was already used.
     
  3. kei233

    kei233

    Joined:
    Dec 16, 2019
    Posts:
    47
    Then, is there any API for checking conflicts. Or I can only foreach antions foreach bindings to compare with the new binding overwrite path.
     
  4. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,688
    You can use the FindBinding method. If it returns -1 there is no duplicate.
     
  5. kei233

    kei233

    Joined:
    Dec 16, 2019
    Posts:
    47
    cool, thanks