コード例 #1
0
        static void ConnectEvents()
        {
            EventTypeSpec[] eventTypes = new EventTypeSpec[]
            {
                new EventTypeSpec(EventClass.Application, AppEventKind.AppActivated),
                new EventTypeSpec(EventClass.Application, AppEventKind.AppDeactivated),
                new EventTypeSpec(EventClass.Application, AppEventKind.AppQuit),

                new EventTypeSpec(EventClass.Mouse, MouseEventKind.MouseDown),
                new EventTypeSpec(EventClass.Mouse, MouseEventKind.MouseUp),
                new EventTypeSpec(EventClass.Mouse, MouseEventKind.MouseMoved),
                new EventTypeSpec(EventClass.Mouse, MouseEventKind.MouseDragged),
                new EventTypeSpec(EventClass.Mouse, MouseEventKind.MouseEntered),
                new EventTypeSpec(EventClass.Mouse, MouseEventKind.MouseExited),
                new EventTypeSpec(EventClass.Mouse, MouseEventKind.WheelMoved),

                new EventTypeSpec(EventClass.Keyboard, KeyboardEventKind.RawKeyDown),
                new EventTypeSpec(EventClass.Keyboard, KeyboardEventKind.RawKeyRepeat),
                new EventTypeSpec(EventClass.Keyboard, KeyboardEventKind.RawKeyUp),
                new EventTypeSpec(EventClass.Keyboard, KeyboardEventKind.RawKeyModifiersChanged),

                new EventTypeSpec(EventClass.AppleEvent, AppleEventKind.AppleEvent),
            };

            MacOSEventHandler handler = EventHandler;

            uppHandler = API.NewEventHandlerUPP(handler);

            API.InstallApplicationEventHandler(
                uppHandler, eventTypes, IntPtr.Zero, IntPtr.Zero);

            mInitialized = true;
        }
コード例 #2
0
        void ConnectEvents()
        {
            mInputDriver = new CarbonInput();
            EventTypeSpec[] eventTypes = new EventTypeSpec[]
            {
                new EventTypeSpec(EventClass.Window, WindowEventKind.WindowClose),
                new EventTypeSpec(EventClass.Window, WindowEventKind.WindowClosed),
                new EventTypeSpec(EventClass.Window, WindowEventKind.WindowBoundsChanged),
                new EventTypeSpec(EventClass.Window, WindowEventKind.WindowActivate),
                new EventTypeSpec(EventClass.Window, WindowEventKind.WindowDeactivate),
                //new EventTypeSpec(EventClass.Mouse, MouseEventKind.MouseDown),
                //new EventTypeSpec(EventClass.Mouse, MouseEventKind.MouseUp),
                //new EventTypeSpec(EventClass.Mouse, MouseEventKind.MouseMoved),
                //new EventTypeSpec(EventClass.Mouse, MouseEventKind.MouseDragged),
                //new EventTypeSpec(EventClass.Mouse, MouseEventKind.MouseEntered),
                //new EventTypeSpec(EventClass.Mouse, MouseEventKind.MouseExited),
                //new EventTypeSpec(EventClass.Mouse, MouseEventKind.WheelMoved),

                //new EventTypeSpec(EventClass.Keyboard, KeyboardEventKind.RawKeyDown),
                //new EventTypeSpec(EventClass.Keyboard, KeyboardEventKind.RawKeyRepeat),
                //new EventTypeSpec(EventClass.Keyboard, KeyboardEventKind.RawKeyUp),
                //new EventTypeSpec(EventClass.Keyboard, KeyboardEventKind.RawKeyModifiersChanged),
            };
            MacOSEventHandler handler = EventHandler;

            uppHandler = API.NewEventHandlerUPP(handler);
            API.InstallWindowEventHandler(window.WindowRef, uppHandler, eventTypes, window.WindowRef, IntPtr.Zero);
            Application.WindowEventHandler = this;
        }
コード例 #3
0
ファイル: CarbonWindow.cs プロジェクト: dhtdht020/GTTMCube
 public CarbonWindow(int x, int y, int width, int height, string title, DisplayDevice device)
 {
     this.title = title;
     handler    = EventHandlerFunc;
     CreateNativeWindow(WindowClass.Document,
                        WindowAttributes.StandardDocument | WindowAttributes.StandardHandler |
                        WindowAttributes.InWindowMenu | WindowAttributes.LiveResize,
                        new Rect((short)x, (short)y, (short)width, (short)height));
     Exists  = true;
     Display = device;
 }
コード例 #4
0
 internal static extern IntPtr NewEventHandlerUPP(MacOSEventHandler handler);
コード例 #5
0
ファイル: API.cs プロジェクト: tanis2000/FEZ
 internal static IntPtr NewEventHandlerUPP(MacOSEventHandler handler);
コード例 #6
0
 public static extern IntPtr NewEventHandlerUPP(MacOSEventHandler handler);
コード例 #7
0
 public static extern IntPtr NewEventHandlerUPP(MacOSEventHandler handler);