问题
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