[AD] position_mouse() documentation addendum

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


Attached is a documentation update noting a peculiarity of
position_mouse()'s behavior under Windows. The section on how to work
around it could probably do with a rewrite, but it's better than
nothing at least.

Cheers
Tore

--
Feed me a stray cat.
--- allegro._tx.old	Fri Apr 14 15:39:27 2006
+++ allegro._tx	Fri Apr 14 15:41:50 2006
@@ -2946,9 +2946,18 @@
 
 @@void @position_mouse(int x, int y);
 @xref install_mouse, position_mouse_z, set_mouse_range, set_mouse_speed
+@xref set_display_switch_mode, set_display_switch_callback
 @shortdesc Moves the mouse to the specified screen position.
    Moves the mouse to the specified screen position. It is safe to call even
    when a mouse pointer is being displayed.
+
+   Note: under Windows, this will reposition the global mouse cursor even if
+   the application does not currently have focus. This could prohibit the user
+   from using the mouse when your program is running in the background. It is
+   therefore a good idea to either pause your program when it's inactive using
+   set_display_switch_mode(), or to only call position_mouse() when it's active
+   (e.g. by setting a flag with set_display_switch_callback() telling you if
+   your program currently has focus or not).
 
 @@void @position_mouse_z(int z);
 @xref install_mouse, position_mouse


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