how to determine keyboard disconnected in DirectInput

冷暖自知 提交于 2019-12-11 13:15:58

问题


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.

I've looked through the API, but I don't see where else to query if a device is connected.


回答1:


What about 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...



来源:https://stackoverflow.com/questions/9333663/how-to-determine-keyboard-disconnected-in-directinput

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!