Search

8/10/2009

Keyboard events and key identifiers - Input Method Editors

http://www.w3.org/TR/DOM-Level-3-Events/keyset.html#IME

A.1.3 Input Method Editors

Also known as front end processor, an input method editor (IME) is an application that performs the conversion between keystrokes and ideographs or other characters, usually by user-guided dictionary lookup.

This specification does not provide a representation of the input method editor (IME) events, i.e. the IME's functions and the IME context are not represented in this set. As an example, receiving a keydown for the "Accept" key identifier does not necessarily imply that the text currently selected in the IME is being accepted. It only indicates that a keystroke happened, disconnected from the IME Accept functionality. Depending on the device in use, the IME Accept functionality can be obtain using the Accept key or the Return key. Keyboard events cannot be used to determine the current state of the input method editor.

Keyboard events correspond to the events generated by the input device after the keyboard layout mapping but before the processing of the input method editor.

The following example describes a possible sequence of keys to generate the Unicode character 市 (Kanji character, part of CJK Unified Ideographs) using Japanese input methods. This example assumes that the input method editor is activated and in the Japanese-Romaji input mode. The keys "Convert" and "Accept" may be replaced by others depending on the input device in use and the configuration of the IME, e.g. it could be respectively "U+0020" (Space key) and "Enter".

1. "keydown": "U+0053" (Latin Capital Letter S key)
2. "keyup": "U+0053" (Latin Capital Letter S key)
3. "keydown": "U+0049" (Latin Capital Letter I key)
4. "keyup": "U+0049" (Latin Capital Letter I key)
5. "keydown": "Convert"
6. "keyup": "Convert"
7. "keydown": "Accept"
8. "textInput": "市"
9. "keyup": "Accept"

沒有留言: