Mouse API suggestions and bug reports


Tested on Allegro 5.1.5/Windows 8 (64bit).

1. In windowed mode al_grab_mouse() grabs the mouse within display window area and not the client area. You can still move the mouse to the border where the resize cursor will appear (or to the title area etc). I think it would make way more sense if the mouse was constrained within the client area?

2. Inconsistency: al_set_mouse_xy() sets the mouse cursor position within the display window area (including title and border area) while the mouse event.x/event.y reports mouse position using client area coordinates (title and border area already excluded).

3. al_set_mouse_xy() also generates ALLEGRO_EVENT_MOUSE_AXIS event (should only generate ALLEGRO_EVENT_MOUSE_WARPED according to the docs?). If you are trying to position mouse cursor within the code handling axis event - you get a recursive mouse axis event spam.

Thread #612268. Printed from