Step 8: Entering the Characters

When the user presses Enter, the selected character will be added to Text. We need 2 events, one for lowercase and a second for uppercase. Also, the user should only be able to add a new character if there is space to do so. Once the Blitter object has reached 210 pixels, then there is no more space.

First, we need a string containing every character (including space), in the same order as the keypad. Then, using the Mid$ function, we can retrieve a substring, 1 character in length and from the starting position equal to the Selection value. We then add this character to Text. Once again, the menu_accept sound file is embedded in the mfa and can be found in the samples list.

Go into the Blitter object properties and change the default Text string from "Leon S Kennedy" to "". Run the application and you can now enter any character.

11