如何确定键盘在DirectInput断开连接 [英] how to determine keyboard disconnected in DirectInput
本文介绍了如何确定键盘在DirectInput断开连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用EnumDevices(...,DIEDFL_ATTACHEDONLY)监控HID连接。当我断开游戏控制器,它不再显示在回调。然而,当我断开键盘,它仍然显示在EnumDevices。
I am monitoring HID connections using EnumDevices(..., DIEDFL_ATTACHEDONLY). When I disconnect a game controller it no longer shows up in the callback. However, when I disconnect the keyboard, it still shows up in EnumDevices.
我已经看过API,但我没有看到其他地方查询,如果一个设备已连接。
I've looked through the API, but I don't see where else to query if a device is connected.
推荐答案
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363432%28v=vs。 85%29.aspx
您可以订阅任何装置通知,例如附加,分享等...
You can subscribe to any device notifications like attach,detach,etc...
这篇关于如何确定键盘在DirectInput断开连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文