Copy link to clipboard
Copied
Hi there, I am totally new to events, never really needed them so excuse my lack of knowledge on this. I am trying to pop up a window at the mouse pointer.
The solution I have is clunky. So I pop up a window, maybe maximum size - make it's opacity zero, so the user can't see it. Then I set up a 'mousemove' listener
on this large invisible window which triggers the next window to appear at the right position.
So I have to move the mouse to pop up the window, I would rather a keyboard event to pop the window up, but there is no screenX, screenY property in the keyboard event object.
Any pointers appreciated... am I totally up the wrong path....?
Many thanks.
Alan.
var w = new Window ("dialog");
w.preferredSize=[700,700];
w.addEventListener ("mousemove", function (m) {eventHandler(m)});
function eventHandler (ev){
//b.text = ("X: " + ev.screenX+"Y: " + ev.screenY);
var w2= new Window ("dialog");
w2.location = [ev.screenX,ev.screenY];
w2.show();
w.close();
}
w.show ();
Copy link to clipboard
Copied
I just noticed my unintentional pun 'Any POINTERS appreciated'. Excellent.
Copy link to clipboard
Copied
Actually this is working perfectly, I just had to kill the eventListener once it was triggered once.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more