Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by josif · Jun 21, 2010 at 06:04 AM · inputkey

what is enter for input

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

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Ricardo · Jun 21, 2010 at 09:00 AM 0
Share

You may want to edit your question to include the information you added as a comment on Ashkan's answer. People who might reply otherwise wouldn't have enough data on what you're looking for. While you're at it, edit it for clarity.

3 Replies

· Add your reply
  • Sort: 
avatar image
10

Answer by Matte Szklarz · Apr 27, 2011 at 05:06 PM

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)

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image M Poirot · May 17, 2011 at 06:04 PM 0
Share

Thanks! this is the comment I've been searching for

avatar image SinisterRainbow · Sep 16, 2013 at 01:26 AM 0
Share

It needs to be lowercase "return" btw. I couldn't type in 'Home' for example when trying to use the Home key, it had to be 'home'.

avatar image juanitogan · Dec 18, 2017 at 03:53 AM 0
Share

Same on the PC. "return" = Enter or $$anonymous$$eyCode.Return, "enter" = $$anonymous$$eyCode.$$anonymous$$eypadEnter, (and "[equals]" is not allowed even though the doc says it is [not that the PC has $$anonymous$$eypadEquals]). Unity could document all this better.

avatar image
7

Answer by Ashkan_gc · Jun 21, 2010 at 06:37 AM

"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"); 
Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image josif · Jun 21, 2010 at 07:39 AM 0
Share

that's not what i meant i meant what do i type in Input were its say's positive Button like what would i type to make the enter button to be activated

avatar image Stefan02 · Sep 05, 2014 at 06:36 PM 0
Share

Thanks man;)

avatar image
0

Answer by demented_hedgehog · Mar 31, 2015 at 03:07 AM

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).

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Rigid Body Wait 1 Answer

GUI texture touch to input 1 Answer

How to alter input to continuous rather than tap? 0 Answers

Using Xbox gamepad triggers as keys instead of axis? 1 Answer

How to alter input to continuous rather than tap? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges