Interface IKeyboardManager
interface IKeyboardManager
Extends com.amazon.apmf.IStandard
The IKeyboardManager interface offers methods to interact with the keyboard, including displaying or hiding the on-screen keyboard.
It provides methods for managing text input shown on keyboard.
Methods
show()
void show()
Displays the on-screen keyboard.
This method is used to trigger the on-screen keyboard, making it visible to the user.
When called, notifies all registered IKeyboardListener instances across all windows.
Note :
- None of the keyboard listeners will indicate whether the keyboard was opened by their window or different window.
- To distinguish if the listener was triggered for a window that opened the keyboard, use
IKeyboardManager2::showForView.
Throws
KeyboardServiceConnectionFailedError— when connection to the keyboardService cannot be established.
hide()
void hide()
Hides the on-screen keyboard.
This method is used to dismiss the on-screen keyboard, hiding it from view.
Throws
KeyboardServiceConnectionFailedError— when connection to the keyboardService cannot be established.
setExtractedText()
Send text to on-screen keyboard to update the inner input field. This method should only be used for full-screen keyboard. Since the application is covered by the keyboard window, it should sync its text contents to the keyboard so that the keyboard can present it to the user.voidsetExtractedText(com.amazon.kepler.uitoolkit.graphics.IAttributedText*attributedText,u32selStart,u32selEnd,u32startOffset)
Parameters
attributedText
com.amazon.kepler.uitoolkit.graphics.IAttributedText* — Required
IAttributedText Attributed Text to be added to the input field of keyboard.
selStart
u32 — Required
Position of selection begin after update.
selEnd
u32 — Required
Position of selection end after update.
startOffset
u32 — Required
The starting position of update. Will remove text after this position before update. Default value is 0.
Throws
KeyboardServiceConnectionFailedError— when connection to the keyboardService cannot be established.
setCursorSelection()
This method is used to notify keyboard about the changing of input context. example, when the cursor is moved by user’s actions, like cut/paste operation.voidsetCursorSelection(u32start,u32end)
Parameters
start
u32 — Required
Index to start the selection from.
end
u32 — Required
Index to stop the selection at.
Throws
KeyboardServiceConnectionFailedError— when connection to the keyboardService cannot be established.
setInputType()
Sets the input type of the keyboard. The default input type isvoidsetInputType(com.amazon.kepler.intl.input_method.InputType*inputType)
InputType::NORMAL.
Parameters
inputType
com.amazon.kepler.intl.input_method.InputType* — Required
enum of type InputType.
setInputAction()
Set the text in the return button of the keyboard and decides the type of action taken on click of the return key. The default action isvoidsetInputAction(com.amazon.kepler.intl.input_method.InputAction*inputAction)
InputAction::NONE, where the keyboard shows the regular “Enter” text on the return key and performs no special action.
Parameters
inputAction
com.amazon.kepler.intl.input_method.InputAction* — Required
enum of type InputAction.
setInputUiMode()
Sets the user interface mode for the keyboard. The default mode isvoidsetInputUiMode(com.amazon.kepler.intl.input_method.InputUiMode*inputUiMode)
InputUiMode::FULL_SCREEN.
Parameters
inputUiMode
com.amazon.kepler.intl.input_method.InputUiMode* — Required
enum value of type InputUiMode.
setInputUiRegion()
Sets the rectangular region only whenvoidsetInputUiRegion(com.amazon.kepler.uitoolkit.graphics.Rect*inputUiRegion)
InputUiMode::FLOATING, ignored otherwise.
The default value is {0.0,0.0,0.0,0.0}. When default or invalid value is set like {100.0,100.0,0.0,300.0},
then keyboard will be opened in InputUiMode::FULL_SCREEN.
Parameters
inputUiRegion
com.amazon.kepler.uitoolkit.graphics.Rect* — Required
Rect float coordinates of type Rect.
setPlaceholder()
Sets the placeholder text of thevoidsetPlaceholder(stringplaceholder)
InputUiMode::FULL_SCREEN.
The default value is an empty string.
Parameters
placeholder
string — Required
string to set placeholder text.
setLanguage()
Sets the language for keyboard. The default value is “en_US”.voidsetLanguage(stringlanguage)
Parameters
language
string — Required
to set language of keyboard.
setInputFlags()
Sets the list of input flags on the keyboard.voidsetInputFlags(com.amazon.kepler.intl.input_method.InputFlag[]inputFlags)
Parameters
inputFlags
com.amazon.kepler.intl.input_method.InputFlag[] — Required
list of enum of type InputFlag.
setPreferredTheme()
Set the theme that the keyboard should use. The default value isvoidsetPreferredTheme(com.amazon.kepler.intl.input_method.Theme*theme)
Theme::SYSTEM_DEFAULT.
Parameters
theme
com.amazon.kepler.intl.input_method.Theme* — Required
preferred theme of on-screen keyboard of type Theme.
setAutoCapMode()
Set the auto capitalization flag. The default value isvoidsetAutoCapMode(com.amazon.kepler.intl.input_method.AutoCapMode*autoCapMode)
AutoCapMode::NONE.
Parameters
autoCapMode
com.amazon.kepler.intl.input_method.AutoCapMode* — Required
The auto capitalization mode of type AutoCapMode.
setAuxiliaryOptions()
Sets auxiliary options which are used to customize keyboard layouts like keyboardTitle, actionButton labels etc.voidsetAuxiliaryOptions(IAuxiliaryOptions*options)
Parameters
options
IAuxiliaryOptions* — Required
Pointer to IAuxiliaryOptions object.

