• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Constraining a mouse cursor to a rect / window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Constraining a mouse cursor to a rect / window


  • Subject: Constraining a mouse cursor to a rect / window
  • From: Jorgen Tjerno <email@hidden>
  • Date: Mon, 22 Jul 2013 21:42:43 +0000
  • Thread-topic: Constraining a mouse cursor to a rect / window

Is there an API that allows an application to constrain a mouse cursor's movement to a window or a rect?

The use case for this is in SDL2, where windows created with SDL_FULLSCREEN_DESKTOP create desktop-sized, borderless windows that are topmost, similar to a fullscreen application (but without a mode change and allowing quick Cmd-Tab etc). This works great, but on multi-monitor setups, the mouse can be moved out of the window onto the other desktop.

The current workaround is using CGWarpMouseCursorPosition to move the cursor back if it leaves the window, but depending on the update rate of the application, a user can still have a mouse click be delivered to another application or the desktop, causing a focus loss. Not a great experience.

Is this more appropriate for mac-games-dev@ or quartz-dev@?

- Jørgen.
_______________________________________________

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


  • Follow-Ups:
    • Re: Constraining a mouse cursor to a rect / window
      • From: Seth Willits <email@hidden>
    • Re: Constraining a mouse cursor to a rect / window
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Disabling Hot Corners
  • Next by Date: Re: NSTextView's MarkedText
  • Previous by thread: Re: Disabling Hot Corners
  • Next by thread: Re: Constraining a mouse cursor to a rect / window
  • Index(es):
    • Date
    • Thread