Handling the pointer move event