GoDB Developer Network
Tuesday, November 29, 2005
  Custom Keyboards (GoDb Enterprise Edition)

When dealing with multi lingual fonts or devices that do not have keyboards, GoDB provides an
extensible Multilingual Keyboard and GBasic API for managing the Keyboard.

To create a Custom Keyboard you need to create an Image with the KeyMap.



You need to create XML Keyboard Map files that specify the Location of the keys and the ASCII code that has to be generated corresponding to the font you are using. The XML file should have the same name as that of the image file, say you have T_Main.GIF the XML file should be called T_Main.xml.

The XML is defined as

<gkeymap keycount='10'>

<key x='17' y='0' w='17' h='15' c='1' >

<key x='28' y='31' w='17' h='15' c='a' >

<key x='212' y='47' w='26' h='15' a='13' >

<key x='0' y='47' w='34' h='17' i='T_shift_main'>

</gkeymap>

Where keycount Specifies the Number of keys in the keyboard.
x,y Specifies the Coordinates of the Key.
w,h Specifies the Dimensions of the Key.
Character Codes that need to be generated can be specified as c - Character that needs to be
generated for the key.

a - ASCII / Unicode Code for the character that needs to be generated.
Multiple Keyboards can also be liked with the i attribute
i - This attribute can be used to load another keyboard when the user clicks on the specified
region. In the example clicking on the Shift key will load the T_shift_main.bin and T_shift_main.xml.



To Load the Keyboard you have to use the LoadKeyBoard Method.
To Show the Keyboard you have to use the ShowKeyBoard Method.
To Hide the Keyboard you have to use the HideKeyBoard Method.

Compile and run the project



In the simulator you can Display the keyboard using the F5 key.



You can click on the Shift Key for the Alternate Keyboard.




 
Comments: Post a Comment

Links to this post:

Create a Link



<< Home
Welcome to the unofficial GoDB Developer Network. This blog is completely dedicated to GoDB platform -- a multi platform Mobile RAD tool for developing handheld and wireless applications for Windows Mobile (Pocket PC,Win CE, Smartphones), Palm, Symbian, Embedded Linux, Linux, Win 32, etc. Fellow GoDB developers can find sample codes, contribute to the blog and Mobility related news for the benefit of the mobile development community as a whole.

ARCHIVES
2005-11-20 / 2005-11-27 / 2005-12-04 / 2005-12-11 / 2006-11-05 /


Powered by Blogger