//
//  MyApplication.m
//  CyTV
//
//  Created by Andreas Junghans on Mon May 31 2004.
//  Copyright (c) 2004 Andreas Junghans. All rights reserved.
//


#import "MyApplication.h"
#import "Util.h"
#import "ApplicationController.h"
#import "MasterController.h"

@implementation MyApplication

enum {
// NSEvent subtypes for hotkey events (undocumented).
kEventHotKeyPressedSubtype = 6,
kEventHotKeyReleasedSubtype = 9,
};

- (void)sendEvent:(NSEvent *)theEvent {
    if ([theEvent type] == NSSystemDefined &&
        [theEvent subtype] == kEventHotKeyPressedSubtype) {
        ApplicationController* applicationController = [((MasterController *)[self delegate]) applicationController];
        [applicationController processHotKey:theEvent];
        //if (applicationController != nil) {
        //    [applicationController skip:30];
        //}
        //printf("Hotkey; data:%d\n", [theEvent data1]);
    }
    [super sendEvent:theEvent];
}

@end
