base code for textinput custom cursors