InjectedInputKeyboardInfo.ScanCode Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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" />