Tech Note 25d: Automatic Keyboard Pop UpMay 01, 2008© NSB Corporation. All rights reserved. |
I received a question: In text input, how do you display the keyboard screen as soon as the user clicks a field?
I investigated how to do it after dividing it into two actions: "bring the cursor in a field" and "displaying the soft keyboard". First, I was interested in "displaying the soft keyboard". I searched the keyword "KeyBoard" in the API reference, and found the two API functions:
These should be prepared to display the keyboard, but SysKeyBoardDialog needs to pass parameters, so I just ignored it and decided to use SysKeyboardDialogV10 which doesn't require a parameter or return a value. API functions like this normally work from NS Basic very easily. Then, after putting a command button on the screen, I set the following line: Compile ... Run ... Start the keyboard after moving the cursor to an input area. Because the cursor was not in the field, the error was shown...
I thought it looked all right despite the error, so I tried
again after setting the cursor. Yes. If the cursor is in the field, tapping the "KEYBOARD" button brings up the soft keyboard. Next, "bring the cursor in a field". I made a wrong judgment here:
But I couldn't find details; the handbook didn't provide it. So the combination of two lines:
This works fine. I was satisfied after finding how to use the Cursor Id command, but with some curiosity I checked the NS Basic's message board. Mmm... I found a message "don't understand CURSOR ID". The person seemed to try the same thing. But I also found a response to the message: .... I checked the handbook again. My mistake :-) Yes. This works. |