paste into field does not trigger closefield

Klaus Major klaus at major-k.de
Tue Jun 27 07:13:04 EDT 2006


Hi Kee,

> If I type data into a field, when I leave the field it gets a  
> closefield message and I have a handler for that.
>
> When I paste text into a field and leave the field without typing  
> anything, the field does not get a closefield message and my  
> handler never gets called.
>
> Watching the message watcher doesn't present any obvious solution  
> for what to use to catch the paste into a text field. Do I have to  
> write a handler that traps a set of keystrokes (command V) and then  
> sends the field a closefield event?
>
> What does everyone else do?

you could catch the "pastekey" message like this one:

on closefield
   ##do your thing
end closefield

on pastekey
   send "closefield" to me in 10 millisecs
   pass pastekey
end pastekey

Tested and works here :-)

Check also "copykey" etc...

> Kee Nethery

Regards

Klaus Major
klaus at major-k.de
http://www.major-k.de




More information about the use-livecode mailing list