KeyboardCapabilities 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供判斷任何已連線硬體鍵盤功能的能力。
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
- 繼承
- 屬性
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 |
取得值,指出是否偵測到裝置將本身識別為鍵盤。 |