- Home /
GetButtonDown: How does this work?
ok, i want to detect a particular key. Right now, left alt. I know that i can define keys through the input menu, although exactly how eludes me
Where in this image do i define the alt key?
And also, what exactly do i type? It doesn't seem to be dynamically capturing inputs, i have to actually type in a button there. Will "alt" work? or is this case sensitive and might require "Alt" ?
To be clear, alt is an example. Please don't JUST tell me how to do alt. I need to know how to do any button. The only logical solution i can see is a master list somewhere, of all the mappable keys and their names. Is there such a list?
Answer by Josh707 · May 15, 2015 at 10:44 PM
Manual explaining what each field is for: http://docs.unity3d.com/Manual/class-InputManager.html
List of button names (scroll down): http://docs.unity3d.com/Manual/ConventionalGameInput.html
When using Input.GetButton methods, they will return true if the keys set in either Positive or Negative Button are pressed, as well as the Alt versions. So you can essentially have 4 keys bound to one action.
When using Input.GetAxis, the returned value will move between -1 and 1 depending on the use of the Positive and Negative buttons.