quick request for a volunteer to implement device add/remove callbacks and processing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

quick request for a volunteer to implement device add/remove callbacks and processing

Eliot Miranda-2
 
Hi All,

    I just added a variable to the Windows VM that tracks device additions and removals via receiving WM_DEVICECHANGE messages.  On Windows this allows plugins such as the SoundPlugin and CameraPlugin enumerating the available devices on every API call/primitive invocation rather than only when devices change.  This facility is also needed on Mac and would be great to have on unix.

It turn out that on Mac it is also straight=forward to achieve.  See https://stackoverflow.com/questions/9918429/how-to-know-when-a-hid-usb-bluetooth-device-is-connected-in-cocoa, especially Vivek Gani's answer (2 upvotes).  It also turns out that much of the necessary support code already exists in the Mac JoystickPlugin.  See platforms/iOS//plugins/JoystickTabletPlugin/HID*.

I wonder if any one has free time to do the work for the Mac to use IOHIDManagerRegisterDeviceMatchingCallback & IOHIDManagerRegisterDeviceRemovalCallback to provide a simple counter in the core Mac VM which is incremented whenever a device changes, just like the Windows implementation.  If not, no biggie I'll get to this eventually.

And if any unix and/or linux experts know how various unices and especially linux approach this issue please respond here.  I've no idea if unix/linux provide a good API here.

_,,,^..^,,,_
best, Eliot