USBDriverKit driver not dispatching events

I have a driver that is not much more than the sample code for a USB mouse. I am able to get the driver to match with my device (Logitech G600 mouse), and I can see logging inside my handleReport() function, but dispatchRelativePointerEvent does not seem to cause any effect, although it returns KERN_SUCCESS. I've tried it with both SUPERDISPATCH and without (it isn't clear to me if the superclass method needs to be called in the kernel or not in this case), and by subclassing both IOUserHIDEventService and IOUserHIDEventDriver. Below is my handleReport function. Thanks in advance for any assistance, and this is on macOS Ventura Beta 2

void G600Driver::handleReport(uint64_t timestamp,
                              uint8_t *report,
                              uint32_t reportLength,
                              IOHIDReportType type,
                              uint32_t reportID) {

  kern_return_t kr = dispatchRelativePointerEvent(timestamp, -10, -10, 0, 0, SUPERDISPATCH);

  DRLOG("ret: %d", kr);
}```

  • After a bit more experimenting, I found that my test dx/dy values are not large enough or need to be shifted left some amount, but the test program works as expected.

Add a Comment

Replies

After a bit more experimenting, I found that my test dx/dy values are not large enough or need to be shifted left some amount, but the test program works as expected.

I have the same problem, did you find a solution?

Yeah, I was not using large enough dx/dy values as I should have been.