CoreComponentInputSource CoreComponentInputSource CoreComponentInputSource Class

Provides a mechanism to receive input for a XAML framework element hosted in another framework, such as a DirectX interop framework.

Syntax

Declaration

public sealed class CoreComponentInputSourcepublic sealed class CoreComponentInputSourcePublic NotInheritable Class CoreComponentInputSource

Properties summary

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

Indicates whether the input device supports input capture.

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

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

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

Gets the current pointer position in the hosted XAML framework.

Methods summary

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

GetCurrentKeyEventDeviceId() is not supported for all input devices.

Gets the current status of a virtual key press.

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

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

Events summary

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

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.

Raised when a hosted XAML element gets focus.

Raised when the hosted XAML control is enabled for input.

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

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

Raised when a hosted XAML element loses focus.

Raised when the pointer input capture stream is lost.

Raised when the pointer enters the hosted XAML element.

Raised when the pointer exits the hosted XAML element.

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

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

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

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

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

Properties

  • Dispatcher
    Dispatcher
    Dispatcher
    Dispatcher

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

    public CoreDispatcher Dispatcher { get; }public CoreDispatcher Dispatcher { get; }Public ReadOnly Property Dispatcher As CoreDispatcher

    Property Value

  • HasCapture
    HasCapture
    HasCapture
    HasCapture

    Indicates whether the input device supports input capture.

    public bool HasCapture { get; }public bool HasCapture { get; }Public ReadOnly Property HasCapture As bool

    Property Value

    • bool
      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 bool HasFocus { get; }public bool HasFocus { get; }Public ReadOnly Property HasFocus As bool

    Property Value

    • bool
      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 bool IsInputEnabled { get; set; }public bool IsInputEnabled { get; set; }Public ReadWrite Property IsInputEnabled As bool

    Property Value

    • bool
      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; }public CoreCursor PointerCursor { get; set; }Public ReadWrite Property PointerCursor As CoreCursor

    Property Value

  • PointerPosition
    PointerPosition
    PointerPosition
    PointerPosition

    Gets the current pointer position in the hosted XAML framework.

    public Point PointerPosition { get; }public Point PointerPosition { get; }Public ReadOnly Property PointerPosition As Point

    Property Value

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 string GetCurrentKeyEventDeviceId()public string GetCurrentKeyEventDeviceId()Public Function GetCurrentKeyEventDeviceId() As string

    Returns

    • string
      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.

    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(Windows.System.VirtualKey)
    GetCurrentKeyState(Windows.System.VirtualKey)
    GetCurrentKeyState(Windows.System.VirtualKey)
    GetCurrentKeyState(Windows.System.VirtualKey)

    Gets the current status of a virtual key press.

    public CoreVirtualKeyStates GetCurrentKeyState(Windows.System.VirtualKey virtualKey)public CoreVirtualKeyStates GetCurrentKeyState(Windows.System.VirtualKey virtualKey)Public Function GetCurrentKeyState(virtualKey As Windows.System.VirtualKey) As CoreVirtualKeyStates

    Parameters

    Returns

  • ReleasePointerCapture()
    ReleasePointerCapture()
    ReleasePointerCapture()
    ReleasePointerCapture()

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

    public void ReleasePointerCapture()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()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 CharacterReceivedpublic event TypedEventHandler CharacterReceivedPublic Event CharacterReceived
  • 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 ClosestInteractiveBoundsRequestedpublic event TypedEventHandler ClosestInteractiveBoundsRequestedPublic Event ClosestInteractiveBoundsRequested
  • GotFocus
    GotFocus
    GotFocus
    GotFocus

    Raised when a hosted XAML element gets focus.

    public event TypedEventHandler GotFocuspublic event TypedEventHandler GotFocusPublic Event GotFocus
  • InputEnabled
    InputEnabled
    InputEnabled
    InputEnabled

    Raised when the hosted XAML control is enabled for input.

    public event TypedEventHandler InputEnabledpublic event TypedEventHandler InputEnabledPublic Event InputEnabled
  • KeyDown
    KeyDown
    KeyDown
    KeyDown

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

    public event TypedEventHandler KeyDownpublic event TypedEventHandler KeyDownPublic Event KeyDown
  • KeyUp
    KeyUp
    KeyUp
    KeyUp

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

    public event TypedEventHandler KeyUppublic event TypedEventHandler KeyUpPublic Event KeyUp
  • LostFocus
    LostFocus
    LostFocus
    LostFocus

    Raised when a hosted XAML element loses focus.

    public event TypedEventHandler LostFocuspublic event TypedEventHandler LostFocusPublic Event LostFocus
  • PointerCaptureLost
    PointerCaptureLost
    PointerCaptureLost
    PointerCaptureLost

    Raised when the pointer input capture stream is lost.

    public event TypedEventHandler PointerCaptureLostpublic event TypedEventHandler PointerCaptureLostPublic Event PointerCaptureLost

    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 PointerEnteredpublic event TypedEventHandler PointerEnteredPublic Event PointerEntered
  • PointerExited
    PointerExited
    PointerExited
    PointerExited

    Raised when the pointer exits the hosted XAML element.

    public event TypedEventHandler PointerExitedpublic event TypedEventHandler PointerExitedPublic Event PointerExited
  • PointerMoved
    PointerMoved
    PointerMoved
    PointerMoved

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

    public event TypedEventHandler PointerMovedpublic event TypedEventHandler PointerMovedPublic Event PointerMoved
  • 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 PointerPressedpublic event TypedEventHandler PointerPressedPublic Event PointerPressed
  • 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 PointerReleasedpublic event TypedEventHandler PointerReleasedPublic Event PointerReleased
  • PointerWheelChanged
    PointerWheelChanged
    PointerWheelChanged
    PointerWheelChanged

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

    public event TypedEventHandler PointerWheelChangedpublic event TypedEventHandler PointerWheelChangedPublic Event PointerWheelChanged
  • TouchHitTesting
    TouchHitTesting
    TouchHitTesting
    TouchHitTesting

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

    public event TypedEventHandler TouchHitTestingpublic event TypedEventHandler TouchHitTestingPublic Event TouchHitTesting

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute
Windows.Foundation.Metadata.MuseAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute

Details

Assembly

Windows.UI.Core.dll