Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 bmakloski · Aug 01, 2018 at 03:40 PM · scripting problemeditorkeyboardtouchscreen

Touch Screen Keyboard Test in Editor

I am building for a tablet with a touchscreen (HP Pro X2, to be specific) and I need my input fields to pop up a touchscreen keyboard when the user clicks on these fields. So right now, I'm doing it in my update function and it looks like:

  if(Initials.GetComponent<InputField>().isFocused)
         {
             keyboard = TouchScreenKeyboard.Open("", TouchScreenKeyboardType.Default);
             if(keyboard.active == true)
             {
                 Debug.Log("It would be open");
             }
             else if (keyboard.active == false)
             {
                 Debug.Log("It would not be open");
             }
         }

It returns that "It would not be open" and I'm not sure exactly why. Am I using the touchscreen incorrectly? Or is there no way for me to accurately test in my editor on PC? I saw the other post that was similar to this one and they used something out of System.Diagnostics, but that it was unreliable and this needs to be reliable.

Anything helps!

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

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Bubinga_Studios · Aug 01, 2018 at 04:00 PM

Input Fields should automatically pop up a touchscreen keyboard. I think if you are trying to create a touchscreen keyboard, you should just use the Input Field UI object. (You can find it by Right Click on Hierarchy > UI > Input Field) This works both on computer and on all mobile platforms. You can see when it has been edited or finished editing (clicked done button or exited input field) but I am not 100% sure on how to see when it is opened up.


If I didn't answer your question correctly, or you do not want to use this method, let me know by sending me more details. Hope this helps!

Comment
Add comment · Show 4 · 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 bmakloski · Aug 01, 2018 at 04:21 PM 0
Share

Hey there, thanks for the quick reply! Yeah so I already have the input field on there and actually built a phase 1 demo for the target platform. And using the touchscreen for tapping buttons and whatnot worked fine. But if you tapped on an input field, no keyboard popped up. So I was assu$$anonymous$$g that this was something that I was going to have to address with code. But now that I think about it, the tablet has a little protective case that has a keyboard on it, so is it possible that having that external keyboard in the case would override the touchscreen keyboard? Hope that better explains the issue

avatar image bmakloski · Aug 01, 2018 at 04:31 PM 0
Share

Part of the issue is that my target platform (this is part of an internship) is this HP Pro X2 which runs Windows 10 (or at least a version of it) on this tablet/computer hybrid. I went back and made sure the touchscreen on the device was enabled, works for going on the internet and whatnot, but still doesn't work in the Unity app. So it IS an issue that I will need to address

avatar image Bubinga_Studios bmakloski · Aug 01, 2018 at 05:30 PM 0
Share

Oh I see! I am not too familiar with the HP Pro X2. I did see that, but I am not sure on it's functionalities. I am used to Apple and Android. If it has an external keyboard, it will probbably override it. Does the HP Pro X2 include a built in touchpad? And if so, does Unity support this? If it doesn't, you can build a touchscreen keyboard for it. If you need help, I can search more into it. Sorry for not understanding at first haha. Hope your issue is resolved!

avatar image bmakloski Bubinga_Studios · Aug 01, 2018 at 05:48 PM 0
Share

Yeah so like I was saying the HP does have a touchscreen included and you can use it for surfing the web and other things. But when I try to click on the input field on the tablet, nothing happens. It actually puts a cursor in the input field like its ready to receive text, but I obviously have nothing to input with. How would I go about building a touchscreen and what kind of impact would that have on functionality and speed?

avatar image
0

Answer by Jewelry_shun · Sep 20, 2021 at 11:50 AM

Hello can you help me to, i creating an typing game and i want the keyboard to show even without an input field is it possible?,Hello, can you help me to, i creating at typing game and i want the keyboard show even without an input field, is it possible to pop up?

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 Dalton-Lima · Jan 03 at 06:13 PM

For posterity.

Without testing, but according to the documentation on MobileKeyboard you should also check TouchScreenKeyboard.visible inside a Coroutine loop because you need to give a few frames in order for the keyboard to scroll up on the screen and be ready to go.


  • TouchScreenKeyboard.Open() is called. TouchScreenKeyboard.active returns true. TouchScreenKeyboard.visible returns false. TouchScreenKeyboard.area returns (0, 0, 0, 0).

  • Keyboard slides out into the screen. All properties remain the same.

  • Keyboard stops sliding. TouchScreenKeyboard.active returns true. TouchScreenKeyboard.visible returns true. TouchScreenKeyboard.area returns real position and size of the keyboard.

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

182 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

Related Questions

ReImport in c# of GameObjects only for Scene Objects, not assets? 1 Answer

how to make a level editor in shooting game? 1 Answer

Build problem 1 Answer

When switching scenes some of my scripts stop working 0 Answers

Unity not compiling script changes 2 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