Tweak invalid filename handling. Use it for manual exports also. Allow drag exports...
[enjoyable.git] / NJOutputMouseButton.m
index 0cc403f..d5b1f16 100644 (file)
 }
 
 - (NSDictionary *)serialize {
-    return @{ @"type": @"mouse button", @"button": @(_button) };
+    return @{ @"type": self.class.serializationCode, @"button": @(_button) };
 }
 
 + (NJOutput *)outputDeserialize:(NSDictionary *)serialization
                   withMappings:(NSArray *)mappings {
-       NJOutputMouseButton *output = [[NJOutputMouseButton alloc] init];
+    NJOutputMouseButton *output = [[NJOutputMouseButton alloc] init];
     output.button = [serialization[@"button"] intValue];
-       return output;
+    return output;
 }
 
--(void) trigger {
+- (void)trigger {
     CGFloat height = NSScreen.mainScreen.frame.size.height;
     NSPoint mouseLoc = NSEvent.mouseLocation;
     CGEventType eventType = (_button == kCGMouseButtonLeft) ? kCGEventLeftMouseDown : kCGEventRightMouseDown;
@@ -36,7 +36,7 @@
     CFRelease(click);
 }
 
--(void) untrigger {
+- (void)untrigger {
     CGFloat height = NSScreen.mainScreen.frame.size.height;
     NSPoint mouseLoc = NSEvent.mouseLocation;
     CGEventType eventType = (_button == kCGMouseButtonLeft) ? kCGEventLeftMouseUp : kCGEventRightMouseUp;