Exemplo n.º 1
0
 public virtual void mouseWheelMoved(MouseWheelEvent param1MouseWheelEvent)
 {
     if (outerInstance.ZoomEnabled)
     {
         outerInstance.Zoom = outerInstance.Zoom + param1MouseWheelEvent.WheelRotation;
     }
 }
Exemplo n.º 2
0
    public void OnHandle(MouseWheelEvent message)
    {
        //  rotate element preview
        if (message.Up)
        {
            _rotate += 90;
        }
        else
        {
            _rotate -= 90;
        }

        if (_rotate < 0)
        {
            _rotate += 360;
        }
        else if (_rotate >= 360)
        {
            _rotate -= 360;
        }

        Log(_rotate);

        UpdatePreviewSprite();
    }
Exemplo n.º 3
0
        protected override void OnMouseWheel(MouseWheelEvent e)
        {
            int speed = MathHelper.Clamp(CurrentSpeed + e.Delta, 0, MaxSpeed);

            SpeedSelected.Raise(speed);
            e.Handled = true;
        }
Exemplo n.º 4
0
 public void HandleMouseWheel(MouseWheelEvent e)
 {
     OnMouseWheel(e);
     if (!e.Handled && Parent != null)
     {
         Parent.HandleMouseWheel(e);
     }
 }
Exemplo n.º 5
0
        private void MouseWheelHendler(object sender, MouseWheelEventArgs e)
        {
            e.Handled = true;
            Point    mousePosition        = e.GetPosition(_mapV);
            Location polygonPointLocation = _mapV.ViewportPointToLocation(mousePosition);

            MouseWheelEvent?.Invoke(e.Delta, polygonPointLocation);
        }
Exemplo n.º 6
0
 public Input()
 {
     Key         = new Dictionary <Keyboard.Key, KeyEvent>();
     MouseButton = new Dictionary <Mouse.Button, MouseButtonEvent>();
     Text        = null;
     MouseWheel  = null;
     MouseMove   = null;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Process mouse wheel events that are delivered to this
 /// <code>ScrollPane</code> by scrolling an appropriate amount.
 /// <para>Note that if the event parameter is <code>null</code>
 /// the behavior is unspecified and may result in an
 /// exception.
 ///
 /// </para>
 /// </summary>
 /// <param name="e">  the mouse wheel event
 /// @since 1.4 </param>
 protected internal override void ProcessMouseWheelEvent(MouseWheelEvent e)
 {
     if (WheelScrollingEnabled)
     {
         ScrollPaneWheelScroller.handleWheelScrolling(this, e);
         e.Consume();
     }
     base.ProcessMouseWheelEvent(e);
 }
Exemplo n.º 8
0
        void IScreen.MouseWheel(MouseWheelEvent e)
        {
            var widget = mouseFocus ?? hoveredWidget;

            if (widget != null)
            {
                widget.HandleMouseWheel(e);
            }
        }
Exemplo n.º 9
0
        protected void ExecuteMouseWheel(MouseWheelEvent evt)
        {
            MouseWheelHandler dlgt = MouseWheeled;

            if (dlgt != null)
            {
                dlgt(evt.NumDetents);
            }
        }
Exemplo n.º 10
0
        public virtual bool mouseWheelRolled(MouseWheelEvent evt)
        {
            bool ret = (SwigDerivedClassHasMethod("mouseWheelRolled", swigMethodTypes7) ? BitesPINVOKE.InputListener_mouseWheelRolledSwigExplicitInputListener(swigCPtr, MouseWheelEvent.getCPtr(evt)) : BitesPINVOKE.InputListener_mouseWheelRolled(swigCPtr, MouseWheelEvent.getCPtr(evt)));

            if (BitesPINVOKE.SWIGPendingException.Pending)
            {
                throw BitesPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemplo n.º 11
0
        public override bool mouseWheelRolled(MouseWheelEvent evt)
        {
            bool ret = BitesPINVOKE.CameraMan_mouseWheelRolled(swigCPtr, MouseWheelEvent.getCPtr(evt));

            if (BitesPINVOKE.SWIGPendingException.Pending)
            {
                throw BitesPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemplo n.º 12
0
        public EventManager.EventResult handleInput(Event e)
        {
            switch (e.name)
            {
            case "input.keyboard.key.up":
            {
                KeyUpEvent ke = e as KeyUpEvent;
                handleKeyboardUp(ke.key);
                break;
            }

            case "input.keyboard.key.down":
            {
                KeyDownEvent ke = e as KeyDownEvent;
                handleKeyboardDown(ke.key);
                break;
            }

            case "input.mouse.wheel":
            {
                MouseWheelEvent me = e as MouseWheelEvent;
                handleMouseWheel(me.delta);
                break;
            }

            case "input.mouse.button.up":
            {
                MouseButtonUpEvent me = e as MouseButtonUpEvent;
                handleMouseButtonUp(me.button);
                break;
            }

            case "input.mouse.button.down":
            {
                MouseButtonDownEvent me = e as MouseButtonDownEvent;
                handleMouseButtonDown(me.button);
                break;
            }

            case "input.mouse.move":
            {
                MouseMoveEvent me = e as MouseMoveEvent;
                handleMouseMove(me.xDelta, -me.yDelta);
                break;
            }
            }

            return(EventManager.EventResult.HANDLED);
        }
Exemplo n.º 13
0
        private bool sendMouseWheelEvent(Vector2i pos, int wheelTurns, float delta)
        {
            MouseWheelEvent mouseWheelEvent = new MouseWheelEvent(pos, wheelTurns, delta);

            setupTarget(mouseWheelEvent);
            for (EntityRef entity : getInputEntities())
            {
                entity.send(mouseWheelEvent);
                if (mouseWheelEvent.isConsumed())
                {
                    break;
                }
            }
            return(mouseWheelEvent.isConsumed());
        }
Exemplo n.º 14
0
 public static Offset <Event> CreateEvent(FlatBufferBuilder builder,
                                          EventType eventType           = EventType.Hold,
                                          ActionOperator actionOperator = ActionOperator.Or,
                                          KeyID kCode            = KeyID.SDL_SCANCODE_UNKNOWN,
                                          MouseBottonID mouseBtn = MouseBottonID.NONE,
                                          MouseWheelEvent mWheel = MouseWheelEvent.NONE,
                                          ushort joyAxis         = 0,
                                          short joyBtn           = -1)
 {
     builder.StartObject(7);
     Event.AddJoyBtn(builder, joyBtn);
     Event.AddJoyAxis(builder, joyAxis);
     Event.AddMWheel(builder, mWheel);
     Event.AddMouseBtn(builder, mouseBtn);
     Event.AddKCode(builder, kCode);
     Event.AddActionOperator(builder, actionOperator);
     Event.AddEventType(builder, eventType);
     return(Event.EndEvent(builder));
 }
Exemplo n.º 15
0
 /// <summary>
 /// {@inheritDoc}
 /// @since 1.6
 /// </summary>
 public virtual void MouseWheelMoved(MouseWheelEvent e)
 {
 }
Exemplo n.º 16
0
 /// <summary>
 /// Handles the mouseWheelMoved event by invoking the
 /// mouseWheelMoved methods on listener-a and listener-b. </summary>
 /// <param name="e"> the mouse event
 /// @since 1.4 </param>
 public virtual void MouseWheelMoved(MouseWheelEvent e)
 {
     ((MouseWheelListener)a).MouseWheelMoved(e);
     ((MouseWheelListener)b).MouseWheelMoved(e);
 }
Exemplo n.º 17
0
 public override bool mouseWheelRolled(MouseWheelEvent evt)
 {
     return(false); // propgate further;
 }
Exemplo n.º 18
0
 protected void ExecuteMouseWheel(MouseWheelEvent evt)
 {
   MouseWheelHandler dlgt = MouseWheeled;
   if (dlgt != null)
     dlgt(evt.NumDetents);
 }
Exemplo n.º 19
0
 internal override void AutoProcessMouseWheel(MouseWheelEvent e)
 {
     ProcessMouseWheelEvent(e);
 }
Exemplo n.º 20
0
 public void mouseWheelMoved(MouseWheelEvent e)
 {
     zoom(-20 * e.getWheelRotation(), 0);
 }
Exemplo n.º 21
0
 void ProcessMouseWheel(MouseWheelEvent mouseWheelEvent)
 {
     canvas.Input_MouseWheel(mouseWheelEvent.Delta*60);
 }
Exemplo n.º 22
0
        public override bool Poll()
        {
            bool returnStatus = false;



            MouseStateEventData[] eventDataArray;

            lock (_mouseEventData)
            {
                eventDataArray = _mouseEventData.ToArray();
                _mouseEventData.Clear();
            }

            if (eventDataArray.Length == 0)
            {
                return(returnStatus);
            }


            MouseButtons[] currentState = _getButtonState(eventDataArray);

            Point currentPoint = eventDataArray[0].Data.Position;


            MouseButtons[] pressedButtons  = GetNewItems(_mouseStateArray, currentState);
            MouseButtons[] releasedButtons = GetMissingItems(_mouseStateArray, currentState);

            //Subtract current values so positive values result in a positive delta.
            Point relativePoint = currentPoint - _mouseStatePoint;
            int   wheelDelta    = eventDataArray[0].Data.WheelDelta;

            _mouseStateWheel = _mouseStateWheel + wheelDelta;


            MouseEventData eventData = new MouseEventData(pressedButtons, releasedButtons, currentState, currentPoint, relativePoint, _mouseStateWheel, wheelDelta);

            //System.Diagnostics.Trace.WriteLine(eventData.ToString());

            if (pressedButtons.Length != 0 || releasedButtons.Length != 0 || relativePoint != Point.Empty || wheelDelta != 0)
            {
                MouseEvent?.Invoke(new MouseEventArgs(eventData));
                returnStatus = true;
            }

            if (pressedButtons.Length != 0)
            {
                MouseDownEvent?.Invoke(new MouseEventArgs(eventData));
            }

            if (releasedButtons.Length != 0)
            {
                MouseUpEvent?.Invoke(new MouseEventArgs(eventData));
            }


            if (relativePoint != Point.Empty)
            {
                MouseMoveEvent?.Invoke(new MouseEventArgs(eventData));
            }

            if (wheelDelta != 0)
            {
                MouseWheelEvent?.Invoke(new MouseEventArgs(eventData));
            }

            _mouseStateArray = currentState;
            return(returnStatus);
        }
Exemplo n.º 23
0
 private void OnMouseWheel(int wheel) => MouseWheelEvent?.Invoke(this, wheel, DateTime.Now);
Exemplo n.º 24
0
 protected override void OnMouseWheel(MouseWheelEvent e)
 {
     Transfer.Raise(new TransferEvent(Math.Sign(-e.Delta), e.Modifiers));
 }
Exemplo n.º 25
0
 public static void AddMWheel(FlatBufferBuilder builder, MouseWheelEvent mWheel)
 {
     builder.AddShort(4, (short)mWheel, 0);
 }
Exemplo n.º 26
0
 void _mouseHook_Scroll(object sender, MouseWheelEvent e)
 {
     mouseWheel++;
     AppendText("Wheel Delta = {0}{1}", e.Delta, Environment.NewLine);
 }
Exemplo n.º 27
0
 public void ProcessWheelEvent(MouseWheelEvent wheel)
 {
     state.SetScrollRelative(wheel.X, wheel.Y);
 }
Exemplo n.º 28
0
 void ProcessMouseWheel(MouseWheelEvent mouseWheelEvent)
 {
     m_Canvas.Input_MouseWheel(mouseWheelEvent.delta*60);
 }
Exemplo n.º 29
0
 private static void ProcessMouseWheelEvent(Sdl2NativeWindow window, MouseWheelEvent ev)
 {
     window.OnMouseWheel(ev.X, ev.Y, false);
 }
Exemplo n.º 30
0
 protected override void OnMouseWheel(MouseWheelEvent e)
 {
     scrollbar.Value -= e.Delta;
 }
Exemplo n.º 31
0
 ////////////////////////////////////////////////////////////
 /// <summary>
 /// Construct the mouse wheel arguments from a mouse wheel event
 /// </summary>
 /// <param name="e">Mouse wheel event</param>
 ////////////////////////////////////////////////////////////
 public MouseWheelEventArgs(MouseWheelEvent e)
 {
     Delta = e.Delta;
 }
Exemplo n.º 32
0
 void IScreen.MouseWheel(MouseWheelEvent e)
 {
     current.MouseWheel(e);
 }
Exemplo n.º 33
0
 ////////////////////////////////////////////////////////////
 /// <summary>
 /// Construct the mouse wheel arguments from a mouse wheel event
 /// </summary>
 /// <param name="e">Mouse wheel event</param>
 ////////////////////////////////////////////////////////////
 public MouseWheelEventArgs(MouseWheelEvent e)
 {
     Delta = e.Delta;
     X     = e.X;
     Y     = e.Y;
 }
Exemplo n.º 34
0
 protected override void OnMouseWheel(MouseWheelEvent e)
 {
     Scroll(-e.Delta);
     e.Handled = true;
 }
Exemplo n.º 35
0
        protected override IntPtr CustomHookProc(IntPtr wParam, IntPtr lParam)
        {
            MSLLHOOKSTRUCT ms =
                (MSLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MSLLHOOKSTRUCT));
            bool injected = (ms.flags & (uint)LLMHF.INJECTED) != 0;

            switch ((WM)wParam)
            {
            case WM.LBUTTONDOWN:
                if (MouseDownEvent?.Invoke(this, (uint)VK.LBUTTON, ms.pt.x, ms.pt.y, 0, injected) == true)
                {
                    return((IntPtr)(-1));
                }
                break;

            case WM.LBUTTONUP:
                if (MouseUpEvent?.Invoke(this, (uint)VK.LBUTTON, ms.pt.x, ms.pt.y, 0, injected) == true)
                {
                    return((IntPtr)(-1));
                }
                break;

            case WM.MOUSEMOVE:
                if (MouseMoveEvent?.Invoke(this, 0, ms.pt.x, ms.pt.y, 0, injected) == true)
                {
                    return((IntPtr)(-1));
                }
                break;

            case WM.MOUSEWHEEL:
                if (MouseWheelEvent?.Invoke(this, 0, ms.pt.x, ms.pt.y, HighWord(ms.mouseData), injected) == true)
                {
                    return((IntPtr)(-1));
                }
                break;

            case WM.MOUSEHWHEEL:
                if (MouseHWheelEvent?.Invoke(this, 0, ms.pt.x, ms.pt.y, HighWord(ms.mouseData), injected) == true)
                {
                    return((IntPtr)(-1));
                }
                break;

            case WM.RBUTTONDOWN:
                if (MouseDownEvent?.Invoke(this, (uint)VK.RBUTTON, ms.pt.x, ms.pt.y, 0, injected) == true)
                {
                    return((IntPtr)(-1));
                }
                break;

            case WM.RBUTTONUP:
                if (MouseUpEvent?.Invoke(this, (uint)VK.RBUTTON, ms.pt.x, ms.pt.y, 0, injected) == true)
                {
                    return((IntPtr)(-1));
                }
                break;

            case WM.MBUTTONDOWN:
                if (MouseDownEvent?.Invoke(this, (uint)VK.MBUTTON, ms.pt.x, ms.pt.y, 0, injected) == true)
                {
                    return((IntPtr)(-1));
                }
                break;

            case WM.MBUTTONUP:
                if (MouseUpEvent?.Invoke(this, (uint)VK.MBUTTON, ms.pt.x, ms.pt.y, 0, injected) == true)
                {
                    return((IntPtr)(-1));
                }
                break;

            case WM.XBUTTONDOWN:
                if (HighWord(ms.mouseData) == (int)MOUSEDATA.XBUTTON1)
                {
                    if (MouseDownEvent?.Invoke(this, (uint)VK.XBUTTON1, ms.pt.x, ms.pt.y, 0, injected) == true)
                    {
                        return((IntPtr)(-1));
                    }
                }
                else if (HighWord(ms.mouseData) == (int)MOUSEDATA.XBUTTON2)
                {
                    if (MouseDownEvent?.Invoke(this, (uint)VK.XBUTTON2, ms.pt.x, ms.pt.y, 0, injected) == true)
                    {
                        return((IntPtr)(-1));
                    }
                }
                break;

            case WM.XBUTTONUP:
                if (HighWord(ms.mouseData) == (int)MOUSEDATA.XBUTTON1)
                {
                    if (MouseUpEvent?.Invoke(this, (uint)VK.XBUTTON1, ms.pt.x, ms.pt.y, 0, injected) == true)
                    {
                        return((IntPtr)(-1));
                    }
                }
                else if (HighWord(ms.mouseData) == (int)MOUSEDATA.XBUTTON2)
                {
                    if (MouseUpEvent?.Invoke(this, (uint)VK.XBUTTON2, ms.pt.x, ms.pt.y, 0, injected) == true)
                    {
                        return((IntPtr)(-1));
                    }
                }
                break;
            }
            return(IntPtr.Zero);
        }
Exemplo n.º 36
0
 /// <summary>
 /// Processes mouse wheel events occurring on this component by
 /// dispatching them to any registered
 /// <code>MouseWheelListener</code> objects.
 /// </summary>
 protected void processMouseWheelEvent(MouseWheelEvent @e)
 {
 }