Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 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
2
Question by chatpongs · Nov 25, 2015 at 02:29 PM · androidkeyboard input

Cannot hide keyboard on Android InputField

I am developing a chat app with Unity using uGUI. There is an InputField for the user to type in. The expected behaviour is

  • If the user presses OK or check mark button on the keyboard (I am using Google keyboard), send the message

  • If the user tap outside the keyboard, hide the keyboard

But both actions result to the same event which is End Edit. Is there anyway to differentiate these two actions.

Comment
Add comment · Show 3
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 chatpongs · Dec 14, 2015 at 08:50 AM 0
Share

Anyone has any idea?

avatar image supernat · Dec 18, 2015 at 05:07 AM 0
Share

Perhaps you could use the InputEdit.onValueChanged event ins$$anonymous$$d. But if you have a use case where they could click the edit field, not change anything, and hit O$$anonymous$$ (to say use a default value), then that wouldn't work. $$anonymous$$aybe InputEdit.wasCanceled could be tested ins$$anonymous$$d, but I don't know what will cause that flag to be set. You might also be able to override the $$anonymous$$eyPressed() method to set a flag indicating if the $$anonymous$$eyCode.Return or $$anonymous$$eyCode.Tab keys were pressed.

avatar image chatpongs supernat · Dec 18, 2015 at 09:21 AM 0
Share

@Supernat Thank you very much for your suggestion. However, looking into InputField code here

https://bitbucket.org/Unity-Technologies/ui/src/0155c39e05ca5d7dcc97d9974256ef83bc122586/UnityEngine.UI/UI/Core/InputField.cs?at=5.2&fileviewer=file-view-default

This class relies on TouchScreen$$anonymous$$eyboard to handle the input. TouchScreen$$anonymous$$eyboard doesn't tell us much about what is happening, just only when the user is done with the keyboard (tapping okay or outside are translated to 'done'). I don't know when wasCanceled is set either, and $$anonymous$$eyPressed() seems to work only on desktop platforms

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Galaxy S6 touchscreen keyboard doesn't work 0 Answers

simulate pc keyboard input in android touch screen keyboard 0 Answers

[solved] If TouchScreenKeyboard.hideInput=true, non-ASCII letters aren't registered - why? Work-around? 1 Answer

How to keep opening of keyboard when focus transferred to another input field by programmatically.? 0 Answers

Hide Input always false 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