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
0
Question by H0RST · Jan 27, 2017 at 06:29 PM · webglinputfield

Confused input field with captureAllKeyboardInput and OnValidateInput() in WebGL

I have two strange behaviours using the Unity input field in WebGL.

1) Input field and OnValidateInput() I have an input field defined as content type 'decimal number'. That works fine so far. Now I want to prevent the input of a minus sign. Therefore I added an OnValidateInput() custom callback. But from now on, it is also possible to enter letters into the input field. The check for decimal number input seems to be ignored now.

Is this the expected behaviour? I know how to implement a user defined check for decimal numbers, this is not my problem.

2) Input field in WebGL and captureAllKeyboardInput I have an input field inside a canvas and also a HTML input field. To be able to get input for the HTML input field I have to set captureAllKeyboardInput = false. After setting captureAllKeyboardInput back to true, user input in the Unity input field is repeated. E.g. the user enters "1" but the input field receives "11". After the next toggle to false and back to true the input field receives "111" and so on...

If I never change captureAllKeyboardInput, everything works fine. But each switch to false and back to true seems to confuse the input field.

To solve this behaviour, I added an OnValidateInput() custom callback. In this callback I remove input which is received inside a defined time interval (e.g. 100 ms).

Thanks for any hint.

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 wbl1 · Aug 13, 2018 at 08:27 PM 0
Share

Hey, I am having the same problem and put questions on the forum and answers. In the meantime, would you please share your custom OnValidateInput() callback?

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

6 People are following this question.

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

Related Questions

WebGL build Japanese IME 0 Answers

WEBGL input field on Android and iOS 0 Answers

InputField doesn't recognize Space character (using WebGL) 1 Answer

webgl project can't build succeed 0 Answers

WebGL build shows black screen 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