Re: [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...
>
A related bug: After calling set_mouse_position(), the next get_mouse_mickeys()
returns the last position. The fix is probably also something simplel like
that, but I have no time to look at it right now.
--
Elias Pschernig