Fix another bad property name.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Thu, 14 Mar 2013 20:25:47 +0000 (21:25 +0100)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Thu, 14 Mar 2013 20:25:47 +0000 (21:25 +0100)
Classes/NJOutputController.m
Classes/NJOutputKeyPress.h
Classes/NJOutputKeyPress.m
Info.plist

index 95d28c4..07c077b 100644 (file)
         case 1:
             if (keyInput.hasKeyCode) {
                 NJOutputKeyPress *k = [[NJOutputKeyPress alloc] init];
-                k.vk = keyInput.keyCode;
+                k.keyCode = keyInput.keyCode;
                 return k;
             } else {
                 return nil;
 
     if ([output isKindOfClass:NJOutputKeyPress.class]) {
         [radioButtons selectCellAtRow:1 column:0];
-        keyInput.keyCode = [(NJOutputKeyPress*)output vk];
+        keyInput.keyCode = [(NJOutputKeyPress*)output keyCode];
     } else if ([output isKindOfClass:NJOutputMapping.class]) {
         [radioButtons selectCellAtRow:2 column:0];
         NSMenuItem *item = [mappingPopup itemWithRepresentedObject:[(NJOutputMapping *)output mapping]];
index 052b010..ce98668 100644 (file)
@@ -10,6 +10,6 @@
 
 @interface NJOutputKeyPress : NJOutput
 
-@property (nonatomic, assign) CGKeyCode vk;
+@property (nonatomic, assign) CGKeyCode keyCode;
 
 @end
index 622cf41..1cc7e65 100644 (file)
 }
 
 - (NSDictionary *)serialize {
-    return _vk != NJKeyInputFieldEmpty
-        ? @{ @"type": self.class.serializationCode, @"key": @(_vk) }
+    return _keyCode != NJKeyInputFieldEmpty
+        ? @{ @"type": self.class.serializationCode, @"key": @(_keyCode) }
         : nil;
 }
 
 + (NJOutput *)outputDeserialize:(NSDictionary *)serialization
                   withMappings:(NSArray *)mappings {
     NJOutputKeyPress *output = [[NJOutputKeyPress alloc] init];
-    output.vk = [serialization[@"key"] intValue];
+    output.keyCode = [serialization[@"key"] intValue];
     return output;
 }
 
 - (void)trigger {
-    CGEventRef keyDown = CGEventCreateKeyboardEvent(NULL, _vk, YES);
-    CGEventPost(kCGHIDEventTap, keyDown);
-    CFRelease(keyDown);
+    if (_keyCode != NJKeyInputFieldEmpty) {
+        CGEventRef keyDown = CGEventCreateKeyboardEvent(NULL, _keyCode, YES);
+        CGEventPost(kCGHIDEventTap, keyDown);
+        CFRelease(keyDown);
+    }
 }
 
 - (void)untrigger {
-    CGEventRef keyUp = CGEventCreateKeyboardEvent(NULL, _vk, NO);
-    CGEventPost(kCGHIDEventTap, keyUp);
-    CFRelease(keyUp);
+    if (_keyCode != NJKeyInputFieldEmpty) {
+        CGEventRef keyUp = CGEventCreateKeyboardEvent(NULL, _keyCode, NO);
+        CGEventPost(kCGHIDEventTap, keyUp);
+        CFRelease(keyUp);
+    }
 }
 
 @end
index ed9e83f..1ddd7ca 100644 (file)
@@ -46,7 +46,7 @@
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>301</string>
+       <string>303</string>
        <key>LSApplicationCategoryType</key>
        <string>public.app-category.utilities</string>
        <key>NSHumanReadableCopyright</key>