Added sampling of mouse coordinates.