Dela via


KeyboardCapabilities Class

Definition

Provides the ability to determine the capabilities of any connected hardware keyboards.

public ref class KeyboardCapabilities sealed
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class KeyboardCapabilities final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class KeyboardCapabilities final
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class KeyboardCapabilities
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class KeyboardCapabilities
function KeyboardCapabilities()
Public NotInheritable Class KeyboardCapabilities
Inheritance
Object Platform::Object IInspectable KeyboardCapabilities
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

The Device Capabilities Sample demonstrates how to detect the presence of input devices and retrieve the capabilities and attributes of each device.

The following code shows how to create an instance of this class and use it to determine if a keyboard is present.

function getKeyboardCapabilities() {
  var keyboardCapabilities = new Windows.Devices.Input.KeyboardCapabilities();
  id("keyboardPresent").innerHTML = keyboardCapabilities.keyboardPresent;
}

Constructors

KeyboardCapabilities()

Initializes a new instance of the KeyboardCapabilities class.

Properties

KeyboardPresent

Gets a value that indicates whether a device identifying itself as a keyboard is detected.

Applies to

See also