Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Cambesa · Jul 10, 2018 at 04:37 PM · androiduser interfaceinputfieldcustomization

World space InputField not behaving user friendly on Android

I have a problem with input fields in world space. specifically in combination with Android. When I click in the input field to open the on-screen keyboard, it often closes instantly. When clicking the input field again it also sometimes shows the keyboard and then instantly close it again. and it pops up the buttons at the bottom of android that are used a home and back button etc.

Interactable is turned off and when you click the field, it is turned on, we are doing this to build support for both Android and GearVR. When tapping the screen(or the side button at the GearVR) it does a Raycast on a collision box which matches the size & location of the button/inputfield/dropdown, it triggers Select() and Invoke() on the buttons. In the case of an input field it triggers Select() and ActivateInputField() However if you're casually handling the mobile device it seems that the input field is losing focus and closes, even before your fingers move over to the keyboard to start typing. Only when handling the device extremely carefully, it works. Looking away still causes the input field to lose focus and close the keyboard. The only other Select() method is called when a raycast succesfully hits a button.

Does anyone know a solution for this problem? I would love it to be user friendly and simply staying open until you press done/ok on the on-screen keyboard. Can I disable the keyboard from closing when losing focus? Is there an other method or event to trigger when handling InputFields in order for it to work properly?

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

1 Reply

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

Answer by remy_rm · Jul 11, 2018 at 12:31 PM

you could make your own input type, using a button and a normal text component.

I made a little script that will open the touchscreen keyboard and update the textfield with whatever is typed on the keyboard.

     public Text nameField;
     public Text placeHolder;
     private bool openKeyBoard;
 
     public void OpenKeyBoard()
     {
         keyboard = TouchScreenKeyboard.Open(nameField.text);
     }
 
     private TouchScreenKeyboard keyboard;
     private void OnGUI()
     {
         if (!nameField.text.Equals(""))
         {
             placeHolder.enabled = false;
         }
         else
         {
             placeHolder.enabled = true;
         }
 
         if (keyboard != null)
         {
             nameField.text = keyboard.text;
         }
 
         if (keyboard.active == false)
         {
             openKeyBoard = false;
             keyboard = null;
         }
     }

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

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

Related Questions

If i have a script how to I input an int from there to a text UI? 1 Answer

Keep input field caret active when focused on mobile devices in addition to native input field caret 0 Answers

Send inputfield entries via email 2 Answers

Unity inputfield crashes android app after entering too many letters 1 Answer

Disabling the inputfield above the keyboard or disable it all 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