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 › Getting clicked mousepos when not clicked:solution
Page Index Toggle Pages: 1
Getting clicked mousepos when not clicked:solution (Read 515 times)
Getting clicked mousepos when not clicked:solution
Mar 19th, 2006, 11:46pm
 
Code:

void setMouseXY()
{
if(mouseX>=0 && mouseX<width && mouseY>=0 && mouseY<height) return;
Point mouse, winloc;
mouse = MouseInfo.getPointerInfo().getLocation();
winloc = frame.getLocation();
if(!frame.isUndecorated()){
winloc.x += 3;
winloc.y += 29;
}
mouseX = mouse.x-winloc.x;
mouseY = mouse.y-winloc.y;
}
Page Index Toggle Pages: 1