Permalink
Browse files

Adding support for noteFlagsChanged:

KCAppController and KCVisualizer are supposed to support this message, but it had been overlooked.
  • Loading branch information...
1 parent 9460890 commit ecd20896777bdbeee8e30e95ac833bc56f83addd @sdeken committed Feb 22, 2009
Showing with 16 additions and 2 deletions.
  1. +4 −0 KCAppController.h
  2. +3 −1 KCAppController.m
  3. +2 −0 KCVisualizer.h
  4. +7 −1 KCVisualizer.m
View
@@ -28,6 +28,8 @@
#import <Cocoa/Cocoa.h>
#import "KCVisualizer.h"
+#import "KCKeyboardTap.h"
+#import "KCKeystroke.h"
#import "ShortcutRecorder/ShortcutRecorder.h"
@class KCPrefsWindowController;
@@ -73,5 +75,7 @@
-(id<KCVisualizer>) currentVisualizer;
-(void) setCurrentVisualizer:(id<KCVisualizer>)visualizer;
+-(void) keyboardTap:(KCKeyboardTap*)tap noteKeystroke:(KCKeystroke*)keystroke;
+-(void) keyboardTap:(KCKeyboardTap*)tap noteFlagsChanged:(uint32_t)flags;
@end
View
@@ -116,8 +116,10 @@ -(void) keyboardTap:(KCKeyboardTap*)tap noteKeystroke:(KCKeystroke*)keystroke
[currentVisualizer noteKeyEvent:keystroke];
}
--(void) keyboardTap:(KCKeyboardTap*)tap noteFlagsChanged:(uint32_t)newFlags
+-(void) keyboardTap:(KCKeyboardTap*)tap noteFlagsChanged:(uint32_t)flags
{
+ if (currentVisualizer != nil)
+ [currentVisualizer noteFlagsChanged:flags];
}
-(NSStatusItem*) createStatusItem
View
@@ -38,6 +38,7 @@
-(void) deactivateVisualizer:(id)sender;
-(void) noteKeyEvent:(KCKeystroke*)keystroke;
+-(void) noteFlagsChanged:(uint32_t)flags;
@end
@@ -69,6 +70,7 @@
-(void) deactivateVisualizer:(id)sender;
-(void) noteKeyEvent:(KCKeystroke*)keystroke;
+-(void) noteFlagsChanged:(uint32_t)flags;
@end
View
@@ -77,12 +77,18 @@ -(void) hideVisualizer:(id)sender
{
}
+-(void) deactivateVisualizer:(id)sender
+{
+}
+
-(void) noteKeyEvent:(KCKeystroke*)keystroke
{
+ // Default implementation does nothing.
}
--(void) deactivateVisualizer:(id)sender
+-(void) noteFlagsChanged:(uint32_t)flags
{
+ // Default implementation does nothing.
}
@end

0 comments on commit ecd2089

Please sign in to comment.