This section presents a high level overview of IME, describing the Input Method Editor behavior from the end user perspective and defining IME terminology. Reading this section is critical for non-Asian developers who haven’t had prior experience using IME and are tasked with integrating it into their Scaleform based application.
As was mentioned in the introduction, input method editors are programs that allow users to input text in East Asian languages, such as Chinese, Japanese, and Korean using a standard keyboard. Use of the IME technology relieves end users of the need to remember all possible ideographic character values. Instead, IME monitors user keystrokes as they type and anticipates the characters the user might want. When several similar choices are available, IME presents a list of candidate strings giving the user an opportunity to choose an appropriate one.
On desktop computers IME support is traditionally provided by the operating system, which monitors keystrokes and displays system popup windows with status information and candidate strings. When system display of popup windows is inappropriate, applications can tap into system IME notifications and use them to manage their own IME windows, providing a custom UI experience. On consoles, the operating system usually provides only the most rudimentary input method APIs, leaving it up to developers to display candidate lists when appropriate.
When IME popup support is provided by the OS, it is usually tied to system text field controls. Since Scaleform is a portable UI solution, Scaleform needs to implement its own IME functionality to both support text fields on all platforms and to provide precise control over pop-up window positioning. Moreover, rendering its own IME reading windows and candidate lists allows developers to customize their appearance to fit the game and helps avoid flickering in full screen mode.
The four main UI items that the user interacts with when using IME are the composition string, the reading window, the candidate list and the status window. The status window enables selection of the desired IME and is normally provided as a part of the operating system; under Windows, it corresponds to the desktop language bar. Before entering Asian text, users will often use keyboard shortcuts or the language bar to select the desired input language and IME conversion mode. With the target language selected, users will proceed to enter text into the UI text fields and interact with the reading window and candidate lists that popup.
Unlike the system status window, the reading window and candidate list pop-ups are rendered directly by Scaleform and are displayed as a part of or adjacent to the input text field. The behavior of these popups is illustrated in Figure 1 and explained in detail on the next page.
Figure 1: Candidate Window and Reading Windows
The different IME elements illustrated in Figure 1 have the following purpose:
The composition string is a highlighted part of the current text field that the user interacts with while using IME; this string can be converted to final characters by pressing a dedicated key, such as a spacebar. The exact highlighting and input key behavior applied varies greatly with IME in use. The picture below illustrates the default composition string used with Japanese IME.
In Japanese, the composition string can be broken down into one or more "clauses". A clause is the smallest combination of characters that the IME can convert to a final character. The currently active clause is highlighted with a special underline style and can be selected with arrow keys before the string is finalized. An example of clause selection is illustrated below.
Although the notion of the “clause” string is not used directly by most Chinese IMEs, alternative IME implementations often include similar substring selection behavior. While Scaleform tries to handle input consistently across all platforms, the exact details of IME handling can vary with the operating system and even application in use.
ActionScript developers should note that access of TextField properties will not consider the composition string until it is finalized. TextField.length and TextField.text properties, for example, will behave as if the composition string did not exist. Furthermore, unless the composition style is explicitly modified, the style of the character before the composition string will be used for the entire string. When the text field is empty, the default text format for the text field is used. The details of changing the composition string style are provided in Composition String Styles section of Customizing the IME User Interface.
The reading window contains the key strokes from the keyboard. This is used in Chinese Simplified and Traditional IMEs. In Chinese Simplified IMEs the reading window contains the actual letters the user types on the keyboard, while in Chinese Traditional IMEs it contains the Unicode character corresponding to the keystroke. These two scenarios are illustrated below.
The user can convert reading window text into composition characters usually by pushing space or enter key.
The candidate list window contains a list of “candidates”, or alternative character sequences, for the selected characters in the composition string. It is shown as a long vertical popup in a picture below.
Depending on the IME selected, the candidate list will either pop up automatically of after a dedicated key is pressed. Once the list is displayed, the user can use the numeric keys or the mouse cursor to select the desired string; they can also use the PageUp and PageDown keys if the list is long.