Fennec Text Input using Android IME
Chris Peterson (cpeterson)
April 2012
IME = Input Method Editor
- An input method editor (IME) is any user control that enables users to enter text.
- IME is a system abstraction that decouples text input from text processing.
IME = Input Method Editor
-
Android input methods include:
- on-screen keyboards (VKB)
- hardware keyboards (HKB)
- hand-writing recognizers
- speech-to-text input
- Unlike desktop computers, Android uses an IME for all text input, including English.
Composition Strings
- To enter extended characters, a user:
- composes text in the Input Method Editor
- then commits the completed text to the application.
- A composition string consists of one or more clauses, where a clause is the smallest combination of characters that have a meaning in the language.
- A fancy English IME might commit the clauses "f" and "i" as one ligature character "fi".
Input Step 1
- Android IME sends text to Java as some sequence of:
- keydown/keyup events,
- uncommitted composition clauses,
- and/or a committed composition strings.
Third-Party IMEs may have bugs
- ArtIME Japanese Input
- A.I.type Keyboard Plus
- COBIME Japanese
- Google Japanese Input
- Google Pinyin (Chinese)
- Google Voice Typing
- GO Keyboard
- Hacker's Keyboard
- ICS Keyboard
- Japanese IME Kaede IME
- KatakanaIME
- nicoWnnG IME
- OpenWnn Plus
- Perfect Keyboard Pro
- Simeji
- SlideIT Keyboard
- Smart Keyboard Pro
- SwiftKey X
- Swype
- Thumb Keyboard
- TouchPal Input
- Ultra Keyboard
- Very Easy Japanese IME (Hiragana, Katakana)
- Very Easy Japanese IME (Kanji)
- ...
Input Step 2
- Fennec's Java code normalizes IME events and device quirks.
- Fennec's JNI code funnels IME input to Gecko's IME Widget events.
Input Step 3
- Gecko dispatches keydown and keyup events to Flash plugin.
- Gecko dispatches events to DOM/JS, such as:
keydown
keypress
keyup
input
compositionstart
compositionupdate
compositionend
Input Step 3 (DOM Quirks)