aboutsummaryrefslogtreecommitdiffstats
path: root/Copy Mailto/QuitButton.m
diff options
context:
space:
mode:
Diffstat (limited to 'Copy Mailto/QuitButton.m')
-rw-r--r--Copy Mailto/QuitButton.m22
1 files changed, 22 insertions, 0 deletions
diff --git a/Copy Mailto/QuitButton.m b/Copy Mailto/QuitButton.m
new file mode 100644
index 0000000..8b8bb52
--- /dev/null
+++ b/Copy Mailto/QuitButton.m
@@ -0,0 +1,22 @@
+//
+// QuitButton.m
+// CopyMailto
+//
+// Created by tw on 9/5/18.
+// Copyright © 2018 tw. All rights reserved.
+//
+
+#import "QuitButton.h"
+
+@implementation QuitButton
+
+// Quit the application on "q" or "Escape"
+- (void)keyDown:(NSEvent *)theEvent
+{
+ if ([[theEvent characters] isEqualToString:@"q"] ||
+ [theEvent keyCode] == kVK_Escape) {
+ [NSApp terminate:self];
+ }
+}
+
+@end