• 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
performKeyEquivalent disables Command-Q hotkey
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

performKeyEquivalent disables Command-Q hotkey


  • Subject: performKeyEquivalent disables Command-Q hotkey
  • From: Michael Becker <email@hidden>
  • Date: Wed, 14 Jul 2004 17:26:39 +0200

Sorry for the (no subject) before...

Am Jul 14, 2004 um 2:32 PM schrieb Michael Becker:
Hello!

I have a question concerning NSView's performKeyEquivalent:.
In my NSView subclass, I implement performKeyEquivalent in order to react to the user pressing certain keys. However, this seems to kill the standard Command-Q (Quit application) functionality. I tried invoking [ super performKeyEquivalent:] before doing my own stuff, but that didn't work either. Here's my bit of code:

- (BOOL)performKeyEquivalent:(NSEvent*)event {
if ([ super performKeyEquivalent:event]) {
return YES;
} else {
unichar theChar = [[ event charactersIgnoringModifiers] characterAtIndex:0];

// Select all images on COMMAND-A
if (( theChar == 'a' ) && ( [ event modifierFlags] & NSCommandKeyMask )) {
[ self selectAllImages];
[ self setNeedsDisplay:YES];
return YES;
}
}
return NO;
}

(This was copy-pasted to Mail.app and then manually modified a little, so I might have put some syntax errors to it :-))

What can I do?

Regards,
Michael
_______________________________________________
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: 
 >(no subject) (From: Michael Becker <email@hidden>)

  • Prev by Date: Strange compile error
  • Next by Date: Re: Strange compile error
  • Previous by thread: (no subject)
  • Next by thread: (no subject)
  • Index(es):
    • Date
    • Thread