• 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
Option key state
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Option key state


  • Subject: Option key state
  • From: Josh Aas <email@hidden>
  • Date: Mon, 11 Feb 2002 11:27:14 -0600

Hello,
I need to test whether the option key is being held down or not when my
application is launching. I only know how to check the option key's state
from an NSEvent, but I don't really have one. I need to check the option
key's state in the following method delegated by NSApplication.

- (BOOL)application:(NSApplication*)anApplication
openFile:(NSString*)aFileName
{
if (appIsLaunching) {
wasLaunchedWithDocument = YES;
// check here for option key's state
}
[self doSomeThing:[NSArray arrayWithObject:aFileName]];
return YES;
}

Thanks! And I assume the name for the option key's keymask is
"NSAlternateKeyMask"?
-Josh Aas
_______________________________________________
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.

  • Follow-Ups:
    • Re: Option key state
      • From: Ondra Cada <email@hidden>
    • Re: Option key state
      • From: Michael Peirce <email@hidden>
    • Re: Option key state
      • From: Jens Bauer <email@hidden>
    • Re: Option key state
      • From: David Remahl <email@hidden>
  • Prev by Date: Re: IB nasty bug
  • Next by Date: Re: Double call of awakeFromNib on custom view
  • Previous by thread: [OT rant] apology
  • Next by thread: Re: Option key state
  • Index(es):
    • Date
    • Thread