detecting an option-click on a button
detecting an option-click on a button
- Subject: detecting an option-click on a button
- From: Paul Archibald <email@hidden>
- Date: Thu, 30 Oct 2008 14:51:13 -0700
Is there a simple way to detect that the option key was down when a
button was clicked? I have a method in my controller that gets the
button click, of course, and I have been trying this:
-(IBAction) handleButton:(id)sender {
if( [[NSApp currentEvent] modifierFlags] && NSAlternateKeyMask ) {
// handle option + click
}
else {
// do normal stuff
}
}
but of course the currentEvent is not necessarily related to the
sender. In fact, I realize there is no reason to think that there
should be any information about the keyboard status in the sender
parameter.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden