This chapter describes the user interface of the Sample FEP that is provided with the FEP Kit. This interface is similar to the interface that some real FEPs use, including the Palm OS® standard Simplified Chinese FEP, called the Pinyin FEP, and the standard Japanese FEP. This chapter also provides examples of input area designs for handhelds that rely on FEPs for entering characters.
This chapter covers the following concepts:
Input Area Buttons
Handheld devices that include FEPs typically provide either three or four extra input area buttons in addition to those provided on all Palm Powered™ handhelds. Like other input area buttons, tapping one of these buttons sends a keyDownEvent
to the system. This event then affects what the user sees on the screen.
Standard FEP Buttons
Figure 2.1 shows an example of the three-button interface on a Simplified Chinese handheld.
Figure 2.1 Input area for a Simplified Chinese handheld

The three buttons correspond to "Convert," "Confirm," and "On/Off."
Convert triggers conversion of the text in the active field if there is no clause (converted text). If there is converted text, then it selects the next option. If the user has selected non-inline text and taps the Convert button, this text is used to "prime the pump." This priming text gets passed to the FEP's conversion engine as if the user had entered it all with the FEP on (as if it were all raw inline text) and then tapped the Convert button.
Confirm accepts the currently entered text. If there is no clause (a grammatically meaningful group of characters), then all of the raw inline text is dumped into the field, and the inline text area becomes empty. If there is a clause, then only that clause is dumped into the field (that is, removed from the start of the inline text area).
On/Off turns the FEP on or off.
The Keyboard buttons shown in Figure 2.1 just bring up a keyboard dialog with the chosen character set.
The Change Mode Button
For languages such as Japanese, which have multiple character sets, the interface also contains a "Change Mode" button, shown in Figure 2.2.
Figure 2.2 Input area for a Japanese handheld

Change Mode toggles the FEP's input mode. For the Palm OS standard Japanese FEP, it toggles between Hiragana and Katakana. If there is no clause, but there is raw inline text, then it transliterates the text between Hiragana and Katakana. If there is a clause, then it converts the clause to Hiragana (if Kanji or Katakana) and Katakana (if Hiragana).
Interactions with Forms and Fields
In order to capture and convert text, the FEP must interact extensively with Palm OS and with an application's forms and fields. The following sections illustrate this process with examples.
The Sample FEP User Interface
In this section, we will use the Sample FEP to illustrate common FEP interface features. The Sample FEP converts acronyms into their full-length representations. Because the results of the sample FEP are all simple English phrases containing only low ASCII characters that are present on every language version of Palm OS, this sample project will run on any language version of Palm OS.
Inline Text Conversion
Suppose you want to begin a memo with the words, "With regard to your letter on the 28th,..." The Sample FEP lets you save time by writing the acronym, "wrt," instead of "With Regard To."
As the first step, create a new memo in Memo Pad and write the letters "wrt."
To convert the acronym to its long version, write the space character in the input area or tap the Convert button. This action displays the full-length version of the acronym (see Figure 2.3).
Figure 2.3 Sample FEP, converting "wrt"

Options Pop-up List
In the Sample FEP, if you try the conversion operation more than once, the options pop-up list appears. It contains a list of all possible matches for that acronym in the user dictionary (see Figure 2.4).
Figure 2.4 Sample FEP options list

Select the full-length version that is most appropriate, then tap the Confirm button. The final result contains the correct phrase.
A Simplified Chinese FEP User Interface
This section illustrates the Pinyin FEP.
Inline Text Conversion
Suppose you want to create a new Address Book entry, including the City/Province Name, "Beijing." The Pinyin FEP lets you enter Simplified Chinese syllables using Latin characters.
To begin, create a new Address Book entry and place the cursor in the City/Province field. Write the letters "beijing" in the input area.
To convert the word to its Chinese version, write the "space" character in the input area or tap the Convert button. This action displays the Chinese version (see Figure 2.5).
Figure 2.5 Completed conversion of "Beijing"

Tap the Confirm button to accept the characters and continue writing.
Options Pop-up List
In a FEP that supports an options pop-up list, if you write some inline text and then write the "space" character or tap the Convert button more than once, the pop-up list appears. For example, if you write the characters "bei," and tap Convert twice, you get the pop-up list shown in Figure 2.6.
Figure 2.6 Pinyin FEP options pop-up list

Select the character or characters that are most appropriate. When finished, tap the Confirm button.
A Japanese FEP User Interface
This section illustrates the Japanese FEP, which shows how to use a four-button input area.
Inline Text Conversion
Suppose you want to enter the Kanji characters for "Tokyo" in the City Name field of an Address Book entry. Writing the two Romaji syllables, "tou" and "kyou," results in the Hiragana characters shown in Figure 2.7.
Figure 2.7 "Tokyo," pre-conversion

To get the correct Kanji characters, write the "space" character or tap the Convert button.
Options Pop-up List
When you enter the "space" character or tap the Convert input area button, the correct character may not appear immediately. If you enter "space" or tap the Convert button more than once, the options pop-up list appears. See Figure 2.8 for an example.
Figure 2.8 Japanese FEP options pop-up list

Select the character or characters that are most appropriate. When finished, tap the Confirm button.
The final result contains the correct combination of Kanji characters, as shown in Figure 2.9.
Figure 2.9 Completed Conversion of "Tokyo"

Edit Menu Items
A Palm OS FEP can automatically add a new menu item to any Edit menu that ends with the Graffiti® 2 Help item. This item calls a conversion dictionary that the user can edit.
Palm Powered handhelds may include a built-in bilingual dictionary for the user's reference. This dictionary is not linked to the FEP, but to the Word Lookup application. Instead, the FEP can support a User Dictionary in addition to its own conversion dictionary. The user can add custom words and their converted forms to the User Dictionary.
Figure 2.10 illustrates the Edit menu items on a typical Japanese device.
Figure 2.10 Example of Japanese edit menu

The FEP Panel
The FEP Panel lets users add words to the User Dictionary and maintain the list of added words. It can also let the user set FEP preferences.
You can access the FEP Panel, which contains the list of added words, from the Preferences application or from the Edit > Add Word menu item. Note that the Add Word item will automatically be included in any menu that contains the Graffiti 2 Help command (sysEditMenuGraffitiCmd
), provided there also exists a panel (PRC with type 'panl'
) that has the same creator as the current FEP.
The FEP Panel is usually displayed on the pop-up list as "Sample FEP" or the corresponding name of the FEP used on the handheld. The following figures show the FEP Panel from a handheld running the Sample FEP. The user interface is in English by default.
Note that sample code for the FEP Panel is not provided in the FEP kit. Earlier versions of the kit for Palm OS Garnet do include FEP Panel sample code.

The New Dictionary Entry dialog appears when a user taps the New button or selects the Add Word option from the Edit menu in an application. The following figure shows the New Dictionary Entry dialog from the Sample FEP Panel.
Figure 2.12 Sample FEP New Dictionary Entry Dialog
