how to determine keyboard disconnected in DirectInput
Asked Answered
P

1

1

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.

Pay answered 17/2, 2012 at 18:44 Comment(2)
Does it happen often that users disconnect keyboards while using your application? ;-)Dictatorial
My application will capture all keyboard state and will replicate it on non-PC platforms. This includes connect and disconnect.Pay
E
0

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

Engagement answered 17/2, 2012 at 18:59 Comment(1)
Since I am a console application, I don't have a message processing loop. Is there another alternative, or is there a simple way to add a message loop to a console application.Pay

© 2022 - 2024 — McMap. All rights reserved.