Re: [AD] (OS X) mouse button number reported |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
[resent; apologies for duplicates]
On 2008-09-18, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
> On 18 Sep 2008, at 23:21, Peter Wang wrote:
> > The patch is right. In the mouse button state bit-field, bit
> > position *0*
> > holds the state of button 1.
>
> Right. But ex_events doesn't access the mouse button state bitfield
> (called "buttons") but the field that identifies the button that
> caused the event (called "button"). _al_osx_mouse_generate_event()
> sets both, but the last patch only affects the "buttons" field (as
> far as I can tell anyway).
In draw_all() it accesses the bit-field. When it receives a mouse
event, it then goes off and draws the mouse area using the
event.mouse.button information... which is promptly obliterated by
draw_all() in the next iteration of the loop.
So the example is a bit stupid now. When it was written, using the old
gfx API, it could assume a retained mode and only update the parts of
the screen which were relevent to the latest event. But now that the
whole screen is always redrawn using al_get_*_state() information, it's
hardly testing events at all.
Peter