• 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
Re: Capturing all the events in Full Screen Mode... Uhhh...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Capturing all the events in Full Screen Mode... Uhhh...


  • Subject: Re: Capturing all the events in Full Screen Mode... Uhhh...
  • From: Troy Dawson <email@hidden>
  • Date: Tue, 30 Oct 2001 09:49:13 -0800

on 10/30/01 4:18 AM, Alexandre Aybes at email@hidden wrote:

> Hi there,
> When I am in full screen mode to get the events I use
> [NSApp currentEvent]; and then dispatch the events by hand to my
> listeners...

you're going to need to override NSApplication's -sendEvent method, see
below.

[the following code is taken from the 'VBL' sample of an upcoming WWDR
OpenGL sample code distribution (due for posting hopefully RSN)]:


#import <Cocoa/Cocoa.h>

/* -----
Notes
-----

1) In IB the MainMenu.nib the File's Owner custom class is set to App
2) In PB the Application settings Principal class is set to App
*/

@interface App : NSApplication
{
NSTimer* update_timer;
}

@end

@implementation App

- (id) init
{
self = [super init];

[self setDelegate: self];

return self;
}

- (void) dealloc
{
[update_timer invalidate];
[update_timer release];

[super dealloc];
}

- (void) sendEvent: (NSEvent*) theEvent
{
NSEventType event_type = [theEvent type];

if (event_type == NSKeyDown || event_type == NSKeyUp)
;

[super sendEvent: theEvent];
}

- (void) applicationWillFinishLaunching: (NSNotification*) notification
{
}

- (void) update : (id) object
{
}

- (void) applicationDidFinishLaunching: (NSNotification*) notification
{
update_timer = [[NSTimer scheduledTimerWithTimeInterval: 0.001 target:
self selector:@selector(update:) userInfo:self repeats:true] retain];
}

int main(int argc, const char *argv[])
{
return NSApplicationMain(argc, argv);
};

@end


References: 
 >Capturing all the events in Full Screen Mode... Uhhh... (From: Alexandre Aybes <email@hidden>)

  • Prev by Date: Apple Docs: What's New (was Re: Out-of-date Dev Docs?)
  • Next by Date: Re: How show a sheet ?
  • Previous by thread: Capturing all the events in Full Screen Mode... Uhhh...
  • Next by thread: Re: Capturing all the events in Full Screen Mode... Uhhh...
  • Index(es):
    • Date
    • Thread