CGPostMouseEvent vs CGEventCreateMouseEvent/CGEventPost

Leonid Romanov LEONID.ROMANOV at oracle.com
Mon Oct 17 12:06:24 PDT 2011


Hi,
I have a question fro Apple guys here. I've tried not to use deprecated CGPostMouseEvent for implementing Robot functionality, however it's not as simple as I'd hoped. 
The difference between CGEventCreateMouseEvent/CGEventPost combo vs CGPostMouseEvent is that upon returning from  CGPostMouseEvent we can be sure (well, according the experiments I've done) that the mouse pointer has already been moved to the requested position on the screen, whereas with the CGEventCreateMouseEvent/CGEventPost combo there as a delay between returning from CGEventPost  and actual mouse pointer movement.
Because of that, we now have http://java.net/jira/browse/MACOSX_PORT-527.  So, my question is what would be the best course of action: use CGPostMouseEvent despite the fact that is has been deprecated, or to find some way to wait until events posted via CGEventPost have been processed by the system.

Thanks,
Leonid.
  


More information about the macosx-port-dev mailing list