How to allow the input of symbols in my text control?

Submitted by: Administrator
Certain limited symbol entry is available by pressing a certain key (usually 1) multiple times. This set of symbols is OEM dependent. On the Kyocera 3035, the following symbols are available by pressing the '1' key multiple times: .&@,-':;?/"(). On the Sharp Z- 800, the following symbols are available by pressing the 1 key multiple times: .,@:!?/.

To allow a greater breadth of symbol entry in your text control, you must associate your text control to a soft key menu using ITEXTCTL_SetSoftKeyMenu(). The set of symbols available using this method are:

ITEXTCTL_SetSoftKeyMenu() adds an item to the Soft Key menu that allows the user to change the text entry mode (the text string for this item is the currently selected mode - for example, MultiTap). When it receives this command, the text control displays a menu allowing the user to select the new text entry mode. After the user selects the new mode, the text control is reactivated and the user may continue to enter text. When entering text, the user may press the Select Key to leave text-edit mode and activate the SoftKey Menu. While the Soft Key menu is active, the user may press the UP key to return to edit mode without making a menu selection.

The following is an example of how to allow multiple input modes in your text control:

// Create text control
ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_TEXTCTL,
(void **)&pMe->m_pIText);

if (pMe->m_pIText) {
// Create soft key menu
ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_SOFTKEYCTL,
(void **)&pMe->m_pISoftKey);
if (!pMe->m_pISoftKey) {
ITEXTCTL_Release (pMe->m_pIText);
pMe->m_pIText = NULL;
return FALSE;
else {
return FALSE;

// Set the soft key menu rectangle
IMENUCTL_SetRect(pMe->m_pISoftKey, &softKeyRect);

// Set text control title, size, properties, rectangle
ITEXTCTL_SetTitle(pMe->m_pIText, NULL, NULL, titleString);
ITEXTCTL_SetMaxSize(pMe->m_pIText, 100);
ITEXTCTL_SetProperties(pMe->m_pIText, TP_FRAME | TP_MULTILINE );
ITEXTCTL_SetRect(pMe->m_pIText, &rect);

// Initialize the softkey menu of the text control.
ITEXTCTL_SetSoftKeyMenu (pMe->m_pIText, pMe->m_pISoftKey);

// Set both the soft key and text control active.
ITEXTCTL_SetActive (pMe->m_pIText, TRUE);

In the app's HandleEvent function, you must handle the EVT_KEY and EVT_COMMAND

events as follows:

// Process EVT_COMMAND event - change of input mode
if((pMe->m_pIText != NULL) && ITEXTCTL_HandleEvent(pMe->m_pIText,
eCode, wParam, dwParam)) {
return TRUE;
return FALSE;

case EVT_KEY:
if ((pMe->m_pIText != NULL) && ITEXTCTL_HandleEvent(pMe->m_pIText,
EVT_KEY, wParam, dwParam)) {
//Event handled by text control
return TRUE;

if(pMe->m_pISoftKey != NULL && IMENUCTL_HandleEvent(
pMe->m_pISoftKey, EVT_KEY, wParam, dwParam)) {
//Event handled by menu control
return TRUE;
return FALSE;
Submitted by: Administrator

Read Online Brew Job Interview Questions And Answers