Page 1 of 1

Disabling the mouse

Posted: Wed Feb 11, 2009 8:05 am
by ac11ca
Hi, I cant find the correct code to disable the mouse, or more accurately, the users ability to click the mouse. My code is something like:

Code: Select all

on mouseDown
doSomething
add 1 to gCount
if gCount = 10 then
doSomethingElse
go to next card
else
--pass
end if
The problem here is that users often click very fast and the last click carries over to the next card and is causing problems. Ideally I would like to add something like:

Code: Select all

on mouseDown
doSomething
add 1 to gCount
if gCount = 10 then
DISABLE MOUSE
doSomethingElse
go to next card
else
--pass
end if
Thanks for any help,
Adrian

Posted: Wed Feb 11, 2009 8:54 am
by SparkOut
I don't know if this will help, but this thread starts to get onto the subject in my post http://forums.runrev.com/phpBB2/viewtop ... =9573#9573 (partway down the thread) in which I commented about trying to prevent "legacy" clicks from a previous card affecting the next one.
There's a link in that thread to some other button clicking behaviour, perhaps related.

Basically - it seems to me - there's fundamental difference in the way the engine processes mouseDown and mouseUp. If you change your handlers to use mouseUp instead of mouseDown, are the results more consistent?

RE: Disabling the mouse

Posted: Wed Feb 11, 2009 11:52 am
by gmccarthy
Have you tried using flushevents? Check it out in the dictionary.
I'm sure this will do what you want.

Posted: Wed Feb 11, 2009 12:30 pm
by Klaus
Important hint, since I have seen this often on this forum lately:
a mouseclick = MouseUp
a mouseclick <> MouseDown

Ever made your mind up while the mousebutton was still pressed (down)
and moved the pressed mouse off from a button? I bet you did!
(Are you sure you want to erase your harddisk? ;-))

And now imagine the developer had implemented a "mousedown" to trigger
the action(s) instead of a "mouseup", you'd be extremely pi..ed off :-D

Spread the word, thanks!

Posted: Thu Feb 12, 2009 4:59 pm
by Paul D
could also try to disable the object that triggers the script until you are done with whatever then enable it when its ready for another mouseup.

Posted: Thu Feb 12, 2009 10:19 pm
by ac11ca
Thanks guys - good tips and thoughts all round. In this case Ive made use of the flushevents command.

Cheers,
Adrian