diff options
| author | Teddy Wing | 2021-03-07 02:44:04 +0100 |
|---|---|---|
| committer | Teddy Wing | 2021-03-07 02:44:04 +0100 |
| commit | 5fd5ad3d85ff91b2c3bcf8fd6db26bdde4cc7646 (patch) | |
| tree | 67aa81d52403e7d5c5b8899f5495b5dd62cd9944 | |
| parent | 97655be01b1740d65e130015d40a92aa9a993e79 (diff) | |
| download | Re-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.
| -rw-r--r-- | main.m | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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; } |
