This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-03-12 17:53:53

Daoist
New Scratcher
Registered: 2012-03-03
Posts: 1

How do you do mouse double-click?

Greeting, I am new here, but having a lot fun with this :-)
I can do single click, but how to you do mouse double click in scratch?
Say for instance, I use the mouse to hover over a few selections, then one click to select, and double-click to submit.
How do you do this without the screen flashing back at you?
Perhaps links to old posts. Thank you.

Offline

 

#2 2012-03-12 18:05:40

mewkid
Scratcher
Registered: 2010-08-16
Posts: 100+

Re: How do you do mouse double-click?

You could probably use variables, like:

when gf clicked
  if <mouse down>
    change [mouse  clicks v] by [1]
something around this theme may work  hmm

Offline

 

#3 2012-03-12 23:24:15

MaxFlyboy
Scratcher
Registered: 2011-11-07
Posts: 100+

Re: How do you do mouse double-click?

mewkid wrote:

You could probably use variables, like:

when gf clicked
forever
if <<mouse clicks> < (2)>? 
 if <mouse down?>
    change [mouse  clicks v] by [1]
    set [clicked? v] to (1)
    wait until <<clicked?> = 0>
    if <<mouse clicks > = 2>
    broadcast [do something v]
end
end
end
end

[use both]

when gf clicked
forever
if <<clicked?> = 1>
repeat (100)
wait (0.01) secs
if <mouse down?>
change [mouse clicks v] by (1)
end
end
set <clicked?> to (0)
end
something around this theme may work  hmm

fixed it to work better

Last edited by MaxFlyboy (2012-03-12 23:28:20)


http://cdn.voodoofilm.org/images/upload/thumb/viral-video-2011.jpg click the picture for an AMV

Offline

 

#4 2012-03-13 04:52:16

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: How do you do mouse double-click?

when gf clicked
forever
wait until <<mouse down?> and <touching [mouse-pointer v]?>>
reset timer
wait until <not <mouse down?>>
wait until <<mouse down?> and <touching [mouse-pointer v]?>>
if <(timer) < (0.5)>
broadcast [I was dbl-clicked! v]
end
wink

Last edited by Hardmath123 (2012-03-13 04:53:35)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

Board footer