New User Question, OSX, return in field
J. Landman Gay
jacque at hyperactivesw.com
Sat Jul 19 22:13:01 EDT 2003
On 7/19/03 5:24 PM, PBSI wrote:
> As a newly licensed user of Revolution (thanks RunRev for the license
> changes) on OSX, can anyone tell me if there is an easy way to get a
> field to ignore the return key? On OSX the return key is supposed to
> invoke the default button (which I have one of) but it doesn't seem to
> work in Revolution.
A button whose style is "default" will have the correct appearance, but
doesn't automatically handle the return key; you have to do that with a
script, as you found out. You can catch a return key press in a field by
handling the "returnInField" message. Put a handler like this one into
the field script:
on returnInField
send "mouseUp" to btn "myDefault" -- use your own button name
end returnInField
This handler assumes that the default button has its own script that
does something. The handler will redirect the key press and not allow it
to put a return character into the field. Of course, if your users are
expecting to be able to type a return into the field, they will be
frustrated because this handler will block it.
There is also an "enterInField" message, in case you want to handle the
Enter key as well.
Welcome to the Revolution.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list