- Home /
Input.inputString on iOS - Empty?
Hi there,
I've been messing around with Unity for a mobile game, and I have need to capture individual keystrokes from the user on either a physical keyboard (Android) or touchscreen keyboard (iOS/Android). I've managed to capture input, including backspaces on Android (and desktop) by reading Input.inputString.
However, on iOS, it seems that Input.inputString is not being populated. The only way I've been able to read input from the keyboard has been from TouchScreenKeyboard.text. This isn't ideal, as I don't get individual keystrokes, but instead, get the entire string that has been typed for that instance of the keyboard at all times.
Should Input.inputString be populated on iOS (i.e. is this a bug?), or is there another way for me to capture individual keystrokes? Please keep in mind there are input methods (Chinese, for example) which takes a few latin characters to type, after which gets replaced by a chinese character (pin yin input).
The reason I need to be able to act on each individual key (or character submitted) is that I need to do processing on each character submitted and decide on whether to "do something" or not. I don't need them to press ENTER.
Any ideas/feedback appreciated. Thanks!
I can't use Input.inputString on Android (at least on my Galaxy Note II) either.
I would also consider it a bug, but I don't expect it to ever be fixed. TouchScreen$$anonymous$$eyboard.text is the only way to go (I was first considering just making my own damn onscreen keyboard...)
Your answer
Follow this Question
Related Questions
Cells for a mobile app stacked vertically, not moving correctly 0 Answers
How to simulate a keypress in an onclick button on mobile(android/ios)??? 1 Answer
Make the iOS mobile keyboard input area take up the full screen 1 Answer
Create custom mobile keyboard in Unity? 1 Answer
how do i open email keyboard when using input field on mobile? 1 Answer