Human-readable labels for the currently selected keyboard layout.
Integrators can use this to render on-screen key hints that match the active layout.
Gets the current input state
Returns the conversion action triggered by Ctrl+Enter.
Returns the currently registered error callback, if any.
Returns the URL-opening callback used by dictionary and help flows.
Handles the passed keyboard events.
The keyboard event.
If the key is handled.
Handles a McBopomofo-specific key event.
The key event to handle.
True if the key event was handled, false otherwise.
Resets to empty state.
Selects a candidate by its index on the current candidate page.
Zero-based index within the visible page.
Sets whether users are allowed to change the tone of the prior character by typing a tone key after it.
Whether changing the prior tone is allowed.
Enables or disables IVS/PUA annotation output for supported Bopomofo fonts.
Whether committed text should include annotation selectors.
Sets the candidate keys
The candidate keys, such "123456789".
Sets the number of candidate selection keys.
The number of candidate selection keys to set. Must be between 4 and 15 inclusive.
Sets Chinese conversion on or off.
Sets if the ESC key should clear the entire composing buffer.
If the ESC key should clear the entire composing buffer.
Sets phrases that should be hidden from candidate suggestions.
A serialized phrase table or a map keyed by reading.
Sets if we want to use half width punctuation.
Use half width punctuation.
Sets keyboard layout.
Note: if the layout is not recognized, it will be set to "Standard" layout.
Keyboard layout. It could be:
The language code for localized messages.
The language code.
Ser if the input method should input uppercase or lowercase letters when users type shift and letter keys.
"lower" or "upper".
Sets if the input method should move cursor after selecting a candidate.
To enable the function or not.
Sets whether to enable cursor movement using 'J' and 'K' keys when the candidate window is visible. When enabled, users can navigate through candidates using these keys similar to vim-style navigation.
Sets the error handler function for the input controller.
The callback function to handle errors
Registers a callback fired whenever the excluded phrase table changes.
Receives the latest excluded phrase map.
Help the controller to open a URL.
Sets the callback function that would be called when the user phrase model is changed.
The callback function.
Enables or disables the feature that allows repeated punctuation to select a candidate.
A boolean value indicating whether the feature should be enabled (true) or disabled (false).
Sets if we should select the candidate before the cursor or after the cursor.
"after_cursor" or "before_cursor".
Sets if the input controller should use traditional mode or not.
Sets the user phrases to the language model.
The map of user phrases.
Sets if we want to use vertical or horizontal candidate window.
Use the vertical candidate window.
Handles a simplified keyboard event payload without a DOM KeyboardEvent.
This is useful in tests or host environments that normalize key presses before forwarding them to the controller.
Controller class that manages the input method's state and handles keyboard events. This class serves as the main coordinator between different components of the input method, including the UI, language model, and keyboard handler.
The controller is responsible for:
Key features:
Example