Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

post hidden mouse events



Dear Folks,
     my app needs to synthesize mouse events. To do so I have first
used the following API:

CGError CGPostMouseEvent (
  CGPoint mouseCursorPosition,
  boolean_t updateMouseCursorPosition,
  CGButtonCount buttonCount,
  boolean_t mouseButtonDown,
  ...
);

However as documentation says:

"This function is not recommended for general use because of
undocumented special cases and undesirable side effects."

And it is indeed buggy as hell... there are undesirable side effects
on some user machine, so following the documentation advice:

I am using CGEventCreateMouseEvent and posting the event with CGEventPost.

Now I found lots of bugs (in the API) that were discussed on this list
already, but I did figure out finally a way to make everything work.

The only issue I have with this (CGEventPost solution) is that the
cursor also change position on the screen...

Any suggestion on how I can post mouse events without updating
MouseCursorPosition as  in the CGPostMouseEvent API??? relocating the
mouse each time after a mouse down/up operation is not an option.

Thank you,
Giovanni
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.