Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface ITextInputControllerDelegate

interface ITextInputControllerDelegate
Extends com.amazon.apmf.IStandard This interface defines a set of delegate functions that can be used with the ITextInputController interface. By implementing this interface and providing it to the IKeyboardManager, the client can achieve delegated functionality for text input operations. The delegate functions allow for customization and extension of the text input behavior, enabling the client to handle various aspects of text editing, such as setting and retrieving attributed text, inserting and removing text, managing text selection, and responding to keyboard events.

Methods

setAttributedText()

void setAttributedText(com.amazon.kepler.uitoolkit.graphics.IAttributedText* attributedText, IKeyboardManager* keyboardManager)
Sets the attributed text of the ITextInputController.

Parameters

attributedText
com.amazon.kepler.uitoolkit.graphics.IAttributedText* — Required Pointer to IAttributedText object to set the text of ITextInputController.
keyboardManager
IKeyboardManager* — Required Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance. To acquire the instance of ITextInputController, developers will need to query this interface using tryQueryInterface on IKeyboardManager instance.

getAttributedText()

com.amazon.kepler.uitoolkit.graphics.IAttributedText* getAttributedText(IKeyboardManager* keyboardManager)
Returns the current attributed text displayed on the ITextInputController.

Parameters

keyboardManager
IKeyboardManager* — Required Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance.

Returns

com.amazon.kepler.uitoolkit.graphics.IAttributedText* Pointer to IAttributedText object of the ITextInputController. To acquire the instance of ITextInputController, developers will need to query this interface using tryQueryInterface on IKeyboardManager instance.

insert()

void insert(com.amazon.kepler.uitoolkit.graphics.IAttributedText* attributedText, IKeyboardManager* keyboardManager)
Inserts text into the current position.

Parameters

attributedText
com.amazon.kepler.uitoolkit.graphics.IAttributedText* — Required Pointer to IAttributedText object to set the text of ITextInputController.
keyboardManager
IKeyboardManager* — Required Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance. To acquire the instance of ITextInputController, developers will need to query this interface using tryQueryInterface on IKeyboardManager instance.

remove()

void remove(bool nextCharacter, IKeyboardManager* keyboardManager)
Removes the selected characters, otherwise if no characters are selected remove one character next or previous depending on the input parameter.

Parameters

nextCharacter
bool — Required If false, then remove the previous character of the current position, otherwise remove the next character.
keyboardManager
IKeyboardManager* — Required Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance. To acquire the instance of ITextInputController, developers will need to query this interface using tryQueryInterface on IKeyboardManager instance.

replace()

void replace(com.amazon.kepler.uitoolkit.graphics.IAttributedText* attributedText, IKeyboardManager* keyboardManager)
Replaces the selected characters if selected, otherwise replaces the entire text of ITextInputController with the new attributed text.

Parameters

attributedText
com.amazon.kepler.uitoolkit.graphics.IAttributedText* — Required Pointer to IAttributedText object to replace the old text of ITextInputController.
keyboardManager
IKeyboardManager* — Required Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance. To acquire the instance of ITextInputController, developers will need to query this interface using tryQueryInterface on IKeyboardManager instance.

isSecure()

bool isSecure(IKeyboardManager* keyboardManager)
Returns true if the ITextInputController text is secure.

Parameters

keyboardManager
IKeyboardManager* — Required Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance.

Returns

bool bool true if the text is secure, else false. To acquire the instance of ITextInputController, developers will need to query this interface using tryQueryInterface on IKeyboardManager instance.

invalidate()

void invalidate(IKeyboardManager* keyboardManager)
Invalidates the current state of ITextInputController to trigger a repaint.

Parameters

keyboardManager
IKeyboardManager* — Required Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance. To acquire the instance of ITextInputController, developers will need to query this interface using tryQueryInterface on IKeyboardManager instance.

begin()

u32 begin(IKeyboardManager* keyboardManager)
Returns the starting position of the current selection.

Parameters

keyboardManager
IKeyboardManager* — Required Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance.

Returns

u32 Begin of the current selection. To acquire the instance of ITextInputController, developers will need to query this interface using tryQueryInterface on IKeyboardManager instance.

end()

u32 end(IKeyboardManager* keyboardManager)
Returns the ending position of the current selection.

Parameters

keyboardManager
IKeyboardManager* — Required Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance.

Returns

u32 End of the current selection. To acquire the instance of ITextInputController, developers will need to query this interface using tryQueryInterface on IKeyboardManager instance.

setPosition()

void setPosition(u32 position, IKeyboardManager* keyboardManager)
Sets the position and an empty selection.

Parameters

position
u32 — Required New position.
keyboardManager
IKeyboardManager* — Required Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance. To acquire the instance of ITextInputController, developers will need to query this interface using tryQueryInterface on IKeyboardManager instance.

getPosition()

u32 getPosition(IKeyboardManager* keyboardManager)
Gets the position and an empty selection.

Parameters

keyboardManager
IKeyboardManager* — Required Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance.

Returns

u32 Current position of the cursor. To acquire the instance of ITextInputController, developers will need to query this interface using tryQueryInterface on IKeyboardManager instance.

setSelection()

void setSelection(u32 start, u32 end, IKeyboardManager* keyboardManager)
Sets the text selection bounds using the start and end indices. The default selection is 0,0. It is like text highlighting.

Parameters

start
u32 — Required Index to start the selection from.
end
u32 — Required Index to stop the selection at.
keyboardManager
IKeyboardManager* — Required Pointer to the IKeyboardManager instance, created using this ITextInputControllerDelegate instance. To acquire the instance of ITextInputController, developers will need to query this interface using tryQueryInterface on IKeyboardManager instance.
Last modified on October 29, 2026