Pump event loop before reading mouse

Hopefully this will fix the issues some people have been experiencing
with the mouse.