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
1
Question by Sirellyn · Jul 29, 2012 at 04:53 AM · androidguiinputtextfield

Android Textfield locks out input until esc

I'm using GUI.Textfield, or GUILayout.Textfield, on Android build Unity 3.5

On Android:

  1. Go to enter something in the textfield by tapping on it.

  2. You MUST be in Portrait viewing, screen is longer top to bottom than left to right

  3. It will bring up the virtual keyboard. No problems.

  4. Instead of entering something, tap on the top part of the screen where the preview of the previous screen is. You'll go back to the previous screen.

  5. Now if you try to tap on any textfield, no virtual keyboard will pop up.

This persists until you hit the back button which simulates the ESC key.

There seems to be no way in unity to fire input events through script. Otherwise I would just simulate a escape hit myself.

2nd Minor Issue: In the same vein, I'd like to make a button, which when pressed would act as if the user tapped on a textfield (on another part of the screen.) As a reminder before the user can go forward.
EDIT: 2nd Issue can be solved with TouchKeyboard.open as suggested below.

Again this would be solved if you could simulate touches or input.

Any help is 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
1

Answer by Seth-Bergman · Jul 29, 2012 at 06:29 AM

try : TouchScreenKeyboard.Open;

http://docs.unity3d.com/Documentation/ScriptReference/TouchScreenKeyboard.Open.html

http://docs.unity3d.com/Documentation/ScriptReference/TouchScreenKeyboard.html

Comment
Add comment · Show 1 · 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 Sirellyn · Jul 29, 2012 at 09:06 PM 0
Share

2nd Part of the problem solved (popup keyboard when pressing button) but the original issue isn't.

None of TouchScreen$$anonymous$$eyboard variables change when you click on the preview screen, the keyboard disappears, and all the TouchScreen$$anonymous$$eyboard variables stay the same (active, done, hideinput, visible, area, done) It's still listed as visible, save the keyboard isn't there.

I have no way of knowing if the keyboard is supposed to be there or not. I even tried "If active, setting it to active continuously". As expected didn't work either.

avatar image
0

Answer by Sirellyn · Jul 29, 2012 at 10:38 PM

Here's the workaround I found. It's not great, but it least it handles the issue:

At the bottom of you OnGui() function just insert the following:

 if (TouchScreenKeyboard.visible) {
    if (GUI.Button(new Rect(0,0,Screen.width,Screen.height), "", skin.GetStyle("/*Insert style thats completely transparent here*/"))) {
       keyboard.active = false;
    }
 }

Remember to declare TouchScreenKeyboard keyboard = new TouchScreenKeyboard(); at the top of your class.

So you just create a huge invisible button that overtakes the screen. When you tap on it, it will clear the keyboard. (if it's active). Most users will tap again if an input didn't work without thinking twice about it.

Again not elegant, but it works.

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

6 People are following this question.

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

Related Questions

Please confirm: Galaxy Stylus not readable directly in Unity 1 Answer

Rotate NGUI Element with Touch Moves 0 Answers

Textfield on Android problem 2 Answers

Touch Input with Event Trigger. How to handle with it properly. 0 Answers

Get key state while textfield has focus? 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