diff options
Diffstat (limited to 'main.m')
| -rw-r--r-- | main.m | 30 | 
1 files changed, 28 insertions, 2 deletions
| @@ -1,8 +1,28 @@ +#import <Carbon/Carbon.h>  #import <CoreGraphics/CoreGraphics.h> +#import "Invert.h" +#import "DDHotKeyCenter.h" +  #define MAX_DISPLAYS 8  int main(int argc, const char * argv[]) { +    [NSApplication sharedApplication]; + +    Invert *invert = [[Invert alloc] init]; + +    DDHotKeyCenter *c = [DDHotKeyCenter sharedHotKeyCenter]; +    if ( +        ![c registerHotKeyWithKeyCode:kVK_ANSI_8 +            modifierFlags: +                (NSEventModifierFlagControl | NSEventModifierFlagOption | NSEventModifierFlagCommand) +            target:invert +            action:@selector(toggleInvertColors:) +            object:nil] +    ) { +        NSLog(@"Error registering hotkey"); +    } +      const CGGammaValue inverted_gamma[2] = {1, 0};      CGDirectDisplayID active_displays[MAX_DISPLAYS]; @@ -30,9 +50,15 @@ int main(int argc, const char * argv[]) {          }      } -    sleep(4); +    // for (;;) {} +    // sleep(4); +    // +    // CGDisplayRestoreColorSyncSettings(); + +    // TODO: trap? +    // [invert release]; -    CGDisplayRestoreColorSyncSettings(); +    [NSApp run];      return 0;  } | 
