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
0
Question by cjrichards · Sep 25, 2012 at 08:04 PM · inputkeyboardflash

Issues with keyboard input in Flash build

I am having issues with reading keyboard input in Unity3d's Flash export. I am using the following code to listen for input (for the "a" key):

 if (Input.GetKeyDown(KeyCode.A)) key="a";

This method works just fine for getting letters A-Z, 0-9, shift, enter, space, and backspace. However, this method doesn't seem to detect any other keys--"KeyCode.Period", Comma, Slash, Minus, Quote, etc. I've also tried using the following code to listen for keys:

 if (Event.current.keyCode==KeyCode.Period) key=".";

Though this method works fine inside Unity3d, it doesn't detect any key-presses at all in the Flash player. Is there any way to detect these other keys in the Flash player? The "Input.anyKeyDown" function returns true for all keyboard input INCLUDING period, comma, quote, and so on, so I know that the Flash player is catching the input, but I can't figure out which KeyCodes are being used so that I can return the appropriate string for each keycode.

Additional Info: I've tried creating a key listener in AS3, but it seems that attaching this listener (by extending the MovieClip class) breaks things--all input is ignored and I get null values. I don't have much experience with AS3, so there's a good chance I could be implementing it incorrectly. If anyone has had success with an AS3 key listener, some tips would be greatly appreciated.

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by cjrichards · Sep 25, 2012 at 10:40 PM

Well, I've refined my search a bit, and I have found a couple answers and forum posts stating that text input is simply not fully supported yet in the Flash export. I am marking this question as answered, but I am still interested in using an AS3 key listener within the Flash export if anyone knows how.

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
avatar image
0

Answer by RalphH · Oct 04, 2012 at 10:42 AM

This us fixed in Flash for 4.0. Do note that we will not support or update the Flash preview on 3.5.

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

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Checking whether string is a valid Input.Key 1 Answer

Android Keyboard .text String returning empty? 1 Answer

How do you run a Unity game in headless mode but also maintain keyboard input functions? 0 Answers

How to prevent input lag/delay? 1 Answer

setting iPhoneKeyboard.text (or any workaround about resetting user input) in Android. 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