cohtml.TextInputHandler

Implementation of the cohtml.Net.ITextInputHandler interface. Provides events when input fields are focused, unfocused or their input caret position changes. Manages IME compositions.

Inherits from cohtml.Net.ITextInputHandler, SystemIDisposable

Public Functions

Name
TextInputHandler()
Default constructor.
virtual override voidOnFocus(IInputProxy proxy)
When the element is focused, a callback method is received from Cohtml.
virtual override voidOnBlur(IInputProxy proxy)
When the element loses focus, a callback method is received from Cohtml.
TGetAttributeValue< T >(string attribute)
virtual override voidOnSelectionChanged(IInputProxy proxy, Selection selection)
Notifies that the selection in an input element has changed, including change of the caret position.
voidUpdateImeComposition(KeyEventData keyData)
Notifies Cohtml that IME compositions should be updated. This method must be called when your text in the UI changes(e.g. when sending keyboard events to the UI).
voidImeSetComposition(KeyEventData keyData)
Displaying and collecting the initiated IME composition in the input field.
voidImeEndComposition()
When the composition ends, clear the accumulated composition before the new text segment is written. Reset cached text.

Public Properties

Name
stringInputText
It returns the entire text from the focused input element. An empty string if it doesn’t contain any text.
Action< string >OnFocusCallback
Focus callback, which will be invoked when an input field is focused.
Func< string >OnBlurCallback
Focus callback, which will be invoked when an input field is unfocused.
Action< IInputProxy, Selection >OnSelectionChangedCallback
This callback will be triggered when the selection of the input field’s caret changes.

Additional inherited members

Public Functions inherited from cohtml.Net.ITextInputHandler

Name
virtual voidDispose()
ITextInputHandler()
virtual voidOnTextChanged(IInputProxy proxy, string addedChars, uint addedCount, string removedChars, uint removedCount, uint index)
Notifies that the text in an input element has changed.
delegate voidSwigDelegateITextInputHandler_0(global.System.IntPtr proxy, global.System.IntPtr selection, global.System.IntPtr swigId)
delegate voidSwigDelegateITextInputHandler_1(global.System.IntPtr proxy, string addedChars, uint addedCount, string removedChars, uint removedCount, uint index, global.System.IntPtr swigId)
delegate voidSwigDelegateITextInputHandler_2(global.System.IntPtr proxy, global.System.IntPtr swigId)
delegate voidSwigDelegateITextInputHandler_3(global.System.IntPtr proxy, global.System.IntPtr swigId)

Protected Attributes inherited from cohtml.Net.ITextInputHandler

Name
boolswigCMemOwn

Public Functions Documentation

function TextInputHandler

TextInputHandler()

Default constructor.

function OnFocus

virtual override void OnFocus(
    IInputProxy proxy
)

When the element is focused, a callback method is received from Cohtml.

Parameters:

  • proxy The affected element

Reimplements: cohtml.Net.ITextInputHandler.OnFocus

function OnBlur

virtual override void OnBlur(
    IInputProxy proxy
)

When the element loses focus, a callback method is received from Cohtml.

Parameters:

  • proxy the affected element

Reimplements: cohtml.Net.ITextInputHandler.OnBlur

function GetAttributeValue< T >

T GetAttributeValue< T >(
    string attribute
)

function OnSelectionChanged

virtual override void OnSelectionChanged(
    IInputProxy proxy,
    Selection selection
)

Notifies that the selection in an input element has changed, including change of the caret position.

Parameters:

  • proxy The affected element
  • selection The new selection

Reimplements: cohtml.Net.ITextInputHandler.OnSelectionChanged

function UpdateImeComposition

void UpdateImeComposition(
    KeyEventData keyData
)

Notifies Cohtml that IME compositions should be updated. This method must be called when your text in the UI changes(e.g. when sending keyboard events to the UI).

function ImeSetComposition

void ImeSetComposition(
    KeyEventData keyData
)

Displaying and collecting the initiated IME composition in the input field.

function ImeEndComposition

void ImeEndComposition()

When the composition ends, clear the accumulated composition before the new text segment is written. Reset cached text.

Public Property Documentation

property InputText

string InputText;

It returns the entire text from the focused input element. An empty string if it doesn’t contain any text.

property OnFocusCallback

Action< string > OnFocusCallback;

Focus callback, which will be invoked when an input field is focused.

property OnBlurCallback

Func< string > OnBlurCallback;

Focus callback, which will be invoked when an input field is unfocused.

property OnSelectionChangedCallback

Action< IInputProxy, Selection > OnSelectionChangedCallback;

This callback will be triggered when the selection of the input field’s caret changes.