[AD] fix for get_mouse_mickeys()

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


There seems to be a bug when calling get_mouse_mickeys() under a windowed
graphics mode in Windows.

The first time you call get_mouse_mickeys() (or after you set the mouse
position) it returns the coordinates of the mouse. Any subsequent call
returns the proper values. Under a fullscreen mode, the first call to
get_mouse_mickeys() returns 0,0 - which is what I think is logical.

I've supplied a patch for wmouse.c, by just moving the lines:

CLEAR_MICKEYS();
mymickey_x = mymickey_y = 0;

to after the call to SetEvent();

I also attached a sample .c file that illustrates the current problem.
(Left-click to randomly set the mouse position, and right click to exit.) My
'fix' seems to work, but I don't know anything about how the Allegro mouse
handler works, so perhaps it screws something else up...

--
Matthew Leverton - matthew@xxxxxxxxxx
http://www.allegro.cc

Attachment: fix-1st-mickey.zip
Description: Binary data



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