KeyboardCapabilities 类

定义

提供确定任何已连接硬件键盘的功能的功能的功能。

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
继承
Object Platform::Object IInspectable KeyboardCapabilities
属性

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

注解

设备功能示例演示了如何检测是否存在输入设备并检索每个设备的功能和属性。

以下代码演示如何创建此类的实例并使用它来确定是否存在键盘。

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

构造函数

KeyboardCapabilities()

初始化 KeyboardCapabilities 类的新实例。

属性

KeyboardPresent

获取一个值,该值指示是否检测到将自身标识为键盘的设备。

适用于

另请参阅