Re: Constraining a mouse cursor to a rect / window
Re: Constraining a mouse cursor to a rect / window
- Subject: Re: Constraining a mouse cursor to a rect / window
- From: Ken Thomases <email@hidden>
- Date: Wed, 24 Jul 2013 03:16:02 -0500
On Jul 23, 2013, at 8:09 PM, Jorgen Tjerno wrote:
> Thanks for your responses, Seth & Ken.
You're welcome.
> Ken: I don't think we can use LGPL code in SDL2, as the license for v2 is MIT. Have you measured to see if using CGAssociateMouseAndMouseCursorPosition and CGWarpMouseCursorPosition incurs any latency on cursor movements? Our customers are very .. sensitive to mouse behavior. ;-)
I have not. Subjectively, it seems fine to me.
> I implemented a way of constraining the mouse cursor using CGEventTaps. This approach is sadly not compatible with sandboxing
Just so you're aware, the technique I implemented for Wine also required an event tap because I needed the Cocoa events generated from the CGEvents to have the right absolute position and deltas. Without the event tap, the absolute position wouldn't move, because I disassociated the mouse from the cursor and the deltas would include the warp distance. I fix both in the the event tap.
Regards,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden