Re: Simulating menu bar blink in Cocoa
Re: Simulating menu bar blink in Cocoa
- Subject: Re: Simulating menu bar blink in Cocoa
- From: Benjamin Stiglitz <email@hidden>
- Date: Sat, 19 Apr 2008 14:42:22 -0700
If I understand well, your trying to catch event that match a menu
item shortcut minus the shift key. Isn't it possible to override -
[NSApp sendEvent:] as you did, but instead of taking care of the
event yourself, create a new event that match the menu item and
then call super with this new event ?
- (void)sendEvent:(NSEvent *)theEvent {
if ([theEvent isAnHotkeyEvent]) {
theEvent = [NSEvent eventWithTheKeystrokeAppKitWant];
}
[super sendEvent:theEvent];
}
I really don't know if it works, but it worth the try.
That’s a pretty common way to do it, and avoids the need to duplicate
the actual method dispatch. Works great.
-Ben_______________________________________________
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