Implement methods to get cursor position.