InjectedInputKeyboardInfo Class

Definition

Represents programmatically generated keyboard input, such as a Tab or Shift+Tab (Reverse Tabbing).

public ref class InjectedInputKeyboardInfo sealed
/// [Windows.Foundation.Metadata.Activatable(196608, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 196608)]
class InjectedInputKeyboardInfo final
[Windows.Foundation.Metadata.Activatable(196608, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 196608)]
public sealed class InjectedInputKeyboardInfo
function InjectedInputKeyboardInfo()
Public NotInheritable Class InjectedInputKeyboardInfo
Inheritance
Object IInspectable InjectedInputKeyboardInfo
Attributes

Windows requirements

Device family
Windows 10 Anniversary Edition (introduced in 10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v3.0)

Examples

Here are some downloadable samples demonstrating basic input and input injection:

Remarks

Important

The APIs in this namespace require the inputInjectionBrokered restricted capability.

Using input injection requires the following be added to the Package.appxmanifest:

  • To <Package>
    • xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
    • IgnorableNamespaces="rescap"
  • To <Capabilities>
    • <rescap:Capability Name="inputInjectionBrokered" />

Injecting too many keystrokes in a single call to InjectKeyboardInput can result in an ArgumentException.

Constructors

InjectedInputKeyboardInfo()

Creates a new InjectedInputKeyboardInfo object that is used to specify the keyboard input to inject.

Properties

KeyOptions

Gets or sets the various options, or modifiers, used to simulate input from physical or virtual keyboards.

ScanCode

Gets or sets an OEM, device-dependent identifier for a key on a physical keyboard.

Note

A keyboard generates two scan codes when the user types a key—one when the user presses the key and another when the user releases the key.

VirtualKey

Gets or sets a device-independent identifier mapped to a key on a physical or software keyboard.

Applies to

See also