[AD] Is al_set_mouse_range any useful?

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


The current documentation says this:
http://www.liballeg.org/naturaldocs/files/mousenu-c.html#al_set_mouse_range

which is the same as the Allegro 4 function:
http://www.liballeg.org/stabledocs/en/alleg004.html#set_mouse_range

But, to me, this is very vague (I never actually used the function so I
don't know how it works). Does it mean, the mouse cursor stops moving at
the given coordinates? Or are reported positions simply confined to that
range, but the mouse will move outside? To me, only the former would
make sense. Therefore, I think we should replace it by two new
functions:

/* Make the mouse cursor unable to leave the given rectangle in the
given display. Be careful with using this, as it will prevent the user
from reaching other windows or even the title bar or close button of the
current window. */
al_constrain_mouse_movement(AL_DISPLAY *display, int x1, y1, x2, y2)

/* Allow the mouse cursor to move outside its window again.
al_unconstain_mouse_movement()

The above two functions can be very useful for testing certain mouse
controlled games in windowed mode. Whereas I can't see any use at all
for the set_mouse_range in Allegro 4.

-- 
Elias Pschernig <elias@xxxxxxxxxx>





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