CoreComponentInputSource CoreComponentInputSource CoreComponentInputSource CoreComponentInputSource Class

Definition

Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Prerelease APIs are identified by a Prerelease label.

[Contains prerelease APIs.]
Provides a mechanism to receive input for a XAML framework element hosted in another framework, such as a DirectX interop framework.

public : sealed class CoreComponentInputSource : ICoreClosestInteractiveBoundsRequested, ICoreComponentFocusable, ICoreInputSourceBase, ICoreKeyboardInputSource, ICoreKeyboardInputSource2, ICorePointerInputSource, ICoreTouchHitTesting
struct winrt::Windows::UI::Core::CoreComponentInputSource : ICoreClosestInteractiveBoundsRequested, ICoreComponentFocusable, ICoreInputSourceBase, ICoreKeyboardInputSource, ICoreKeyboardInputSource2, ICorePointerInputSource, ICoreTouchHitTesting
public sealed class CoreComponentInputSource : ICoreClosestInteractiveBoundsRequested, ICoreComponentFocusable, ICoreInputSourceBase, ICoreKeyboardInputSource, ICoreKeyboardInputSource2, ICorePointerInputSource, ICoreTouchHitTesting
Public NotInheritable Class CoreComponentInputSource Implements ICoreClosestInteractiveBoundsRequested, ICoreComponentFocusable, ICoreInputSourceBase, ICoreKeyboardInputSource, ICoreKeyboardInputSource2, ICorePointerInputSource, ICoreTouchHitTesting
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The CoreComponentInputSource class enables an app to handle input for a XAML framework element hosted in another framework, such as a DirectX interop framework. Call the CoreComponentInputSource.DispatcherQueue property to get the DispatcherQueue of the thread where the CoreComponentInputSource was instantiated.

Properties

Dispatcher Dispatcher Dispatcher Dispatcher

Gets the input event dispatcher for the hosted XAML framework element.

public : CoreDispatcher Dispatcher { get; }
CoreDispatcher Dispatcher();
public CoreDispatcher Dispatcher { get; }
Public ReadOnly Property Dispatcher As CoreDispatcher
Value
CoreDispatcher CoreDispatcher

The CoreDispatcher for the hosted XAML framework element.

DispatcherQueue DispatcherQueue DispatcherQueue DispatcherQueue

Prerelease. Gets the DispatcherQueue associated with this CoreComponentInputSource.

public : DispatcherQueue DispatcherQueue { get; }
DispatcherQueue DispatcherQueue();
public DispatcherQueue DispatcherQueue { get; }
Public ReadOnly Property DispatcherQueue As DispatcherQueue
Value
DispatcherQueue DispatcherQueue

The DispatcherQueue for managing prioritized tasks that execute in a serial fashion on a thread.

Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.17095.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v6)

Remarks

Some platform objects require thread affinity for posting events back to the thread where the object was instantiated. The DispatcherQueue lets you post work to this thread.

These platform objects can be created on the UI thread, where the DispatcherQueue already exists, or they can be created on a long running, non-UI thread with a DispatcherQueue created with the DispatcherQueueController.CreateOnDedicatedThread method.

HasCapture HasCapture HasCapture HasCapture

Indicates whether the input device supports input capture.

public : Platform::Boolean HasCapture { get; }
bool HasCapture();
public bool HasCapture { get; }
Public ReadOnly Property HasCapture As bool
Value
bool bool

true if the input device supports capture (recording of input data); false if it does not.

HasFocus HasFocus HasFocus HasFocus

Gets whether the current hosted XAML control element has focus. If it does, keyboard input is delivered to that control.

public : Platform::Boolean HasFocus { get; }
bool HasFocus();
public bool HasFocus { get; }
Public ReadOnly Property HasFocus As bool
Value
bool bool

true if the element has focus; false if it does not.

IsInputEnabled IsInputEnabled IsInputEnabled IsInputEnabled

Gets or sets whether input is enabled for the hosted XAML framework element.

public : Platform::Boolean IsInputEnabled { get; set; }
bool IsInputEnabled(); void IsInputEnabled(bool isinputenabled);
public bool IsInputEnabled { get; set; }
Public ReadWrite Property IsInputEnabled As bool
Value
bool bool

true if input is enabled; false if it is not.

PointerCursor PointerCursor PointerCursor PointerCursor

Gets the pointer cursor behavior for interactions with the hosted XAML framework element.

public : CoreCursor PointerCursor { get; set; }
CoreCursor PointerCursor(); void PointerCursor(CoreCursor pointercursor);
public CoreCursor PointerCursor { get; set; }
Public ReadWrite Property PointerCursor As CoreCursor
Value
CoreCursor CoreCursor

The pointer cursor object.

PointerPosition PointerPosition PointerPosition PointerPosition

Gets the current pointer position in the hosted XAML framework.

public : Point PointerPosition { get; }
Point PointerPosition();
public Point PointerPosition { get; }
Public ReadOnly Property PointerPosition As Point
Value
Point Point

The current pointer position.

Methods

GetCurrentKeyEventDeviceId() GetCurrentKeyEventDeviceId() GetCurrentKeyEventDeviceId() GetCurrentKeyEventDeviceId()

Retrieves the unique ID for the input device that generated this key event.

GetCurrentKeyEventDeviceId is not supported for all input devices.

public : Platform::String GetCurrentKeyEventDeviceId()
winrt::hstring GetCurrentKeyEventDeviceId() const;
public string GetCurrentKeyEventDeviceId()
Public Function GetCurrentKeyEventDeviceId() As string
Returns
string string

A unique identifier for the input device associated with the key event, or an empty string. The same device can be assigned a different ID each time it is connected.

After a key event is processed, this method returns an empty string.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

Use GetCurrentKeyEventDeviceId to differentiate between devices that can generate key events, such as multiple Xbox controllers. The device id is useful for associating the input device with a specific user account.

To get a valid device ID, this method must be called from your KeyUp and KeyDown event handlers.

GetCurrentKeyState(VirtualKey) GetCurrentKeyState(VirtualKey) GetCurrentKeyState(VirtualKey) GetCurrentKeyState(VirtualKey)

Gets the current status of a virtual key press.

public : CoreVirtualKeyStates GetCurrentKeyState(VirtualKey virtualKey)
CoreVirtualKeyStates GetCurrentKeyState(VirtualKey virtualKey) const;
public CoreVirtualKeyStates GetCurrentKeyState(VirtualKey virtualKey)
Public Function GetCurrentKeyState(virtualKey As VirtualKey) As CoreVirtualKeyStates
Parameters
virtualKey
VirtualKey VirtualKey

The key from which to retrieve status.

Returns

The flags indicating the current state of the supplied virtual key when the input event fired.

Note

All keys support the Locked state (not just the standard Caps Lock and Num Lock keys).

ReleasePointerCapture() ReleasePointerCapture() ReleasePointerCapture() ReleasePointerCapture()

Stops the capture of pointer input data (if the pointing device supports input capture).

public : void ReleasePointerCapture()
void ReleasePointerCapture() const;
public void ReleasePointerCapture()
Public Function ReleasePointerCapture() As void

SetPointerCapture() SetPointerCapture() SetPointerCapture() SetPointerCapture()

Starts the capture of pointer input data (if the pointing device supports input capture).

public : void SetPointerCapture()
void SetPointerCapture() const;
public void SetPointerCapture()
Public Function SetPointerCapture() As void

Events

CharacterReceived CharacterReceived CharacterReceived CharacterReceived

Raised when a character is received (such as from a completed key press sequence) by the hosted XAML element.

public : event TypedEventHandler CharacterReceived<Platform::Object, CharacterReceivedEventArgs>
// Register
event_token CharacterReceived(TypedEventHandler<Platform::Object, CharacterReceivedEventArgs> const& handler) const;

// Revoke with event_token
void CharacterReceived(event_token const& cookie) const;

// Revoke with event_revoker
CharacterReceived_revoker CharacterReceived(auto_revoker_t, TypedEventHandler<Platform::Object, CharacterReceivedEventArgs> const& handler) const;
public event TypedEventHandler CharacterReceived<object, CharacterReceivedEventArgs>
Public Event TypedEventHandler CharacterReceived( Of ( Of object ), ( Of CharacterReceivedEventArgs ))

ClosestInteractiveBoundsRequested ClosestInteractiveBoundsRequested ClosestInteractiveBoundsRequested ClosestInteractiveBoundsRequested

Note

Not intended for general use.

Occurs when a framework input manager requests the bounding rectangle of an interactive element within a specific bounding rectangle and closest to a specific pointer.

public : event TypedEventHandler ClosestInteractiveBoundsRequested<CoreComponentInputSource, ClosestInteractiveBoundsRequestedEventArgs>
// Register
event_token ClosestInteractiveBoundsRequested(TypedEventHandler<CoreComponentInputSource, ClosestInteractiveBoundsRequestedEventArgs> const& handler) const;

// Revoke with event_token
void ClosestInteractiveBoundsRequested(event_token const& cookie) const;

// Revoke with event_revoker
ClosestInteractiveBoundsRequested_revoker ClosestInteractiveBoundsRequested(auto_revoker_t, TypedEventHandler<CoreComponentInputSource, ClosestInteractiveBoundsRequestedEventArgs> const& handler) const;
public event TypedEventHandler ClosestInteractiveBoundsRequested<CoreComponentInputSource, ClosestInteractiveBoundsRequestedEventArgs>
Public Event TypedEventHandler ClosestInteractiveBoundsRequested( Of ( Of CoreComponentInputSource ), ( Of ClosestInteractiveBoundsRequestedEventArgs ))
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

GotFocus GotFocus GotFocus GotFocus

Raised when a hosted XAML element gets focus.

public : event TypedEventHandler GotFocus<Platform::Object, CoreWindowEventArgs>
// Register
event_token GotFocus(TypedEventHandler<Platform::Object, CoreWindowEventArgs> const& handler) const;

// Revoke with event_token
void GotFocus(event_token const& cookie) const;

// Revoke with event_revoker
GotFocus_revoker GotFocus(auto_revoker_t, TypedEventHandler<Platform::Object, CoreWindowEventArgs> const& handler) const;
public event TypedEventHandler GotFocus<object, CoreWindowEventArgs>
Public Event TypedEventHandler GotFocus( Of ( Of object ), ( Of CoreWindowEventArgs ))

InputEnabled InputEnabled InputEnabled InputEnabled

Raised when the hosted XAML control is enabled for input.

public : event TypedEventHandler InputEnabled<Platform::Object, InputEnabledEventArgs>
// Register
event_token InputEnabled(TypedEventHandler<Platform::Object, InputEnabledEventArgs> const& handler) const;

// Revoke with event_token
void InputEnabled(event_token const& cookie) const;

// Revoke with event_revoker
InputEnabled_revoker InputEnabled(auto_revoker_t, TypedEventHandler<Platform::Object, InputEnabledEventArgs> const& handler) const;
public event TypedEventHandler InputEnabled<object, InputEnabledEventArgs>
Public Event TypedEventHandler InputEnabled( Of ( Of object ), ( Of InputEnabledEventArgs ))

KeyDown KeyDown KeyDown KeyDown

Raised when a key is pressed for the current active hosted XAML element.

public : event TypedEventHandler KeyDown<Platform::Object, KeyEventArgs>
// Register
event_token KeyDown(TypedEventHandler<Platform::Object, KeyEventArgs> const& handler) const;

// Revoke with event_token
void KeyDown(event_token const& cookie) const;

// Revoke with event_revoker
KeyDown_revoker KeyDown(auto_revoker_t, TypedEventHandler<Platform::Object, KeyEventArgs> const& handler) const;
public event TypedEventHandler KeyDown<object, KeyEventArgs>
Public Event TypedEventHandler KeyDown( Of ( Of object ), ( Of KeyEventArgs ))

KeyUp KeyUp KeyUp KeyUp

Raised when a key press is released for the current active hosted XAML element.

public : event TypedEventHandler KeyUp<Platform::Object, KeyEventArgs>
// Register
event_token KeyUp(TypedEventHandler<Platform::Object, KeyEventArgs> const& handler) const;

// Revoke with event_token
void KeyUp(event_token const& cookie) const;

// Revoke with event_revoker
KeyUp_revoker KeyUp(auto_revoker_t, TypedEventHandler<Platform::Object, KeyEventArgs> const& handler) const;
public event TypedEventHandler KeyUp<object, KeyEventArgs>
Public Event TypedEventHandler KeyUp( Of ( Of object ), ( Of KeyEventArgs ))

LostFocus LostFocus LostFocus LostFocus

Raised when a hosted XAML element loses focus.

public : event TypedEventHandler LostFocus<Platform::Object, CoreWindowEventArgs>
// Register
event_token LostFocus(TypedEventHandler<Platform::Object, CoreWindowEventArgs> const& handler) const;

// Revoke with event_token
void LostFocus(event_token const& cookie) const;

// Revoke with event_revoker
LostFocus_revoker LostFocus(auto_revoker_t, TypedEventHandler<Platform::Object, CoreWindowEventArgs> const& handler) const;
public event TypedEventHandler LostFocus<object, CoreWindowEventArgs>
Public Event TypedEventHandler LostFocus( Of ( Of object ), ( Of CoreWindowEventArgs ))

PointerCaptureLost PointerCaptureLost PointerCaptureLost PointerCaptureLost

Raised when the pointer input capture stream is lost.

public : event TypedEventHandler PointerCaptureLost<Platform::Object, PointerEventArgs>
// Register
event_token PointerCaptureLost(TypedEventHandler<Platform::Object, PointerEventArgs> const& handler) const;

// Revoke with event_token
void PointerCaptureLost(event_token const& cookie) const;

// Revoke with event_revoker
PointerCaptureLost_revoker PointerCaptureLost(auto_revoker_t, TypedEventHandler<Platform::Object, PointerEventArgs> const& handler) const;
public event TypedEventHandler PointerCaptureLost<object, PointerEventArgs>
Public Event TypedEventHandler PointerCaptureLost( Of ( Of object ), ( Of PointerEventArgs ))

Remarks

This event is only raised if the input device supports pointer data capture.

PointerEntered PointerEntered PointerEntered PointerEntered

Raised when the pointer enters the hosted XAML element.

public : event TypedEventHandler PointerEntered<Platform::Object, PointerEventArgs>
// Register
event_token PointerEntered(TypedEventHandler<Platform::Object, PointerEventArgs> const& handler) const;

// Revoke with event_token
void PointerEntered(event_token const& cookie) const;

// Revoke with event_revoker
PointerEntered_revoker PointerEntered(auto_revoker_t, TypedEventHandler<Platform::Object, PointerEventArgs> const& handler) const;
public event TypedEventHandler PointerEntered<object, PointerEventArgs>
Public Event TypedEventHandler PointerEntered( Of ( Of object ), ( Of PointerEventArgs ))

PointerExited PointerExited PointerExited PointerExited

Raised when the pointer exits the hosted XAML element.

public : event TypedEventHandler PointerExited<Platform::Object, PointerEventArgs>
// Register
event_token PointerExited(TypedEventHandler<Platform::Object, PointerEventArgs> const& handler) const;

// Revoke with event_token
void PointerExited(event_token const& cookie) const;

// Revoke with event_revoker
PointerExited_revoker PointerExited(auto_revoker_t, TypedEventHandler<Platform::Object, PointerEventArgs> const& handler) const;
public event TypedEventHandler PointerExited<object, PointerEventArgs>
Public Event TypedEventHandler PointerExited( Of ( Of object ), ( Of PointerEventArgs ))

PointerMoved PointerMoved PointerMoved PointerMoved

Raised when the pointer is moved for the active hosted XAML element.

public : event TypedEventHandler PointerMoved<Platform::Object, PointerEventArgs>
// Register
event_token PointerMoved(TypedEventHandler<Platform::Object, PointerEventArgs> const& handler) const;

// Revoke with event_token
void PointerMoved(event_token const& cookie) const;

// Revoke with event_revoker
PointerMoved_revoker PointerMoved(auto_revoker_t, TypedEventHandler<Platform::Object, PointerEventArgs> const& handler) const;
public event TypedEventHandler PointerMoved<object, PointerEventArgs>
Public Event TypedEventHandler PointerMoved( Of ( Of object ), ( Of PointerEventArgs ))

PointerPressed PointerPressed PointerPressed PointerPressed

Raised when the pointer is "pressed" (such as a mouse button click or full screen press) for the active hosted XAML element.

public : event TypedEventHandler PointerPressed<Platform::Object, PointerEventArgs>
// Register
event_token PointerPressed(TypedEventHandler<Platform::Object, PointerEventArgs> const& handler) const;

// Revoke with event_token
void PointerPressed(event_token const& cookie) const;

// Revoke with event_revoker
PointerPressed_revoker PointerPressed(auto_revoker_t, TypedEventHandler<Platform::Object, PointerEventArgs> const& handler) const;
public event TypedEventHandler PointerPressed<object, PointerEventArgs>
Public Event TypedEventHandler PointerPressed( Of ( Of object ), ( Of PointerEventArgs ))

PointerReleased PointerReleased PointerReleased PointerReleased

Raised when the pointer is released (such as when a mouse button click or screen press is released) for the active hosted XAML element.

public : event TypedEventHandler PointerReleased<Platform::Object, PointerEventArgs>
// Register
event_token PointerReleased(TypedEventHandler<Platform::Object, PointerEventArgs> const& handler) const;

// Revoke with event_token
void PointerReleased(event_token const& cookie) const;

// Revoke with event_revoker
PointerReleased_revoker PointerReleased(auto_revoker_t, TypedEventHandler<Platform::Object, PointerEventArgs> const& handler) const;
public event TypedEventHandler PointerReleased<object, PointerEventArgs>
Public Event TypedEventHandler PointerReleased( Of ( Of object ), ( Of PointerEventArgs ))

PointerWheelChanged PointerWheelChanged PointerWheelChanged PointerWheelChanged

Raised when the mouse wheel is rotated for the active hosted XAML element.

public : event TypedEventHandler PointerWheelChanged<Platform::Object, PointerEventArgs>
// Register
event_token PointerWheelChanged(TypedEventHandler<Platform::Object, PointerEventArgs> const& handler) const;

// Revoke with event_token
void PointerWheelChanged(event_token const& cookie) const;

// Revoke with event_revoker
PointerWheelChanged_revoker PointerWheelChanged(auto_revoker_t, TypedEventHandler<Platform::Object, PointerEventArgs> const& handler) const;
public event TypedEventHandler PointerWheelChanged<object, PointerEventArgs>
Public Event TypedEventHandler PointerWheelChanged( Of ( Of object ), ( Of PointerEventArgs ))

TouchHitTesting TouchHitTesting TouchHitTesting TouchHitTesting

Raised for a touch hit test on a hosted XAML element.

public : event TypedEventHandler TouchHitTesting<Platform::Object, TouchHitTestingEventArgs>
// Register
event_token TouchHitTesting(TypedEventHandler<Platform::Object, TouchHitTestingEventArgs> const& handler) const;

// Revoke with event_token
void TouchHitTesting(event_token const& cookie) const;

// Revoke with event_revoker
TouchHitTesting_revoker TouchHitTesting(auto_revoker_t, TypedEventHandler<Platform::Object, TouchHitTestingEventArgs> const& handler) const;
public event TypedEventHandler TouchHitTesting<object, TouchHitTestingEventArgs>
Public Event TypedEventHandler TouchHitTesting( Of ( Of object ), ( Of TouchHitTestingEventArgs ))