#import "StatzSettingsWindow.h"
+#import "StatusSettingsController.h"
@implementation StatzSettingsWindow
- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned
int)aStyle
@@ -48,4 +49,10 @@
[super orderOut:sender];
}
+- (void)keyDown:(NSEvent*)event {
+ if (![[self windowController] handleKeyDown:event]) {
+ [super keyDown:event];
+ }
+}
+
@end
Index: StatusSettingsController.h
===================================================================
--- StatusSettingsController.h (revision 17)
+++ StatusSettingsController.h (working copy)
@@ -42,4 +42,5 @@
- (IBAction)addSource:(id)sender;
- (IBAction)removeSource:(id)sender;
+- (BOOL)handleKeyDown:(NSEvent*)event;
@end
Index: StatusSettingsController.m
===================================================================
--- StatusSettingsController.m (revision 17)
+++ StatusSettingsController.m (working copy)
@@ -260,5 +260,20 @@
}
}
+- (BOOL)handleKeyDown:(NSEvent*)event {
+ BOOL handled = NO;
+ NSString *characters = [event characters];
+ if ([characters length]) {
+ unichar key = [characters characterAtIndex:0];
+ NSWindow *window = [self window];
+ NSResponder *currentResponder = [window firstResponder];
+ if (key == NSRightArrowFunctionKey && sourceTable_ ==
currentResponder) {
+ handled = [window makeFirstResponder:statusTable_];
+ } else if (key == NSLeftArrowFunctionKey && statusTable_ ==
currentResponder) {
+ handled = [window makeFirstResponder:sourceTable_];
+ }
+ }
+ return handled;
+}
@end
dhcp-172-19-23-212:~/src/opensource/statz dmaclach$ svn ci
Sending StatusSettingsController.h
Sending StatusSettingsController.m
Sending StatzSettingsWindow.m
Transmitting file data ...
Committed revision 18.