Re: Keyboard modifiers on buttons
Re: Keyboard modifiers on buttons
- Subject: Re: Keyboard modifiers on buttons
- From: Eric Brunstad <email@hidden>
- Date: Mon, 13 Jun 2005 11:21:36 -0400
On Jun 13, 2005, at 9:08 AM, Theodore H. Smith wrote: I'm trying to make one button of mine work differently, if a keyboard modifier is selected. Kind of like "expand", and "expand all", where you would hold the option key to get the expand all.
How can I trap for keyboard modifiers in Cocoa from a button code? Must I go via Carbon instead?
Don't go to Carbon! For example, this would check if the control key is pressed:
- (void)mouseDown:(NSEvent *)theEvent { if([theEvent modifierFlags] & NSControlKeyMask) { // control key pressed; } }
-Eric |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden