static OSStatus EventHandler(IntPtr inCaller, IntPtr inEvent, IntPtr userData) { EventInfo evt = new EventInfo(inEvent); switch (evt.EventClass) { case EventClass.Application: switch (evt.AppEventKind) { default: return(OSStatus.EventNotHandled); } case EventClass.AppleEvent: // only event here is the apple event. Debug.Print("Processing apple event."); API.ProcessAppleEvent(inEvent); break; case EventClass.Keyboard: case EventClass.Mouse: if (WindowEventHandler != null) { return(WindowEventHandler.DispatchEvent(inCaller, inEvent, evt, userData)); } break; } return(OSStatus.EventNotHandled); }
private static OSStatus EventHandler(IntPtr inCaller, IntPtr inEvent, IntPtr userData) { EventInfo evt = new EventInfo(inEvent); switch (evt.EventClass) { case EventClass.Keyboard: case EventClass.Mouse: if (Application.WindowEventHandler != null) { return(Application.WindowEventHandler.DispatchEvent(inCaller, inEvent, evt, userData)); } else { break; } case EventClass.Application: int num = (int)evt.AppEventKind; return(OSStatus.EventNotHandled); case EventClass.AppleEvent: API.ProcessAppleEvent(inEvent); break; } return(OSStatus.EventNotHandled); }