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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by siveco.danielbi · Sep 19, 2013 at 08:11 AM · androidiphonetouchscreentextareatouchscreenkeyboard

TouchScreenKeyboard not working with GUI.TextArea (tested with Android tablet)

I am trying to make a Gui.TextArea to receive the input from my Android tablet. I need the user to be able to edit the text from the textarea.

void Start () { TouchScreenKeyboard.hideInput = true;

         keyboard = new TouchScreenKeyboard("", TouchScreenKeyboardType.NumberPad, false, true, false, false, "");
         keyboard.active = false;
 }
 
 void OnGUI(){
 if (GUI.Button(new Rect(0, 280, 150, 40), "Show kyeboard")){
 keyboard.active = true;
 TouchScreenKeyboard.Open(keyboard.text, TouchScreenKeyboardType.NumberPad, true, false);
   }
 
 if (GUI.Button(new Rect(200, 280, 150, 40), "Hide kyeboard")){
 keyboard.active = false;
 } 
 // I create a box and the textarea
   Rect texareaLocation = new Rect(10, 10, 200, 200);
   Rect boxLocation = new Rect(texareaLocation.x - 2, texareaLocation.y - 2, texareaLocation.width + 4, texareaLocation.height + 4);
   GUI.Box(boxLocation, "");
 
    keyboard.text= GUI.TextArea(texareaLocation, keyboard.text, fontStyle);
 }


This code is working on my PC (I can write, edit, select text into the textArea) When I deploy on my Android tablet the following are happening: I can write and delete text only from the end of the string (I cannot move the cursor - at the beginning or before a word I entered ... ) I cannot select the text from the textArea

For example if I am trying to move focus on other control after a certain text is entered I cannot do that on Android. like this:

 if (keyboard.text != null && keyboard.text.Length >= 1)
         {
             GUI.FocusControl("textarea2");  // the focus is not changing
         } 

Also the Event.current.keyCode is not detected when typing from Touch Screen Keyboard

Can you please help? What I am doing wrong? I don't understand how this touch TouchScreenKeyboard is working when: TouchScreenKeyboard.hideInput = true;

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 lijohn · Jul 23, 2015 at 11:28 AM 0
Share

sounds similar to my problem. i'm on iOS, and my keyboard won't even show up.

0 Replies

· Add your reply
  • Sort: 

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

16 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

Related Questions

How to save text and display using Touch Screen Keyboard 1 Answer

What is the command to check whether player is touching the screen or not?? 1 Answer

How can I tell if the device I am on supports touch? 4 Answers

Moving object to position of finger at screen 1 Answer

how to convert Input.mousePosition into iphone/android accelerometer? 1 Answer


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