Share via


InjectedInputKeyboardInfo.ScanCode Property

Definition

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.

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

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

Property Value

UInt16

unsigned short

uint16_t

The device-dependent 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