Hi,
The need on linux to "modprobe -r usbhid" if the device has a button is a bit inconvenient if you have a USB keyboard.... Fortunately there seems to be an easy work-around, which is to call libusb_set_auto_detach_kernel_driver() with the device handle.
See attached diff.
Although I've not tried it, I don't think that this will make any difference on MacOS, but shouldn't break anything as I check for the capability first.
Thanks,
Julian