This seems to work, but with this method, it only executes if left and right mouse buttons are not pressed.
As soon as i press the left or right mouse button it only executs every now and then, and only when moving the mouse a lot.
But i can imagine this is happening because of some Capture setting.