Sending keyDown

Sarah Reichelt sarah.reichelt at gmail.com
Wed Oct 21 18:43:04 EDT 2009


On Thu, Oct 22, 2009 at 7:43 AM,  <DunbarX at aol.com> wrote:
> Just when I was thinking I had the differences between HC and Rev down, I
> stumble.
>
> I have an editable field with this handler:
>
> on keyDown var
>   send "keydown" && var to this stack
>   put var
> end keyDown
>
> In HC, any text I type gets placed into the field, so typing works
> normally, but then I can do stuff with the last char, like put it into the msg box.
> Actually, in HC, I say "to Hypercard", but it makes no difference.
>
> But in Rev I get an error message stating that Rev "can't find handler near
> "keyDown".
>

Try this:

on keyDown var
   put var
   pass keyDown
end keyDown

This allows you to do stuff with var, then tell the engine to keep
passing the keyDown message along the normal hierarchy.

Cheers,
Sarah



More information about the use-livecode mailing list