Accepting Mouse Moved Events

Member
Posts: 201
Joined: 2002.06
Post: #1
When a game is in window mode, all you have to do is [window setAcceptsMouseMovedEvents:YES]. How do you achieve this when in full screen mode using CGDirectDisplay? I'm guessing that the way would be to get the shield window's ID and set that window to accept the mouse moved events, no? If this is they way, how do you use a window's ID to send messages to the window? Otherwise, how do you accept mouse moved events?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Omni does it by creating a window even in full-screen mode. See their GDC "Porting games to Mac OS X" PDF for details.

You can also do it with Carbon Events, or by getting your mouse movements from the HID manager (on Jaguar).
Quote this message in a reply
Member
Posts: 201
Joined: 2002.06
Post: #3
Oh, okay. I was using their code as a guide and did not quite catch that.
Quote this message in a reply
Member
Posts: 201
Joined: 2002.06
Post: #4
Hey wait a minute! I was reading the code over again and found this:

Code:
// Enable mouse moved events.  We only need to do this if
we actually have an NSWindow.  Fullscreen GL applications do not
need their own NSWindow.  The system will create a window them
itself and will turn on mouse movement events
    [window setAcceptsMouseMovedEvents: YES];


Does this mean that the CoreGraphics shield window is automatically set to accept mouse movement events or are they referring to when you use some other method of going full screen with OpenGL?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #5
Hey, sounds like it! Try it and see Smile

Sorry, I don't remember seeing that before. Have they updated it recently?
Quote this message in a reply
Member
Posts: 201
Joined: 2002.06
Post: #6
I don't think so. It seems like the same old 2001 code.
Quote this message in a reply
Member
Posts: 201
Joined: 2002.06
Post: #7
Yay! It does work! Grin
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Full screen mouse events Mister T 17 8,780 Jan 4, 2010 02:55 PM
Last Post: MacMan
  Die-hard vertex-sorting function not accepting input values! mikey 6 3,866 Oct 31, 2009 03:36 AM
Last Post: mikey
  Mouse Events in NSView Chandhu 1 4,150 Feb 28, 2008 02:08 AM
Last Post: kuon_
  Mouse events for an openGL window majestik666 5 7,472 Jul 5, 2005 06:15 PM
Last Post: majestik666
  windows getting resized/moved after switching resolutions aarku 5 4,857 Nov 30, 2003 03:56 AM
Last Post: aarku