on returnkey doesn't work

Sarah Reichelt sarah.reichelt at gmail.com
Sat May 5 17:44:44 EDT 2007


> I've put the following into a card script and then tried it in a
> field script that would have an insertion point or some selected
> text. Essentially, I'm trying to identify which of the 45 text fields
> on a card is the one in which the user has just entered something, so
> that I can use the return key to go to the next field; the tab key
> works fine in this regard, but I'd like the return key to do the same
> thing. Each of these text fields only uses the first line, but if the
> return key is pressed now, it goes to the next line. Perhaps I should
> be using a different type of field; maybe a label instead?
>
> on returnKey
>     -- do anything; I tried a beep and as the dictionary said: go
> next cd; nothing happens
> end returnKey
>
> Then in a field
> on returnField
>    -- ditto
> end returnField
>

You need a "returnInField" handler to trap returns inside a field. You
might also need to check for "enterInField".

Cheers,
Sarah



More information about the use-livecode mailing list