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);