Add methods to get the cursor position.