the focusedObject

J. Landman Gay jacque at
Sun Jan 11 22:07:48 EST 2009

william humphrey wrote:

> When I hit a return key in field id 1045 it sends "returnkey",  what I'm
> trying to do is send "returnkey" no matter what field the cursor is in
> except for field id 1045 which has more then one line and which needs to
> allow returns.

It looks like you want to execute a handler when the field is closed, 
and you are trying to trap returnkey messages to figure that out. If 
that's the case, then I'd do this instead:

1. Set every relevant field to use the autotab property. This lets the 
engine figure out for you when the user has typed a return. The 
advantage here is that any number of returns in longer fields are 
allowed; only a return key that would cause the text to drop below the 
bottom of the field are disallowed.

2. Size each field to show exactly how many lines you'll allow.

3. Change your returnkey handler to a closefield handler. Every time the 
user types return (or tab) to leave the field, a closefield will trigger.

If the longer field needs to be a scrolling field to allow more text, 
then you can put an empty closefield handler in that particular field's 
script to block the message so that the card (or stack) script 
closefield handler doesn't catch it.

If I've misinterpreted what you need to do, then just ignore all this. :)

Jacqueline Landman Gay         |     jacque at
HyperActive Software           |

More information about the Use-livecode mailing list