Services and Windows
Services and Windows
- Subject: Services and Windows
- From: David Rogers <email@hidden>
- Date: Wed, 8 Feb 2006 15:28:38 -0600
I have a little program that provides a service. The service pops up
a window and lets you choose from a list, then pastes that value into
the current document.
The problem that I have is that I want the window to only remain open
while the keyboard shortcut for the service is still held down. i.e.
cmd-shift-E. Once the keys are released then I want the window to be
hidden again.
I'm pretty sure that I need to subclass NSApplication and set that as
my Principal Class, but I'm not quite sure where to go from there.
So far, Google and ADC haven't given me the info that I need.
Here's what I have for my subclass so far. If anyone has any hints,
they would be greatly appreciated!
Thanks in advance,
David Rogers
@implementation AppController
- (void)sendEvent:(NSEvent *)event
{
switch ([event type])
{
case NSKeyUp:
if (([event modifierFlags] & NSCommandKeyMask) &&
([event modifierFlags] & NSShiftKeyMask)) {
NSLog(@"Command and Shift held");
}
break;
default:
break;
}
[super sendEvent:event];
}
@end
_______________________________________________
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