The only code that will be called are handlers for mouse move events. Restructure your code to periodically do required activity from the mouse move event handler. If you on windows you may try to play games with message queue, but that may be messy