Mercurial > enso_osx
comparison src/EnsoKeyNotifier.m @ 16:e07f0c7abdc0
Changed the notification messages sent by the key notifier to be more descriptive.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Sun, 24 Feb 2008 20:15:57 -0600 |
parents | af72a81169aa |
children | 5477703cfb73 |
comparison
equal
deleted
inserted
replaced
15:af72a81169aa | 16:e07f0c7abdc0 |
---|---|
20 { | 20 { |
21 NSArray *keys = [NSArray arrayWithObjects: @"event", nil]; | 21 NSArray *keys = [NSArray arrayWithObjects: @"event", nil]; |
22 NSArray *values = [NSArray arrayWithObjects: @"someKey", nil]; | 22 NSArray *values = [NSArray arrayWithObjects: @"someKey", nil]; |
23 NSDictionary *dict = [NSDictionary dictionaryWithObjects: values forKeys: keys]; | 23 NSDictionary *dict = [NSDictionary dictionaryWithObjects: values forKeys: keys]; |
24 | 24 |
25 [center postNotificationName: @"KeyNotifier_msg" | 25 [center postNotificationName: @"EnsoKeyNotifier_msg" |
26 object: @"KeyNotifier" | 26 object: @"EnsoKeyNotifier" |
27 userInfo: dict]; | 27 userInfo: dict]; |
28 } | 28 } |
29 | 29 |
30 CGEventRef myCallback( CGEventTapProxy proxy, | 30 CGEventRef myCallback( CGEventTapProxy proxy, |
31 CGEventType type, | 31 CGEventType type, |
49 { | 49 { |
50 NSArray *keys = [NSArray arrayWithObjects: @"event", nil]; | 50 NSArray *keys = [NSArray arrayWithObjects: @"event", nil]; |
51 NSArray *values = [NSArray arrayWithObjects: @"quasimodeEnd", nil]; | 51 NSArray *values = [NSArray arrayWithObjects: @"quasimodeEnd", nil]; |
52 NSDictionary *dict = [NSDictionary dictionaryWithObjects: values forKeys: keys]; | 52 NSDictionary *dict = [NSDictionary dictionaryWithObjects: values forKeys: keys]; |
53 | 53 |
54 [center postNotificationName: @"KeyNotifier_msg" | 54 [center postNotificationName: @"EnsoKeyNotifier_msg" |
55 object: @"KeyNotifier" | 55 object: @"EnsoKeyNotifier" |
56 userInfo: dict]; | 56 userInfo: dict]; |
57 inQuasimode = NO; | 57 inQuasimode = NO; |
58 if ( numQuasimodalKeyDowns == 1 ) | 58 if ( numQuasimodalKeyDowns == 1 ) |
59 { | 59 { |
60 CGEventRef event[2]; | 60 CGEventRef event[2]; |
89 { | 89 { |
90 NSArray *keys = [NSArray arrayWithObjects: @"event", nil]; | 90 NSArray *keys = [NSArray arrayWithObjects: @"event", nil]; |
91 NSArray *values = [NSArray arrayWithObjects: @"quasimodeStart", nil]; | 91 NSArray *values = [NSArray arrayWithObjects: @"quasimodeStart", nil]; |
92 NSDictionary *dict = [NSDictionary dictionaryWithObjects: values forKeys: keys]; | 92 NSDictionary *dict = [NSDictionary dictionaryWithObjects: values forKeys: keys]; |
93 | 93 |
94 [center postNotificationName: @"KeyNotifier_msg" | 94 [center postNotificationName: @"EnsoKeyNotifier_msg" |
95 object: @"KeyNotifier" | 95 object: @"EnsoKeyNotifier" |
96 userInfo: dict]; | 96 userInfo: dict]; |
97 inQuasimode = YES; | 97 inQuasimode = YES; |
98 passOnEvent = NO; | 98 passOnEvent = NO; |
99 numQuasimodalKeyDowns = 0; | 99 numQuasimodalKeyDowns = 0; |
100 printf( "Enter quasimode\n" ); | 100 printf( "Enter quasimode\n" ); |
140 | 140 |
141 NSArray *keys = [NSArray arrayWithObjects: @"event", @"chars", @"keycode", nil]; | 141 NSArray *keys = [NSArray arrayWithObjects: @"event", @"chars", @"keycode", nil]; |
142 NSArray *values = [NSArray arrayWithObjects: eventType, chars, keycodeNum, nil]; | 142 NSArray *values = [NSArray arrayWithObjects: eventType, chars, keycodeNum, nil]; |
143 NSDictionary *dict = [NSDictionary dictionaryWithObjects: values forKeys: keys]; | 143 NSDictionary *dict = [NSDictionary dictionaryWithObjects: values forKeys: keys]; |
144 | 144 |
145 [center postNotificationName: @"KeyNotifier_msg" | 145 [center postNotificationName: @"EnsoKeyNotifier_msg" |
146 object: @"KeyNotifier" | 146 object: @"EnsoKeyNotifier" |
147 userInfo: dict]; | 147 userInfo: dict]; |
148 } else { | 148 } else { |
149 sendSomeKeyEvent(); | 149 sendSomeKeyEvent(); |
150 } | 150 } |
151 } | 151 } |