i am trying to access he mouse position in absolute screen coordinates from within a jsui object. The wind.location property returns the coordinates of the mouse cursor relative to the Left Top of the main Max/MSP application window, not the screen coordinates. The reason i need the absolute screen coordinates is that i want to lock the mouse position while drugging inside the jsui.
Any suggestions ??
Try adding the [jsui] click co-ordinates to the object box offset to the patcher window offset as illustrated below. It will output the cursor position like [mousestate] in global mode ("0"). I hope it helps.
var patchpos = this.patcher.wind.location;
var objpos = this.box.rect;
var absx = patchpos+objpos+x;
var absy = patchpos+objpos+y;
outlet(0, absx, absy);