KMManager class
Summary
The KMManager
class provides methods for controlling Keyman Engine
Syntax
KMManager.methodName()
KMManager.CONSTANT
Description
The KMManager is the core class which provides most of the methods and constants you will need to develop your apps with Keyman Engine
Methods
addKeyboard()
: adds a keyboard into the keyboards list
addKeyboardDownloadEventListener()
: adds the specified listener into the list of keyboard download event listeners
addKeyboardEventListener()
: adds the specified listener into the list of keyboard event listeners
addLexicalModel()
: adds a lexical model into the lexical models list
advanceToNextInputMode()
: switch to the next system keyboard input mode
advanceToPreviousInputMethod()
: switch to the previous system keyboard input mode
applyKeyboardHeight()
: sets the height of keyboard frame
canAddNewKeyboard()
: returns whether adding a new keyboard is enabled, like in the keyboard picker menu
canRemoveKeyboard()
: returns whether removing a keyboard is enabled, like in the keyboard picker menu
copyHTMLBannerAssets()
: copies a folder of HTML banner assets so it's available for your keyboard app's resources
createInputView()
: creates the input view to be used in InputMethodService
deregisterLexicalModel()
: deregisters the specified lexical model from the LMLayer so it isn't used
executeHardwareKeystroke()
: process the keystroke generated from a physical keyboard
getAssociatedLexicalModel()
: search the installed lexical models list and see if there's an associated model for a given language
getBannerHeight()
: returns the height of the suggestion banner
getCurrentKeyboardIndex()
: returns index number of the current keyboard in keyboards list
getCurrentKeyboardInfo()
: returns information dictionary of the current keyboard
getDefaultKeyboard()
: returns the keyboard information for the fallback keyboard
getFontTypeface()
: creates a new typeface from the specified font filename
getGlobeKeyAction()
: returns the action type of the 'Globe' key
getHapticFeedback()
: returns whether the device vibrates as the user types
getKeyboardFontFilename()
(Deprecated)
: use getKeyboardTextFontFilename or getKeyboardOskFontFilename instead
getKeyboardFontTypeface()
(Deprecated)
: use getKeyboardTextFontTypeface or getKeyboardOskFontTypeface instead
getKeyboardHeight()
: returns the height of the keyboard frame
getKeyboardIndex()
: returns index number of the specified keyboard in keyboards list
getKeyboardInfo()
: returns information dictionary of the specified keyboard
getKeyboardsList()
: returns the array of keyboards list
getKeyboardOskFontFilename()
: returns the selected keyboard's OSK font filename
getKeyboardOskFontTypeface()
: creates a new typeface from the selected keyboard's OSK font
getKeyboardState()
: returns the specified keyboard's state
getKeyboardTextFontFilename()
: returns the selected keyboard's text font filename
getKeyboardTextFontTypeface()
: creates a new typeface from the selected keyboard's text font
getKMKeyboard()
: returns the KMKeyboard depending whether it's an in-app or system keyboard
getLatestKeyboardFileVersion()
: returns the specified keyboard's latest file version number
getLexicalModelInfo()
: returns dictionary information of the specified lexical model
getLexicalModelsList()
: returns the array of lexical models list
getLanguageCorrectionPreferenceKey()
: returns a String to use as a shared preference key to store whether the LMLayer should enable corrections for a given language
getLanguagePredictionPreferenceKey()
: returns a String to use as a shared preference key to store whether the LMLayer should enable suggestions for a given language.
getLongpressDelay()
: returns from stored preference the number of milliseconds to trigger a longpress gesture
getMaySendCrashReport()
: returns whether Keyman Engine is allowed to send crash reports over the network to sentry.keyman.com
getOrientation()
: returns the device's current orientation (Portrait vs Landscape)
getSpacebarText()
: returns the current text display pattern for the spacebar
getVersion()
: returns the version number of Keyman Engine
getWindowDensity()
: returns the density of the window
getWindowSize()
: returns the size of an area the window would occupy
hasConnection()
: returns whether the device has active network connection
hideSystemKeyboard()
: hides the system OSK
initialize()
: initializes the Keyman manager
isDebugMode()
: returns whether debugging of Keyman Engine is enabled
isHelpBubbleEnabled()
(Deprecated)
: returns whether the help bubble is enabled
isKeyboardLoaded()
: returns whether the specified in-app or system keyboard is loaded
keyboardExists()
: returns whether the specified keyboard exists in keyboards list
lexicalModelExists()
: returns whether the specified lexical model exists in lexical models list
onConfigurationChanged()
: performs necessary actions in an InputMethodService's onConfigurationChanged()
onDestroy()
: performs necessary actions in an InputMethodService's onDestroy()
onPause()
: performs necessary actions in an Activity's onPause()
onResume()
: performs necessary actions in an Activity's onResume()
onStartInput()
: performs necessary actions in an InputMethodService's onStartInput()
registerAssociatedLexicalModel()
: registers a lexical model with the associated language ID
registerLexicalModel()
: registers a lexical model to use with the LMLayer
removeKeyboard()
: removes the keyboard at specified position from the keyboards list
removeKeyboardDownloadEventListener()
: removes the specified listener from the list of keyboard download event listeners
removeKeyboardEventListener()
: removes the specified listener from the list of keyboard event listeners
sendOptionsToKeyboard()
: sends options like longpress delay to the KeymanWeb keyboard
setCanAddNewKeyboard()
: sets whether adding a new keyboard is allowed
setCanRemoveKeyboard()
: sets whether removing a keyboard is allowed, like in the keyboard picker menu
setDebugMode()
: enables or disables debugging of Keyman Engine
setDefaultKeyboard()
: sets the keyboard information for the fallback keyboard
setGlobeKeyAction()
: sets an action type for the 'Globe' key
setHapticFeedback()
: sets whether the device vibrates as the user types
setHelpBubbleEnabled()
(deprecated)
: enables or disables the help bubble
setHTMLBanner()
: sets the contents of an HTML banner for Keyman Engine to display when suggestions aren't available
setKeyboard()
: sets the keyboard to be used
setKeyboardPickerFont()
: sets the font for the keyboard picker menu
setKeymanLicense()
(Deprecated)
: sets the developer license/key pair to unlock Keyman Engine
setLongpressDelay()
: stores the longpress delay in milliseconds as a preference.
setMaySendCrashReport()
: sets whether Keyman Engine can send crash reports over the network to sentry.keyman.com
setShouldAllowSetKeyboard()
: sets whether Keyman Engine allows setting a keyboard other than the default keyboard
setShouldCheckKeyboardUpdates()
: sets whether Keyman Engine should check for keyboard updates
setSpacebarText()
: sets the current text display pattern for the spacebar
shouldAllowSetKeyboard()
: returns whether Keyman Engine allows setting a keyboard other than the default keyboard
shouldCheckKeyboardUpdates()
: returns whether Keyman Engine should check for keyboard updates
showKeyboardPicker()
: displays the keyboard picker menu
showLanguageList()
(Deprecated)
: displays the language list
switchToNextKeyboard()
: loads the next available keyboard in keyboards list
updateSelectionRange()
: updates the selection range of the current context
updateText()
: updates the current context with the specified text