aboutsummaryrefslogtreecommitdiffstats
path: root/main.m
diff options
context:
space:
mode:
authorTeddy Wing2021-03-07 02:44:04 +0100
committerTeddy Wing2021-03-07 02:44:04 +0100
commit5fd5ad3d85ff91b2c3bcf8fd6db26bdde4cc7646 (patch)
tree67aa81d52403e7d5c5b8899f5495b5dd62cd9944 /main.m
parent97655be01b1740d65e130015d40a92aa9a993e79 (diff)
downloadRe-Good-Catalina-Invert-Colours-5fd5ad3d85ff91b2c3bcf8fd6db26bdde4cc7646.tar.bz2
main: Move hotkey registration to a new function
Split this into a more descriptive function. Still need to set up proper error handling.
Diffstat (limited to 'main.m')
-rw-r--r--main.m12
1 files changed, 10 insertions, 2 deletions
diff --git a/main.m b/main.m
index 7b54de8..87e64c0 100644
--- a/main.m
+++ b/main.m
@@ -3,11 +3,21 @@
#import "Invert.h"
#import "DDHotKeyCenter.h"
+int register_hotkeys();
+
int main(int argc, const char * argv[]) {
[NSAutoreleasePool new];
[NSApplication sharedApplication];
+ int error_code = register_hotkeys();
+
+ [NSApp run];
+
+ return 0;
+}
+
+int register_hotkeys() {
Invert *invert = [[[Invert alloc] init] autorelease];
DDHotKeyCenter *c = [DDHotKeyCenter sharedHotKeyCenter];
@@ -32,7 +42,5 @@ int main(int argc, const char * argv[]) {
NSLog(@"Error registering hotkey");
}
- [NSApp run];
-
return 0;
}