Re: Keyboard Events
Re: Keyboard Events
- Subject: Re: Keyboard Events
- From: Nathan Day <email@hidden>
- Date: Sat, 8 Jun 2002 14:01:21 +0930
Have you looked at NSResponder and the two methods
- (void)keyDown:(NSEvent *)theEvent
- (void)keyUp:(NSEvent *)theEvent
On Saturday, June 8, 2002, at 04:57 AM, Marcos Tirao wrote:
Hi! I have read the Cocoa documentation but I couldn't get keyboard
events work
I have the following piece of code but nothing happens. Any Idea?
mainWindow = [[NSWindow alloc] initWithContentRect:[theDisplay frame]
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO];
// Set the window properties
mainView=[[View alloc]initWithFrame:NSMakeRect(0,0,640,480)];
[mainView setMainDisplay:theDisplay];
[mainWindow setBackgroundColor:[NSColor whiteColor]];
[mainWindow setLevel:[theDisplay shieldingWindowLevel]];
[mainWindow makeFirstResponder: mainView];
[mainWindow setAcceptsMouseMovedEvents: YES];
[mainWindow setContentView:mainView];
[mainWindow setInitialFirstResponder:mainView];
[mainWindow makeKeyAndOrderFront:nil];
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.