• 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: Keyboard Events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Keyboard Events (From: Marcos Tirao <email@hidden>)

  • Prev by Date: debugging tools hosed?
  • Next by Date: Re: NSConnection, where'd my proxy go?
  • Previous by thread: Keyboard Events
  • Next by thread: Re: Keyboard Events
  • Index(es):
    • Date
    • Thread