• 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
Cocoa event handling in fullscreen
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cocoa event handling in fullscreen


  • Subject: Cocoa event handling in fullscreen
  • From: Christopher Hansen <email@hidden>
  • Date: Tue, 19 May 2009 10:53:09 -0700 (PDT)

Hello,

I'm writing a fullscreen game using Cocoa.  I need to intercept mouse and key events for my game's usage, but I'd also like to forward them on appropriately if my game code doesn't handle them specifically (e.g., adjusting volume, screen brightness, opening the CD/DVD ROM drive, Command-Q, etc.).

Since my game is fullscreen-only, I don't define any windows, I just subclass NSApplication.  I'm planning on providing event handling methods in my application (e.g., mouseDown, keyDown, etc.) and overriding sendEvent to call my application's methods for the event types that I'm interested in and falling back to [super sendEvent:anEvent]; otherwise.

The difficulty I'm having is what I do with key events, for instance, that are not needed specifically by my game code.  I've thought of either (a) returning a bool to indicate whether my game code used the event and using [super sendEvent:anEvent]; if it did not or (b) using [self nextResponder] to send it along.  The latter, of course, is consistent with the Cocoa event handling guide, but since I'm not using the standard Cocoa UI (windows, menus, etc.) with my fullscreen-only game, I'm not sure it's the right thing to do.


Any help would be appreciated.

Thanks,
Christopher



_______________________________________________

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: Cocoa event handling in fullscreen
      • From: Alexander Spohr <email@hidden>
  • Prev by Date: Re: iPhone text on UIImage not getting displayed on device.
  • Next by Date: Re: When init returns nil does it cause a leak
  • Previous by thread: Re: Tools in App Bundles
  • Next by thread: Re: Cocoa event handling in fullscreen
  • Index(es):
    • Date
    • Thread