|
|
|
Mouse Clicks: left, left double, right, right double
Added on 5/1/2002
|
Add functionality to left and right mouse clicks and even doubleclicks. Only tested on a PC with Director 8.5.1 but probably works with earlier versions too.
Note: the timeout (me.timing) has been used to prevent single mouse clicks to happend before a doubleclick has the time to init.
property l,r,timing
on new me
me.l = 0 -- left mouse timer
me.r = 0 -- right mouse timer
me.timing = 200 -- timeout for functions
return me
end
on exitFrame me
if me.l = 0 then
nothing
else if me.l + me.timing < the milliseconds then
me.l = 0
-- !!! add function for left mouse click here !!!
end if
if me.r = 0 then
nothing
else if me.r + me.timing < the milliseconds then
me.r = 0
-- !!! add function for right mouse click here !!!
end if
end
on mouseUp me
me.l = the milliseconds
if the doubleClick then
me.l = 0
-- !!! add function for double leftmouse click here !!!
end if
end
on rightMouseUp me
me.r = the milliseconds
if the doubleClick then
me.r = 0
-- !!! add function for double right mouse click here !!!
end if
end
|
|