We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › advanced mouse event
Page Index Toggle Pages: 1
advanced mouse event (Read 889 times)
advanced mouse event
Mar 5th, 2010, 8:09am
 
Hello.
I want to force the curor to move to a specific place and give some click.
Any way to do this?
Thank you for reply.
Re: advanced mouse event
Reply #1 - Mar 5th, 2010, 8:21am
 
check out this post : http://processing.org/discourse/yabb2/num_1266235362.html

for the mouse click. you can actually trigger whatever you would trigger with mouseClicked without a mouseClick. so no need to simulate it.
Re: advanced mouse event
Reply #2 - Mar 5th, 2010, 10:20am
 
for the click just throw all the code the would occur in a function and call the function when the "pointer" hits the object. this takes 2 PVector positions and checks whether their radius overlaps:

Code:

boolean hitTest(PVector A, PVector B, float r1, float r2 ){
float dist = (sqrt(sq(A.x-B.x) + sq(A.y-B.y))) / (r1 + r2);
if(dist < 1) {
return true;
}
else {
return false;
}
}


Re: advanced mouse event
Reply #3 - Mar 6th, 2010, 1:41am
 
Thank you indeed!Could you offer more details about the class of Robot? SmileySincere respects
Page Index Toggle Pages: 1