Share via


InjectedInputKeyboardInfo.VirtualKey Property

Definition

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

public:
 property unsigned short VirtualKey { unsigned short get(); void set(unsigned short value); };
uint16_t VirtualKey();

void VirtualKey(uint16_t value);
public ushort VirtualKey { get; set; }
var uInt16 = injectedInputKeyboardInfo.virtualKey;
injectedInputKeyboardInfo.virtualKey = uInt16;
Public Property VirtualKey As UShort

Property Value

UInt16

unsigned short

uint16_t

The device-independent identifier for the key on the keyboard.

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" />

Applies to

See also