Re: [AD] Mouse Locking

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


> Anyway, what im thinking is an additional two
> functions in the API, lock_mouse(), and
> release_mouse().  What do you guys think of the idea?

I'd call them trap_mouse() and untrap_mouse(), but otherwise I think it's a
good idea.

> I think it's a good idea. And instead of  just the window, it should
> be combined with set_mouse_range.

Makes sense, but what if you set the mouse range to the whole screen? Can
the mouse leave the window or not?
Or maybe, if you've set the mouse range to anything but `unlimited' it will
be trapped inside the window?

> Yes, though my method would be having the software mouse enabled would
> lock the mouse to the window (since we may have to do mouse warping
> anyway), which you could disable by enabling the hardware mouse (even
> if the hardware mouse isn't avialble, it'd still allow the mouse to
> leave the window then). I still don't think many Allegro programs are
> designed for windowed mode where the mouse is free to leave the
> window, and the ones that do work already contain hacks that wouldn't
> interfere (calling set_mouse_position regularly). The only apps that
> would be ok with the mouse leaving are GUI apps, and we can make some
> kind of special-case for that (or implicitly enable the hardware mouse
> there).

All apps running in windowed mode and not using mouse mickeys should be ok
with the mouse leaving the window. Personally, I think a program that
doesn't want the mouse to leave the window should just try to set a
fullscreen mode, but then again, that's not always possible.

However, I do think it makes sense to change the `when are mouse mickeys
reliable' to `mouse mickeys are only reliable if the mouse has been trapped
in the window' for windowed modes. That still leaves the mickey problem for
fullscreen mode though...

Evert




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