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

#1 2008-01-15 11:08:19

gmc9987
Scratcher
Registered: 2008-01-15
Posts: 2

detecting mouse events

Hello, I am relatively new to Scratch, and have a question regarding using the mouse as an input device.

I have figured out how to wait and respond once the mouse is clicked down. I found the "mouse down" sensing block, and it works well. However, I noticed that there does not appear to be a way to sense when the mouse is lifted up again.

I am approaching this from an Adobe Flash oriented background, so I may be looking for a feature that is not there. However, it makes sense that there would be a way to tell when the mouse is lifted up again.

In short, I would like to be able to broadcast a message when the mouse is pressed down, and then broadcast a different message as soon as the mouse is lifted up again. I'll continue to figure it out on my own, but any help would be greatly appreciated.

Offline

 

#2 2008-01-15 11:15:27

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: detecting mouse events

Hi gmc9987,

Scratch does not have a specific mouse-up event. But once you've got the mouse down, you can just reverse the query and try something like:

[blocks]
<wait until><not><mouse down?>
<broadcast[ mouseUp
[/blocks]

Does this solve your problem?


Jens Mönig

Offline

 

#3 2008-01-15 11:30:53

gmc9987
Scratcher
Registered: 2008-01-15
Posts: 2

Re: detecting mouse events

Thank you very much. I've mainly used Flash over the last 3 - 4 years, so I've gotten used to writing in Actionscript. This worked beautifully.

Offline

 

Board footer