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 have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Getting a list of named Input buttons from the Input Manager

Discussion in 'Scripting' started by HankySpanky, Apr 13, 2016.

  1. HankySpanky

    HankySpanky

    Joined:
    Feb 3, 2015
    Posts:
    77
    I've been looking around for a little while, and I can't find anything close to this. Either I'm looking in the wrong places or my queries aren't descriptive enough.

    But, this is surely possible right? Getting all the named Input keys from the input manager? Like a list or an array of all button names.

    I want to be able to display all the named buttons in a popup field in a custom inspector. To be able to quickly map a button to certain functionality.
    Right now I'm using a text field, which means that if I change the name of the binding in the input manager, I have to find the script that uses it and change it accordingly. Plus, it's a bit of a pain to manage given all the small subsystems I'm pulling into my main project that use key bindings and need to work right out of the box.
     
  2. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
  3. HankySpanky

    HankySpanky

    Joined:
    Feb 3, 2015
    Posts:
    77
    Wow, that sounds great.

    Though it's not really something that I'd be able to squeeze into what I'm doing right now.

    If anything, it would serve as a great next step, with the solution I'm looking towards now as the bridge. i.e., listing out all the button names. It's far simpler to add that right now.
     
  4. doomtrinity

    doomtrinity

    Joined:
    Mar 11, 2016
    Posts:
    26