Hi, I'm using CGWarpMouseCursorPosition to position the cursor in the window after grabbing it and hiding it. I'm using CGAssociateMouseAndMouseCursorPosition(true/false) to ensure that the motion can be captured separately from the mouse position.
However, after doing this, the next motion event (NSMouseMovedMask | NSLeftMouseDraggedMask | NSRightMouseDraggedMask | NSOtherMouseDraggedMask) seems to have an offset/delta equal to the warp that occurred. This seems to be undesirable behaviour. The reason why this is a bit confusion is because the documentation states that CGWarpMouseCursorPosition will not generate mouse events, and yet in this case, while not directly generating events it is causing some strange behaviour down the road. The only solution I've found to fix this "bug" is to simply discard the next motion input event that occurs to the given view, but this seems like a huge hack IMHO. I was wondering if there is some way to reset the internal delta tracking state as a slightly cleaner hack? I've filed a bug report to Apple, but obviously I need a fix. The hack above is working but is far from pleasant - does anyone have any suggestions on how I can improve this hack? Kind regards, Samuel _______________________________________________ Cocoa-dev mailing list ([email protected]) Please 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
