ebmDevMag.com home
ebm Developer's Magazine
links

developer's mag
main page

article
part 1
part 2
part 3
part 4
part 5
part 6
part 7
part 8


7 - A Plethora of Keyboards

You could also call the keyboard simply with the following line:
  GUI_EventLoop(new CLatin1Keyboard(99)); // display keyboard
This displays the lowercase keyboard at the bottom of the screen. The second parameter in the constructor is optional, and defaults to 69 - it is the Y coordinate of the keyboard top, and allows you to place the keyboard where you prefer. In our case, the message loop data and the edit control are at the bottom, so we've set our keyboard to the top by using a value of zero.

In our code we've split up the keyboard creation and display so we could use the SetCurScreen() function, which takes in an index from zero through four and displays the specified keyboard:
  • 0 - Lowercase keyboard.
  • 1 - Uppercase (temporarily shifted) keyboard.
  • 2 - Uppercase (cap locked) keyboard.
  • 3 - Accented uppercase.
  • 4 - Accented lowercase.
Entries 1 and 2 differ in that one shifts back to lowercase after the first character, while the other is locked in capitals. You can also access these keyboards from any keyboard with the CAP, SHFT, and ACNT keys, but if you prefer to start off with a specific keyboard, the SetCurScreen() function is the way to go.

When finished with the keyboard, the ENTER key sends the text to the parent. As earlier mentioned, focus determines where the text goes exactly. The sample program lets you try setting the focus to the edit field or the form, and displays the results of each. This is deliberately done to let you look at the results, but in production code you should always use SetFocus() to specify the text destination before launching the keyboard.

Previous Section
Next Section

Copyright © 2001-2006 ebmDevMag.com - Legal Notice