I asked this same question and found a work around in this post
http://processing.org/discourse/yabb2/num_1263445642.htmlI modified it a little. It works best with the frame set to undecorated
Quote:int mX, mY;
public int cnt;
public PImage a;
public Robot robot;
void setMouseXY()
{
mX = mouseX; mY = mouseY;
// 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 += 0;//3
// winloc.y += 32;//29
// }
mX = mouse.x-winloc.x-1;
mY = mouse.y-winloc.y-1;
// mX = mouse.x;
// mY = mouse.y;
}
public void init() {
/// to make a frame not displayable, you can
// use frame.removeNotify()
frame.removeNotify();
frame.setUndecorated(true);
// addNotify, here i am not sure if you have
// to add notify again.
frame.addNotify();
super.init();
}
//RoboMouse robo;
//Bot bot;
void setup(){
size(255,255,P3D);
}
public int mode = 2;
void draw(){
try {
robot = new Robot();
}
catch (AWTException e) {
e.printStackTrace();
}
setMouseXY();
background(1);
stroke(255);
line(mX, 0, mX, height);
stroke(233,23,23);
line(mouseX, 0, mouseX, height);
stroke(-1);
line(0, mY, width, mY);
stroke(233,23,23);
line(0, mouseY, width, mouseY);
println( "mX is " + mX + " and mY is " + mouseY );
}