Beispiel #1
0
        public static void DispatchMouseEvent(this NSView view, NSEvent e)
        {
            switch (e.Type)
            {
            case NSEventType.LeftMouseDown: view.MouseDown(e); break;

            case NSEventType.RightMouseDown: view.RightMouseDown(e); break;

            case NSEventType.OtherMouseDown: view.OtherMouseDown(e); break;

            case NSEventType.LeftMouseUp: view.MouseUp(e); break;

            case NSEventType.RightMouseUp: view.RightMouseUp(e); break;

            case NSEventType.OtherMouseUp: view.OtherMouseUp(e); break;

            case NSEventType.LeftMouseDragged: view.MouseDragged(e); break;

            case NSEventType.RightMouseDragged: view.RightMouseDragged(e); break;

            case NSEventType.OtherMouseDragged: view.OtherMouseDragged(e); break;

            case NSEventType.ScrollWheel: view.ScrollWheel(e); break;

            case NSEventType.BeginGesture: view.BeginGestureWithEvent(e); break;

            case NSEventType.EndGesture: view.EndGestureWithEvent(e); break;

            case NSEventType.MouseMoved: view.MouseMoved(e); break;
            }
        }
Beispiel #2
0
        public static void SendEvent(NSView view, NSEvent nsEvent)
        {
            switch (nsEvent.Type)
            {
            // Mouse left button
            case NSEventType.LeftMouseDown: view.MouseDown(nsEvent); break;

            case NSEventType.LeftMouseUp: view.MouseUp(nsEvent); break;

            case NSEventType.LeftMouseDragged: view.MouseDragged(nsEvent); break;

            // Mouse right button
            case NSEventType.RightMouseDown: view.RightMouseDown(nsEvent); break;

            case NSEventType.RightMouseUp: view.RightMouseUp(nsEvent); break;

            case NSEventType.RightMouseDragged: view.RightMouseDragged(nsEvent); break;

            // Mouse other button
            case NSEventType.OtherMouseDown: view.OtherMouseDown(nsEvent); break;

            case NSEventType.OtherMouseUp: view.OtherMouseUp(nsEvent); break;

            case NSEventType.OtherMouseDragged: view.OtherMouseDragged(nsEvent); break;

            // Mouse move
            case NSEventType.MouseEntered: view.MouseEntered(nsEvent); break;

            case NSEventType.MouseMoved: view.MouseMoved(nsEvent); break;

            case NSEventType.MouseExited: view.MouseExited(nsEvent); break;

            // Mouse scroll
            case NSEventType.ScrollWheel: view.ScrollWheel(nsEvent); break;

            // Keys
            case NSEventType.KeyDown: view.KeyDown(nsEvent); break;

            case NSEventType.KeyUp: view.KeyUp(nsEvent); break;
            }
        }