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 95d28c44e8344084c39775da6e0de0f587b21494..07c077b4048294c783a48bde8086dc938e639cbd 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 052b0100547c9a06b40a2a314641512acf5e231c..ce98668362f6a2409252a83d02b565d6814893cd 100644 (file)
@@ -10,6 +10,6 @@
 
 @interface NJOutputKeyPress : NJOutput
 
-@property (nonatomic, assign) CGKeyCode vk;
+@property (nonatomic, assign) CGKeyCode keyCode;
 
 @end
index 622cf41083d21d58195099567e0e5d81c777459d..1cc7e654a572bdeaa161e1ff26b9ace2ff43ef60 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 ed9e83f47b56c8974f9dfa83c14ab14a8bdded3c..1ddd7cab307dbb90352e11e031c886f9e1cef52e 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>