loading
 
mouse click problem
Anonymous
16 year
Hi everyone!
I'm trying to make the mouse moving by following a light. And clicking the left button when the light is on.
So, I use Center of Gravity to find the position of the light and then moving the cursor... But I have a problem when trying to make it clicking.
I use this VBscript to know if the Center of Gravity exists, and if it does, it set the Z variable (used in button status in mouse module) to LEFT DOWN, and if it doesn't to LEFT UP.

if (GetVariable("COG_AREA") > 1) then
SetVariable "Z", "LEFT_DOWN"
else
SetVariable "Z", "LEFT_UP"
end if

But in this way, the cursor continuously press and then release, in spite of remaining pressed.. So, if I try to draw something in Paint or any other program, i have lot of points and not a line...

I thought that maybe this is because of the real mouse isn't pressed, and the module mouse set the variable Z by the status of the real button. But if it's so, I don't know what i can do...

Any suggestion? thanks a lot! and sorry for my poor English :P
Bye!
Anonymous 16 year
You might try NOT setting the Z variable unless the state should change. As long as a state (either up or down) is set it will be sent to windows. If windows gets a "mouse_up" command when the mouse is already up it might simulate a click.

We tried to replicate your issue without success. The robofile below is what we used to get the mouse down but using manual mouse movement. Using the proximity of a blue object allowed us to 'click' the mouse. Moving the mouse around in MS paint created nice lines.

Perhaps you can post your robofile?

STeven.
program.robo
Anonymous 16 year
Here is the .robo I use.
Tomorrow I will try to make it not setting Z again unless it change... Now unfortunately I haven't time :(

I'll tell you if that was the problem ;)
program.robo

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index