hi i what to no what i would put to make the enter button work
what i mean is that when i type in Input were its say's positive Button, like what would i type to make the enter button to be activated
im sorry i cant enplane it better
hi i what to no what i would put to make the enter button work
what i mean is that when i type in Input were its say's positive Button, like what would i type to make the enter button to be activated
im sorry i cant enplane it better
Ashkan's answer doesn't have the full details.
"enter" and "return" aren't the same button. If you're like me, working on a MacbookPro, you have a enter/return key, which was the root of my frustration for a good 20 mins.
GetKeyDown("enter") refers to the numpad's "enter" key, and will not work with my keyboard.
In order to use a MacbookPro "enter/return", you need to specify RETURN: you can do this by either :
Input.GetKeyDown("return") Input.GetKeyDown(KeyCode.Return)
"return" or "enter".
if (Input.GetKeyDown("enter"))
{
//do something
}
take a look at input page in manual
documentation says
Normal keys: "a", "b", "c" ... Number keys: "1", "2", "3", ... Arrow keys: "up", "down", "left", "right" Keypad keys: "1", "[2]", "[3]", "[+]", "[equals]" Modifier keys: "right shift", "left shift", "right ctrl", "left ctrl", "right alt", "left alt", "right cmd", "left cmd" Mouse Buttons: "mouse 0", "mouse 1", "mouse 2", ... Joystick Buttons (from any joystick): "joystick button 0", "joystick button 1", "joystick button 2", ... Joystick Buttons (from a specific joystick): "joystick 0 button 0", "joystick 0 button 1", "joystick 1 button 0", ... Special keys: "backspace", "tab", "return", "escape", "space", "delete", "enter", "insert", "home", "end", "page up", "page down" Function keys: "f1", "f2", "f3", ... The names used to identify the keys are the same in the scripting interface and the Inspector.
value = Input.GetKey ("a");
If, as it is suggested here, enter and return are different key inputs then you can use the Unity Input menu with positive button and the alt positive button (i.e. two keys for the one command) and then use the GetButton() call to determine its state. Doing this should make key customization for the user easier later on. (I believe).