Get rid of MOUSEMOVE event downsampling?

It appears Blender downsamples mouse movement events for calls to methods registered via the context.window_manager.modal_handler_add(self) method, though this could also be an effect of Blender not using raw mouse input in the first place.

self.ticks = self.ticks + 1
now = time.perf_counter()
if now > self.lastMeasure + 1:
    print("Got " + str(self.ticks) + " MOVEMOVE events per second")
    self.lastMeasure = now
    self.ticks = 0
return {"RUNNING_MODAL"}


Results of BenQ’s mouse poll rate checker:

When I use middle mouse for view rotation everything is silky smooth on an 120 Hz display.

I would like to be able to replicate that for better user experience. The events I get are simply of too poor quality and too low rate for reasons I cannot tell. What can I do? I have tried to find the Python sources of the view3d.rotate operator to see what they do differently but have not been successful. Is it all in C?

Using grepWin I searched for view3d.rotate and swiftly found where I immediately saw the solution:

if event.value == 'PRESS' and event.type in {'MOUSEMOVE', 'INBETWEEN_MOUSEMOVE'}:
// ...

Apparently there is an event type called INBETWEEN_MOUSEMOVE which I need to listen to as well.


The numbers don’t look half as dramatic as the change in feel.