Re: [AD] [ alleg-Bugs-2431768 ] display field for mouse state

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2008-12-15, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
> On 15-Dec-08, at 6:47 PM, Peter Wang wrote:
> >> Is this meant to help with knowing which window is foreground?
> >
> > I don't think so.  I'm assuming the usual (misleading) meaning,  
> > which is
> > the window with keyboard input focus.
> 
> Which isn't necessarily the same one that the mouse is over either.

Right.

> How would this work: when the mouse cursor leaves the tracking  
> rectangle for a the window, the "mouse window" is set to NULL, when  
> the mouse cursor enters the tracking rectangle of a window the "mouse  
> window" is set to that window?

Yes, that's what I'm thinking.

> > If no buttons are down and the mouse cursor is not over any of the
> > program's windows, the display field should probably be NULL and the  
> > x,y
> > coordinates relative to the root window (the entire screen).
> 
> Cool, that way we can move windows around and make them dodge the  
> mouse. I can see a great game of "catch that window!"
> Ok, maybe not. If we're going to report the position relative to the  
> root window, should we also report the coordinates of the upper left  
> and lower right coordinates of an Allegro window? Or can we already do  
> that?

We have al_get_window_position().

I added "probably" for a reason.  It seems to be a reasonable behaviour.
Otherwise, what would you report if the mouse is not over any of our
windows?

Peter





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/