How to get user selected key code for input

I have an Input axis called “Action” & it is assigned to keyboard E. When a player nears a pickup object, a message is displayed on screen saying “Hold E to pickup …”.

Now, what I want to know, is if the user changes the Action key to say F, that the script will now say “Hold F to pickup…” when they near a pickup object. That is displaying the keyboard code associated with the input axis.

Ex. guiText.text = “Press " + Input.GetAxis(“Action”).keyCode + " to pickup”;

I looked over the Input class documentation & tried doing some toString on some of them but nothing has worked. How would I go about doing this, is it even possible ?

Thanks
Mike

Unfortunately it’s not possible. http://feedback.unity3d.com/forums/15792-unity/suggestions/175032-scripting-expose-input-manager-settings (As a side note, you should be using GetButton for that, rather than GetAxis.)

If it’s not possible, then you might want to set up a script that determines what text to display depending on which button set up they have.

@Alien595 if you were truely a smart cookie you would decide to use key codes and set it all up so the player changes key bindings via in game menus and just drop the resolution dialogue all-together. This is what I’ve always done and it always works.