The major class that receives the keyboard events and stores the input method state. It is also the only class exported from the module.

Constructors

Accessors

Methods

  • Handles the passed keyboard events.

    Parameters

    • event: KeyboardEvent

      The keyboard event.

    Returns boolean

    If the key is handled.

  • Sets if the ESC key should clear the entire composing buffer.

    Parameters

    • flag: boolean

      If the ESC key should clear the entire composing buffer.

    Returns void

  • Sets if we want to use half width punctuation.

    Parameters

    • enabled: boolean

      Use half width punctuation.

    Returns void

  • Sets keyboard layout.

    Parameters

    • layout: string

      Keyboard layout. It could be:

      • "Standard"
      • "ETen"
      • "Hsu"
      • "ETen26"
      • "HanyuPinyin"
      • "IBM"

    Returns void

  • The language code for localized messages.

    Parameters

    • languageCode: string

      The language code.

    Returns void

  • Ser if the input method should input uppercase or lowercase letters when users type shift and letter keys.

    Parameters

    • letterCase: string

      "lower" or "upper".

    Returns void

  • Sets if the input method should move cursor after selecting a candidate.

    Parameters

    • flag: boolean

      To enable the function or not.

    Returns void

  • Help the controller to open a URL.

    Parameters

    • input: undefined | ((input: string) => void)

    Returns void

  • Sets the callback function that would be called when the a user phrase model is added.

    Parameters

    • callback: ((key: string, phrase: string) => void)

      The callback function.

        • (key, phrase): void
        • Parameters

          • key: string
          • phrase: string

          Returns void

    Returns void

  • Sets the callback function that would be called when the user phrase model is changed.

    Parameters

    • callback: ((map: Map<string, string[]>) => void)

      The callback function.

        • (map): void
        • Parameters

          • map: Map<string, string[]>

          Returns void

    Returns void

  • Sets if we should select the candidate before the cursor or after the cursor.

    Parameters

    • option: string

      "after_cursor" or "before_cursor".

    Returns void

  • Sets if the input controller should use traditional mode or not.

    Parameters

    • flag: boolean

    Returns void

  • Sets the user phrases to the language model.

    Parameters

    • input: string | Map<string, string[]>

      The map of user phrases.

    Returns void

  • Sets if we want to use vertical or horizontal candidate window.

    Parameters

    • flag: boolean

      Use the vertical candidate window.

    Returns void