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

Question When rebinding using PerformInteractiveRebinding it doesn't recognise Insert, Delete, Home, End, etc

Discussion in 'Input System' started by Stephen1701, Mar 2, 2023.

  1. Stephen1701

    Stephen1701

    Joined:
    Mar 29, 2016
    Posts:
    132
    Hi all,

    When rebinding using PerformInteractiveRebinding it doesn't recognise the following keyboard keys - Insert, Delete, Home, End, Page up, Page down. Does anybody know why and how to fix this?

    Thanks
     
  2. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,375
    The reason PerformInteractiveRebinding doesn't recognize some keyboard keys such as Insert, Delete, Home, End, Page up, Page down is because these keys are not part of the KeyCode enumeration in Unity. Instead, they are represented by special KeyCode values such as KeyCode.Insert, KeyCode.Delete, KeyCode.Home, KeyCode.End, KeyCode.PageUp, and KeyCode.PageDown.

    To handle these keys in PerformInteractiveRebinding, you need to create a custom input action with bindings for these special KeyCode values.
     
    Stephen1701 likes this.
  3. Stephen1701

    Stephen1701

    Joined:
    Mar 29, 2016
    Posts:
    132
    Thanks for the information, much appreciated.
    I'll look into it and see what I can do.

    Although in all honesty, I probably won't bother. I'm getting tired of wrestling with the input system, so I'll just not allow those keys to be rebound.
     
    Last edited: Mar 3, 2023
    dogmachris likes this.