Text mesh pro input select closing keyboard
Hi, I'm trying to implement an SMS verification screen with 4 different inputs (didn't find any better solution)
here are the inputs: 
I'm using text mesh pro input field with content type numeric and trying to make that when a user types a number in input1 it automatically focus input2 and when you type a num in input2 it will automatically focus input 3 etc...
When the user deletes it will do the same but from input4 to input3...
I have two problems:
sometimes when focusing on the next input the keyboard closes
I cannot detect when the delete key is pressed
Input.GetKeyUp(KeyCode.Delete)doesn't work
Here is my code:
public void Start()
{
// Adds a listener to the main input field and invokes a method when the value changes.
firstMobileInput.onValueChanged.AddListener(delegate { ValueFirstChangeCheck(); });
secondMobileInput.onValueChanged.AddListener(delegate { ValueSecondChangeCheck(); });
thirdMobileInput.onValueChanged.AddListener(delegate { ValueThirdChangeCheck(); });
fourthMobileInput.onValueChanged.AddListener(delegate { ValueFourthChangeCheck(); });
}
private void ValueFirstChangeCheck()
{
if (firstMobileInput.text != "")
{
secondMobileInput.Select();
}
}
private void ValueSecondChangeCheck()
{
if (secondMobileInput.text == "")
{
firstMobileInput.Select();
}
else
{
thirdMobileInput.Select();
}
}
private void ValueThirdChangeCheck()
{
if (thirdMobileInput.text == "")
{
secondMobileInput.Select();
}
else
{
fourthMobileInput.Select();
}
}
private void ValueFourthChangeCheck()
{
if (fourthMobileInput.text == "")
{
thirdMobileInput.Select();
}
}
Your answer
Follow this Question
Related Questions
How to change caret position inside Input field using mouse position 0 Answers
TMPro Input Field "Restore On ESC Key" on mobile does not work 0 Answers
How to Count Characters in an InputField and Display them on TMP Text. 0 Answers
TextMeshPro Inputfield Deselected by TouchScript 1 Answer
How does one Animate an alpha change (so fade) for a Textmesh? 0 Answers