Module: KeyboardContext

KeyboardContext provides installed keyboard apps and enabled keyboard layouts in terms of ObservableArrays. It listens to the events from KeyboardHelper and update the ObservableArrays. KeyboardHelper helps on the following things:

  • Get all installed keyboard apps and layouts.
  • Enable or disable keyboard layouts.
  • Notify keyboard layout changes via the 'keyboardsrefresh' event. KeyboardContext handles only data and does not involve in any UI logic.
Source:

Classes

Keyboard
Layout

Methods

defaultKeyboardEnabled(callback)

Add a callback to be triggered when the default keyboard is enabled.

Add a callback to be triggered when the default keyboard is enabled.

Parameters:
Name Type Description
callback function

The callback to be triggered.

Source:

enabledLayouts(callback)

Get the enabled layouts in terms of an observable array.

Get the enabled layouts in terms of an observable array.

Parameters:
Name Type Description
callback function

The result is passed to the callback when ready.

Source:

init(callback)

Initialize the keyboard context.

Initialize the keyboard context. After the context initialized, we are able to get the installed keyboards and enabled layouts.

Parameters:
Name Type Description
callback function

The callback when the context is initialized.

Source:

keyboards(callback)

Get the installed keyboards in terms of an observable array.

Get the installed keyboards in terms of an observable array.

Parameters:
Name Type Description
callback function

The result is passed to the callback when ready.

Source:

reset()

Reset the keyboard context.

Reset the keyboard context. It clears all cached data of installed keyboards and current enabled layouts.

Source: