[AD] position_mouse failure on Mac OSX 10.4.2

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


position_mouse didn't seem to work for me, it did
weird funky things. After talking with some Mac
developers the function being used inside of
osx_mouse_position:

CGDisplayMoveCursorToPoint(kCGDirectMainDisplay,
point);

aparently isn't what you're supposed to do. Instead
you're supposed to use this:

CGSetLocalEventsSuppressionInterval(0);
CGWarpMouseCursorPosition(point);

The code earlier in the function that translates the
window coordinates to global coordinates is still
correct for this new function.

In practice i noticed that this new osx_position_mouse
function could not be called in tight loops as it
seemed to mess up the click registering and was
seemingly time intensive. This might be solved by
putting CGSetLocalEventsSuppressionInterval(0) in the
init code instead. If not, maybe the docs should
mention to not do that.

http://www.allegro.cc/forums/view_thread.php?_id=547091




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