CharacterReceivedEventArgs CharacterReceivedEventArgs CharacterReceivedEventArgs CharacterReceivedEventArgs Class

Definition

Provides the arguments returned by the event raised when a character is received by the input queue.

public : sealed class CharacterReceivedEventArgs : ICharacterReceivedEventArgs, ICoreWindowEventArgs
struct winrt::Windows::UI::Core::CharacterReceivedEventArgs : ICharacterReceivedEventArgs, ICoreWindowEventArgs
public sealed class CharacterReceivedEventArgs : ICharacterReceivedEventArgs, ICoreWindowEventArgs
Public NotInheritable Class CharacterReceivedEventArgs Implements ICharacterReceivedEventArgs, ICoreWindowEventArgs
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Windows 10 Apps do not receive this event when an Input Method Editor (IME) is enabled. The Input Method Editor (IME) handles all keyboard input and sets Handled to true.

Windows Phone This API is supported in native apps only.

This object is returned by a delegate registered for the following event:

void SetWindow(CoreWindow const& window)
{
    ...
    window.CharacterReceived({this, &App::OnCharacterReceived });
}

// Character received event data in CharacterReceivedEventArgs.
void OnCharacterReceived(
    Windows::UI::Core::CoreWindow const& /* sender */,
    Windows::UI::Core::CharacterReceivedEventArgs const& /* args */)
{
}
// returning character received events data through CharacterReceivedEventArgs

void MyCoreWindowEvents::SetWindow( // implementation called by CoreApplication::Run(), provided for context
    _In_ CoreWindow^ window
    )
{
    // ...
    window->CharacterReceived +=
        ref new TypedEventHandler<CoreWindow^, CharacterReceivedEventArgs^>(this, &CoreWindowEvents::OnCharacterReceived);
    // ...
}

Note

: This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX).

Properties

Handled Handled Handled Handled

Gets or sets whether the character-received event was handled or not.

KeyCode KeyCode KeyCode KeyCode

Gets the key code of the character received by the input queue.

KeyStatus KeyStatus KeyStatus KeyStatus

Gets the status of the physical key press that raised the character-received event.

See Also