KeyboardInputBuffer KeyboardInputBuffer KeyboardInputBuffer KeyboardInputBuffer Class

Definition

Provides access to a text buffer that is used to aggregate user input to the Software Input Panel keyboard on the phone.

public : sealed class KeyboardInputBuffer : IKeyboardInputBuffer
public sealed class KeyboardInputBuffer : IKeyboardInputBuffer
Public NotInheritable Class KeyboardInputBuffer Implements IKeyboardInputBuffer
var keyboardInputBuffer = new keyboardInputBuffer();
Attributes
Windows 10 requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneInternalContract (introduced v1)

Remarks

Windows Phone 8

This API is supported in native apps only.

Constructors

KeyboardInputBuffer() KeyboardInputBuffer() KeyboardInputBuffer() KeyboardInputBuffer()

Initializes a new instance of the KeyboardInputBuffer class.

public : KeyboardInputBuffer()
public KeyboardInputBuffer()
Public Sub New()
var keyboardInputBuffer = new keyboardInputBuffer();

Properties

InputScope InputScope InputScope InputScope

Gets or sets the input scope which determines the set of keys displayed on the Software Input Panel keyboard on the phone

public : CoreInputScope InputScope { get; set; }
public CoreInputScope InputScope { get; set; }
Public ReadWrite Property InputScope As CoreInputScope
var coreInputScope = keyboardInputBuffer.inputScope;
keyboardInputBuffer.inputScope = coreInputScope;

Remarks

The default input scope is CoreInputScope::Text.

SelectionLength SelectionLength SelectionLength SelectionLength

Gets the number of characters in the current selection in the input buffer.

public : unsigned int SelectionLength { get; }
public uint SelectionLength { get; }
Public ReadOnly Property SelectionLength As uint
var uint = keyboardInputBuffer.selectionLength;
Value
unsigned int uint uint uint

The number of characters in the current selection, or 0 if there is no selection.

SelectionStart SelectionStart SelectionStart SelectionStart

Gets the starting position of the text selected in the input buffer.

public : unsigned int SelectionStart { get; }
public uint SelectionStart { get; }
Public ReadOnly Property SelectionStart As uint
var uint = keyboardInputBuffer.selectionStart;
Value
unsigned int uint uint uint

The starting position of the current selection.

Text Text Text Text

Gets or sets the contents of the input buffer.

public : Platform::String Text { get; set; }
public string Text { get; set; }
Public ReadWrite Property Text As string
var string = keyboardInputBuffer.text;
keyboardInputBuffer.text = string;
Value
Platform::String string string string

A string containing the text contents of the input buffer. The default is an empty string ("").

Methods

Select(UInt32, UInt32) Select(UInt32, UInt32) Select(UInt32, UInt32) Select(UInt32, UInt32)

Selects a range of text in the input buffer.

public : void Select(unsigned int start, unsigned int length)
public void Select(UInt32 start, UInt32 length)
Public Function Select(start As UInt32, length As UInt32) As void
keyboardInputBuffer.select(start, length);
Parameters
start
unsigned int UInt32 UInt32 UInt32

The zero-based index of the first character in the selection.

length
unsigned int UInt32 UInt32 UInt32

The length of the selection, in characters.

SelectFromTap(UInt32) SelectFromTap(UInt32) SelectFromTap(UInt32) SelectFromTap(UInt32)

Selects a range of text as if the user had tapped on the specified character in the input buffer.

public : void SelectFromTap(unsigned int characterIndex)
public void SelectFromTap(UInt32 characterIndex)
Public Function SelectFromTap(characterIndex As UInt32) As void
keyboardInputBuffer.selectFromTap(characterIndex);
Parameters
characterIndex
unsigned int UInt32 UInt32 UInt32

The character in the text input buffer from which the tap selection is performed.

Events

SelectionChanged SelectionChanged SelectionChanged SelectionChanged

Occurs when the text selection within the input buffer has changed.

public : event TypedEventHandler SelectionChanged<KeyboardInputBuffer,  CoreSelectionChangedEventArgs>
public event TypedEventHandler SelectionChanged<KeyboardInputBuffer,  CoreSelectionChangedEventArgs>
Public Event TypedEventHandler SelectionChanged( Of ( Of KeyboardInputBuffer ), ( Of  CoreSelectionChangedEventArgs ))
function onSelectionChanged(eventArgs){/* Your code */}


keyboardInputBuffer.addEventListener("selectionChanged", onSelectionChanged);
keyboardInputBuffer.removeEventListener("selectionChanged", onSelectionChanged);

TextChanged TextChanged TextChanged TextChanged

Occurs when the content changes in the input buffer.

public : event TypedEventHandler TextChanged<KeyboardInputBuffer,  CoreTextChangedEventArgs>
public event TypedEventHandler TextChanged<KeyboardInputBuffer,  CoreTextChangedEventArgs>
Public Event TypedEventHandler TextChanged( Of ( Of KeyboardInputBuffer ), ( Of  CoreTextChangedEventArgs ))
function onTextChanged(eventArgs){/* Your code */}


keyboardInputBuffer.addEventListener("textChanged", onTextChanged);
keyboardInputBuffer.removeEventListener("textChanged", onTextChanged);