Re: [AD] Should al_set_mouse_xy generate events? |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: Coordination of admins/developers of the game programming library Allegro <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] Should al_set_mouse_xy generate events?
- From: Evert Glebbeek <eglebbk@xxxxxxxxxx>
- Date: Sat, 28 Feb 2009 10:13:27 -0800
On 28 feb 2009, at 10:01, Anders Andersson wrote:
I think that when you use the function you should get a mouse axes
event just like you had moved the mouse there.
Why?
What's the advantage of that?
In my program I just ignore that event by checking if the event I got
is pointing to the coordinates I set.
You can do that too by just ignoring the ALLEGRO_EVENT_MOUSE_WARPED
event. No special code or checks needed in your code.
Think of it this way: you're adding extra code to work around a
problem in the library. The better solution is to fix the library
(especially now that we can).
People may want to use that mouse axes event, I think it's unnecesary
to do anything special.
You don't have to do anything special. Just respond to
ALLEGRO_EVENT_MOUSE_WARPED in the same way as you would respond to an
AXES event, as in the example snippet I posted.
Possibly you may add a flag in the event.
As I said, hacky.
;)
Evert