Locating a control under the mouse

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Locating a control under the mouse

Jim Hunter
I am trying to implement a sort of help system that is triggered when the user does a CTRL-Right Click on a control. I first thought I would simply capture the click event at the main page then try and determine the control that is under the mouse, but I can't find any global method for determining the control at a given screen location. So, I then thought I would add a global listener to each widget and handle the event there. That worked, to a point. Even if I stopPropgation, the click event of the control still fires, not exactly what I am looking for.

Does anyone know of a method to locate a control at a given screen location? Or does someone have a better solution to my problem?

Thanks,
Jim

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Locating a control under the mouse

Jim Hunter
I think I found a good solution. I attached a mousedown listener on the main window of my app. Then in the function I trap to see if it is a Ctrl-Right-Click, if so, then I can get the event.getTarget() and that returns a handle to the control under the cursor. It's working great. So I was able to do it with one listener and a few lines of code. Gotta love this framework!

Jim


On Wed, Dec 12, 2012 at 9:23 AM, Jim Hunter <[hidden email]> wrote:
I am trying to implement a sort of help system that is triggered when the user does a CTRL-Right Click on a control. I first thought I would simply capture the click event at the main page then try and determine the control that is under the mouse, but I can't find any global method for determining the control at a given screen location. So, I then thought I would add a global listener to each widget and handle the event there. That worked, to a point. Even if I stopPropgation, the click event of the control still fires, not exactly what I am looking for.

Does anyone know of a method to locate a control at a given screen location? Or does someone have a better solution to my problem?

Thanks,
Jim


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel