Insert text at cursor position

I would like insert text at the current cursor position. E.g. a user input string (e.g. a fieldname). How does it work? Can I detect the current cursor position or is there a member/function?
please help
regards frank.
please help

regards frank.