Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

Other versions
Version 18.0Version 17.0 (current version)Version 16.0Version 15.0Version 14.0Version 13.0Version 12.0Version 11.0Version 10.0Version 2.0

Index

On this page

You are viewing an old version of this documentation. Click here to open the current version, 17.0.

KMManager.setKeyboard()

Summary

The setKeyboard() method sets the keyboard to be used.

Syntax

KMManager.setKeyboard(String keyboardID, String languageID)

Parameters

keyboardID
ID of the keyboard.
languageID
ID of the associated language.

Returns

Returns true if the keyboard was set successfully, false otherwise.

Description

This syntax can be used for setting a keyboard which is available on the Keyman server. Make sure language list is displayed (see showLanguageList()) at least once before using this syntax, otherwise it may fail to set the keyboard properly. Do not use this syntax to set a custom keyboard.



Syntax

KMManager.setKeyboard(String keyboardID, String languageID, String keyboardName, String languageName, String kFont, String kOskFont)

Parameters

keyboardID
ID of the keyboard.
languageID
ID of the associated language.
keyboardName
Name of the keyboard.
languageName
Name of the associated language.
kFont
Filename or description of the font to type with the keyboard. Can be null or empty string.
kOskFont
Filename or description of the font displayed on the keyboard. Can be null or empty string.

Returns

Returns true if the keyboard was set successfully, false otherwise.

Description

This syntax can be used to set a keyboard which is either downloaded or included in the assets/languages/ folder.



Syntax

KMManager.setKeyboard(Context context, int position)

Parameters

context
The context.
position
0-based position of the keyboard in the keyboards list.

Returns

Returns true if the keyboard was set successfully, false otherwise.

Description

Use this syntax to set a keyboard which has already been added into the keyboards list.



Examples

Example 1: Using setKeyboard()

The following script illustrate the use of setKeyboard():

    // Setting a Keyman keyboard
    KMManager.setKeyboard("EuroLatin2", "en");

Example 2: Using setKeyboard()

The following script illustrate the use of setKeyboard():

    // Setting a custom keyboard which exists in assets/languages/
    KMManager.setKeyboard("tamil99m", "ta", "Tamil 99M", "Tamil", "aava1.ttf", "aava1.ttf");

Example 3: Using setKeyboard()

The following script illustrate the use of setKeyboard():

    // Setting a custom keyboard which exists in keyboards list
    int kbIndex = KMManager.getKeyboardIndex(this, "tamil99m", "ta");
    KMManager.setKeyboard(this, kbIndex);

See also