Get caret postion and offset from inputor