gindi_khangura
11 years agoOccasional Contributor
[iOS] Close keyboard after type action
Hi,
We are typing into a TextField object in VBScript using the Keys method as we want to simulate user input, therefore SetText is not an option, and that triggers the keyboard to pop-up; however, we are unable to close the keyboard after typing.
Using Keys("[Enter]") just types it in as a literal, as do other commands like Keys("[BS]") for backspace.
We have also tried using Device.PressButton(mbkEnter/mbkEscape/mbkHome, etc). None worked except for mbkEnter, but that triggers the action associated with the control (logging in, confirming, etc) that we do not want.
All we want is to minimize the keyboard. Any suggestions?
We are typing into a TextField object in VBScript using the Keys method as we want to simulate user input, therefore SetText is not an option, and that triggers the keyboard to pop-up; however, we are unable to close the keyboard after typing.
Using Keys("[Enter]") just types it in as a literal, as do other commands like Keys("[BS]") for backspace.
We have also tried using Device.PressButton(mbkEnter/mbkEscape/mbkHome, etc). None worked except for mbkEnter, but that triggers the action associated with the control (logging in, confirming, etc) that we do not want.
All we want is to minimize the keyboard. Any suggestions?
- Hi!
If you want to minimize the keyboard without triggering its return action you can:
1) Touch some other non-textual control (which closely simulates a real user action to dismiss the keyboard)
2) Call resignFirstResponder method of the text field (which effectively does the same thing as the first approach)
Also, just for your information, if you will ever want to also trigger the return action - just
add either "\r" or "\n" at the end of your input:
myField.Keys("my input\r");