Windows 8 WinRT KeyboardCapabilities.KeyboardPresent始终为true

Ren*_*lte 5 windows-8 windows-runtime winrt-xaml

我们正在使用KeyboardCapabilities.KeyboardPresent测试键盘是否连接到设备:

bool hasKeyboard = new KeyboardCapabilities().KeyboardPresent == 1;
Run Code Online (Sandbox Code Playgroud)

不幸的是,无论是否连接了蓝牙键盘,它始终为TRUE。我们使用以下硬件进行了尝试:

Dell Vostro 470是带无线蓝牙键盘的台式电脑,具有电源开/关选项。 http://www.dell.com/in/business/p/vostro-470/pd

三星700T笔记本电脑(Slate) http://www.samsung.com/uk/consumer/pc-peripherals/slate-pc/slate-pc/XE700T1A-A01UK

关闭键盘,蓝牙,从设备列表中删除键盘等无济于事,KeyboardCapabilities.KeyboardPresent始终返回1。

我们是否在这里缺少某些东西,或者是否有API应该用来检测这种变化?

Pie*_*i K 1

我在平板电脑上也有同样的行为。可能是一个错误...

更复杂的解决方案是枚举设备容器。它会告诉您是否连接了任何键盘。有关更多详细信息,请参阅设备枚举示例