0

Windows 8 中是否有任何 API 可以告诉您是否有键盘连接到您的设备?我相信操作系统应该有这方面的信息,但我不确定它是否暴露。

我检查了Windows.Devices.Input.KeyboardCapabilities(). 它只keyboardPresent在我的触摸设备或非触摸设备上返回一个属性等于 1 的对象。

4

1 回答 1

0

The problem has already been reported on stackoverflow without solution (Provide another solution but which also don't seem to work).

Maybe a work around could be to add a TextBox outside the screen and set the focus on it and register InputPane.GetForCurrentView().Showing and to see if it is fired or not. If it is you can deduce that there is no keyboard connected (and you might be able to reset the focus to the page inside the event so that the keyboard don't actually pop up) and if it don't fired that the there is a keyboard connected. That not a really good solution but might be the best available ...

于 2013-09-20T19:53:01.427 回答