Moving window implementation of mouse event parsing. Code runs on separate thread as a library