News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
Detecting mouse position and raising a window
Author Message
dvw86
Junior Member
**


Posts: 39
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 0
Post: #1
Detecting mouse position and raising a window

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.

07-16-2008 12:53 PM
Find all posts by this user Quote this message in a reply
JohnMurga
Administrator
*******


Posts: 381
Group: Administrators
Joined: Apr 2007
Status: Offline
Reputation: 2
Post: #2
RE: Detecting mouse position and raising a window

I will have to look into this ... I am really not sure FLTK handles it.

07-17-2008 02:58 AM
Visit this user's website Find all posts by this user Quote this message in a reply
znarf
Junior Member
**


Posts: 34
Group: Registered
Joined: Jun 2007
Status: Offline
Reputation: 0
Post: #3
RE: Detecting mouse position and raising a window

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.

This post was last modified: 07-17-2008 05:27 AM by znarf.

07-17-2008 05:22 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: