Murga-Projects Forums

Full Version: Detecting mouse position and raising a window
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
According to the docs, show() should raise a window even if it is already shown. However it does not behave this way for me. I would like the window to become the front (top-most) window when a mouse hovers over it.

Another problem I am having is detecting the mouse pointer position when it is not over a FLTK window. Fl:event_y_root() and Fl:event_x_root() work, but only when the pointer over the FLTK window. I would like a program to run in the background and monitor the mouse pointer location. This way I could have a menu popup after a one second delay if I held the cursor at the bottom of the screen or have a different menu popup if I held the cursor at the top left corner of the screen.
I will have to look into this ... I am really not sure FLTK handles it.
I did some search on this 6 years ago while writing a portable general input system, and I'm pretty sure fltk won't offer access to it. Grabbing the mouse pointer position all over the screen is pretty easy in X (just look at the source code of xeyes...), however, it's hard under Windows (search the web for "hook mouse windows"). There are good reasons for an API to not support it, because it opens a door for certain phishing attacks by secretely recording mouse and keyboard input.
Reference URL's