- Home /
Get TouchScreenKeyboard instance from when clicking InputField on Mobile
Ok so i'm trying to listen for Keyboard.done, so that the message the user typed will be sent immediately when the done button is pressed, bypassing the actual Submit Button. The thing is that i need an instance of TouchScreenKeyboard, which i have no clue how to get, because right now, the TouchScreenKeyboard is called by the InputField on user Tap/Click, and i simpli cannot figure out how to retrieve the TouchScreenKeyboard instance created by the InputField.
Does anybody have any tips regarding this issue?, i couldnt find anything online besides, listening on the Update hook for InputField.isFocused, and creating another, more controlled instance of TouchScreenKeyboard. The problem with this resolve is that it looks like something is glitching on the device, 2 keyboards showing up consecutively.
I am having the same issue. Have you been able to find a solution @fishbrainz ?
I open my own soft keyboard. I added a Panel over the inputField to prevent it from receiving mouse clicks, and added an EventTrigger OnClick event on that Panel to open my own controlled keyboard called $$anonymous$$obileSoft$$anonymous$$eyboard, and then pretty much i listen for $$anonymous$$obileSoft$$anonymous$$eyboard.done == true on the Update hook and set InputField.Text = $$anonymous$$obileSoft$$anonymous$$eyboard.text.
Now ofc you can scrap the inputfield altogether if you dont want to show the keyboard text on it or just use a normal textfield.
Answer by FeistyRodent · Jan 23, 2020 at 01:24 AM
It looks like TouchScreenKeyboard.Open() returns the instance if it is already open.
if(TouchScreenKeyboard.visible)
var keyboardInstance = TouchScreenKeyboard.Open(String.Empty);