2 // CmdKeyInterceptApplication.m
5 // Created by Marc Liyanage on 13.02.05.
6 // Copyright 2005 __MyCompanyName__. All rights reserved.
9 #import "CmdKeyInterceptApplication.h"
12 @implementation CmdKeyInterceptApplication
14 - (void)sendEvent:(NSEvent *)event {
16 if ([event type] != NSKeyDown) {
17 [super sendEvent:event];
21 /* Look at the top 16 bits, only intercept
22 * key down events whose only modifier is the command key */
23 if (([event modifierFlags] & 0xffff0000) != NSCommandKeyMask) {
24 [super sendEvent:event];
28 int index = [[event characters] intValue];
29 if (index > 9 || index < 1) {
30 [super sendEvent:event];
34 [self sendAction:@selector(insertPrevious:) to:nil from:[NSNumber numberWithInt:index]];