Inheritance: IInputDriver, IInputDriver2
Beispiel #1
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;
        }
Beispiel #2
0
 private void ConnectEvents()
 {
     this.mInputDriver = new CarbonInput();
     EventTypeSpec[] eventTypes = new EventTypeSpec[5]
     {
         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)
     };
     this.uppHandler = API.NewEventHandlerUPP(new MacOSEventHandler(CarbonGLNative.EventHandler));
     API.InstallWindowEventHandler(this.window.WindowRef, this.uppHandler, eventTypes, this.window.WindowRef, IntPtr.Zero);
     Application.WindowEventHandler = this;
 }
Beispiel #3
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.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;
        }
Beispiel #4
0
 private void ConnectEvents()
 {
   this.mInputDriver = new CarbonInput();
   EventTypeSpec[] eventTypes = new EventTypeSpec[5]
   {
     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)
   };
   this.uppHandler = API.NewEventHandlerUPP(new MacOSEventHandler(CarbonGLNative.EventHandler));
   API.InstallWindowEventHandler(this.window.WindowRef, this.uppHandler, eventTypes, this.window.WindowRef, IntPtr.Zero);
   Application.WindowEventHandler = this;
 }