Hi,
at the remarks of the inkey function is this:
The str_cursor function can be used to get the current cursor position while the string is edited.
That should be useful to find the latest cursor position. If more than 2 then O.K. (count starts at 1)