AcceleratorKeyEventArgs AcceleratorKeyEventArgs AcceleratorKeyEventArgs Class

Provides the arguments returned by an accelerator key event callback.

Syntax

Declaration

public sealed class AcceleratorKeyEventArgspublic sealed class AcceleratorKeyEventArgsPublic NotInheritable Class AcceleratorKeyEventArgs

Remarks

Windows 10 Apps do not receive this event when an 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.

Properties summary

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

Use DeviceId to differentiate between devices that can generate key events, such as multiple Xbox controllers.

DeviceId is not supported for all input devices.

Gets the type of the accelerator key event that invoked the callback.

Gets or sets whether the accelerator key event was handled or not.

Gets the status of the accelerator key for which the event was raised.

Gets the virtual key code for the keypress in the accelerator key event.

Properties

  • DeviceId
    DeviceId
    DeviceId
    DeviceId

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

    Use DeviceId to differentiate between devices that can generate key events, such as multiple Xbox controllers.

    DeviceId is not supported for all input devices.

    public string DeviceId { get; }public string DeviceId { get; }Public ReadOnly Property DeviceId As stringpublic string DeviceId { get; }

    Property Value

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

    Remarks

    This property is useful for retrieving info for a specific user account associated with the input device.

  • EventType
    EventType
    EventType
    EventType

    Gets the type of the accelerator key event that invoked the callback.

    public CoreAcceleratorKeyEventType EventType { get; }public CoreAcceleratorKeyEventType EventType { get; }Public ReadOnly Property EventType As CoreAcceleratorKeyEventTypepublic CoreAcceleratorKeyEventType EventType { get; }

    Property Value

  • Handled
    Handled
    Handled
    Handled

    Gets or sets whether the accelerator key event was handled or not.

    public bool Handled { get; set; }public bool Handled { get; set; }Public ReadWrite Property Handled As boolpublic bool Handled { get; set; }

    Property Value

    • bool
      bool
      bool

      True if the accelerator key event has been handled; false if it has not.

    Remarks

    Windows 10 Apps do not receive this event when an 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.

  • KeyStatus
    KeyStatus
    KeyStatus
    KeyStatus

    Gets the status of the accelerator key for which the event was raised.

    public CorePhysicalKeyStatus KeyStatus { get; }public CorePhysicalKeyStatus KeyStatus { get; }Public ReadOnly Property KeyStatus As CorePhysicalKeyStatuspublic CorePhysicalKeyStatus KeyStatus { get; }

    Property Value

  • VirtualKey
    VirtualKey
    VirtualKey
    VirtualKey

    Gets the virtual key code for the keypress in the accelerator key event.

    public VirtualKey VirtualKey { get; }public VirtualKey VirtualKey { get; }Public ReadOnly Property VirtualKey As VirtualKeypublic VirtualKey VirtualKey { get; }

    Property Value

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

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

Details

Assembly

Windows.UI.Core.dll