Menus, fields and not activating a mouseUp?
Mark Schonewille
m.schonewille at economy-x-talk.com
Tue May 15 18:58:40 EDT 2007
David,
On second thought, the user probably releases the control key right
after the mousedown. So, you might want to use the mouseDown handler
only.
on mouseDown
if the controlKey is down then
-- do stuff
else
wait 200 with messages
if the mouse is up then
-- run "mouseup" script
end if
end if
end mouseDown
This could be a better way to do it.
Alternatively, you can check out the flushEvents function. If you
don't want the mouseUp to run after the mouseDown script finished,
just execute
get flushEvents("mouseUp")
This is not always a good solution and I tend to avoid it.
Best,
Mark
--
Economy-x-Talk
Consultancy and Software Engineering
http://economy-x-talk.com
http://www.salery.biz
Get your store on-line within minutes with Salery Web Store software.
Download at http://www.salery.biz
Op 15-mei-2007, om 22:44 heeft David Bovill het volgende geschreven:
> You have a field with a contextual menu - so when you control-click
> on the
> field a popup menu apears (called in a mouseDown handler). If you
> do not use
> the control key - but simply click the mouseUp handler does something
> else...
>
> So how do you prevent the mouseUp handler? Neither exit to top nor the
> pending messages seem to help... so I have always set a flag in the
> menu
> code and then checked this in the mouseUp code... still is there a
> better
> way to prevent mouseUp messages from being sent?
More information about the use-livecode
mailing list