Checking if player is typing in an InputField
Hi!
I only really post here if I'm really desperate (spoiler alert - I am)
I'll get straight to the point - I'm using a lot of "Input.GetButton" things but I want them to be ignored if the player is typing in an InputField
I don't know much about the new UI, I tried fiddling with the "IsHighlighted" thingy, the EventSystem's "currentSelected" but I didn't accomplish much. I want to ask if there's an easy way to know if the player's typing in an InputField.
Thanks in advance :D
Answer by DigitalCyclone · Nov 11, 2016 at 10:40 PM
Hello! This might be a bit late, but there is something called Inputfield.isFocused, which should help you.
Answer by saraalhu · Apr 02, 2017 at 10:07 AM
you can use void Update() { if(inputField.isFocused && Input.anyKeyDown) { Debug.LogError("hey is typing"); } }
Your answer
![](https://koobas.hobune.stream/wayback/20220612034424im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Destroy something onSubmit of InputField. 1 Answer
How to limit the max and minimum number in a input field. 1 Answer
Input field keyboard not showing up after building it on android 0 Answers
How to create a scrollable inputfield using new UI 1 Answer
Is there anyway to make an input field stretch to fit a body of text? 0 Answers