Ejemplo n.º 1
0
 private void m_btnClose_MouseEvent(Sprite sender, System.Windows.Forms.MouseEventArgs e, MouseEventType t)
 {
     if (t == Sprite.MouseEventType.Click)
     {
         ((Form)Parent).Close();
     }
 }
Ejemplo n.º 2
0
 private void m_frame_MouseEvent(Sprite sender, System.Windows.Forms.MouseEventArgs e, MouseEventType t)
 {
     if (t == Sprite.MouseEventType.StillDown)
     {
         EPointF pntDiff = new EPointF(e.X-m_frame.MouseLastLoc.X, e.Y-m_frame.MouseLastLoc.Y);
         this.Parent.Move(pntDiff);
     }
 }
Ejemplo n.º 3
0
	public void FireEvent (MouseEventType t, Vector3 position)
	{
		if (t == MouseEventType.Down)
		{
			DownAction(position);
		}
		else if (t == MouseEventType.Up)
		{
			UpAction(position);
		}
	}
Ejemplo n.º 4
0
        private void PlayerBall_MouseEvent(Sprite sender, System.Windows.Forms.MouseEventArgs e, MouseEventType t)
        {
            if (t == Sprite.MouseEventType.Down)
            {
                forceMarker.Visible = true;
            }
            else if (t == Sprite.MouseEventType.StillDown)
            {
                MemberSpriteBitmap mb = forceMarker.Member;
                if (mb!=null)
                    mb.Dispose();

                //this.MouseDownLoc.X, this.MouseDownLoc.Y
                ERectangleF rctLine = ERectangleF.FromLTRB(this.Loc.X, this.Loc.Y, this.MouseLastLoc.X, this.MouseLastLoc.Y);
                forceVector = rctLine.Size;

                if (rctLine.Width != 0 && rctLine.Height != 0)
                {
                    Bitmap bmp = new Bitmap((int)Math.Abs(rctLine.Width)+1, (int)Math.Abs(rctLine.Height)+1, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
                    Graphics g = Graphics.FromImage(bmp);

                    ERectangleF rctOrigo = rctLine.Copy();
                    rctOrigo.MakeTopLeftAtOrigo();

                    Pen pen = new Pen(Color.Red, 2);
                    g.DrawLine(pen, rctOrigo.X, rctOrigo.Y, rctOrigo.X+rctOrigo.Width, rctOrigo.Y+rctOrigo.Height);
                    g.Dispose();

                    EPointF locOffset = new EPointF();
                    if (rctOrigo.Width < 0)
                        locOffset.X = rctOrigo.Width;
                    if (rctOrigo.Height < 0)
                        locOffset.Y = rctOrigo.Height;

                    mb = new MemberSpriteBitmap(bmp);
                    forceMarker.Member = mb;
                    forceMarker.Loc = this.Loc + locOffset;
                }
                else
                    forceMarker.Member = null;
            }
            else if (t == Sprite.MouseEventType.UpOutside || t == Sprite.MouseEventType.Click)
            {
                this.Velocity = forceVector*-0.1f;

                forceMarker.Visible = false;
                MemberSpriteBitmap mb = forceMarker.Member;
                if (mb!=null)
                {
                    forceMarker.Member = null;
                    mb.Dispose();
                }
            }
        }
        /// <summary> Adds an action that should occur when the key is down. </summary>
        /// <param name="type"> The type of mouse event that causes the action to be invoked. </param>
        /// <param name="key"> The key that should be checked. </param>
        /// <param name="action"> The action to perform if the key is down. </param>
        public void Add(MouseEventType type, MouseButton key, Action action)
        {
            switch (type)
            {
            case MouseEventType.ButtonDown:
                _actions.Add(new MouseDownEventAction(key, action));
                break;

            default:
                throw new ArgumentOutOfRangeException("type", type, null);
            }
        }
Ejemplo n.º 6
0
 protected override void OnMouse(MouseEventArgs e, MouseEventType t)
 {
     if (t == MouseEventType.Click)
     {
         m_bChecked=!m_bChecked;
         if (m_bChecked)
             base.SetState(MouseEventType.Enter);
         else
             base.SetState(MouseEventType.Leave);
     }
     //base.base.OnMouse(e,t);
 }
Ejemplo n.º 7
0
 public MouseEventArgs(MouseEventType eventType, IPoint coords, int delta, MouseButtons key, KeyState keyState, bool isDoubleClick, DateTime time, bool canPreventDefault = true)
 {
     MouseEventType    = eventType;
     Coords            = coords;
     Delta             = delta;
     Key               = key;
     KeyState          = keyState;
     IsDoubleClick     = isDoubleClick;
     Time              = time;
     DefaultPrevented  = false;
     CanPreventDefault = canPreventDefault;
 }
Ejemplo n.º 8
0
 public MouseEventData(MouseEventType type, InputFlags flags, TimeSpan time, int frame, MouseState previousState, MouseState currentState, MouseButton button = MouseButton.None)
 {
     EventType        = type;
     Flags            = flags;
     Position         = new Point(currentState.X, currentState.Y);
     Button           = button;
     ScrollWheelValue = currentState.ScrollWheelValue;
     ScrollWheelDelta = currentState.ScrollWheelValue - previousState.ScrollWheelValue;
     Time             = time;
     Frame            = frame;
     ClickCount       = 0;
 }
Ejemplo n.º 9
0
        public void Execuite(MouseEventType eventType, Point point, float wheelDelta = 0, uint count = 1)
        {
            switch (eventType)
            {
            case MouseEventType.Move:
                _inputSimulator.MoveMouseTo(point.X, point.Y);
                break;

            case MouseEventType.LeftDown:
                _inputSimulator.MouseButtonDown(MuseKey.Left);
                break;

            case MouseEventType.LeftUp:
                _inputSimulator.MouseButtonUp(MuseKey.Left);
                break;

            case MouseEventType.RightDown:
                _inputSimulator.MouseButtonDown(MuseKey.Right);
                break;

            case MouseEventType.RightUp:
                _inputSimulator.MouseButtonUp(MuseKey.Right);
                break;

            case MouseEventType.LeftClick:
                _inputSimulator.MouseButtonClick(MuseKey.Left, count);
                break;

            case MouseEventType.RightClick:
                _inputSimulator.MouseButtonClick(MuseKey.Right, count);
                break;

            case MouseEventType.MiddleClick:
                _inputSimulator.MouseButtonClick(MuseKey.Middle, count);
                break;

            case MouseEventType.MiddleUp:
                _inputSimulator.MouseButtonUp(MuseKey.Middle);
                break;

            case MouseEventType.MiddleDown:
                _inputSimulator.MouseButtonDown(MuseKey.Middle);
                break;

            case MouseEventType.ScrollWheel:
                _inputSimulator.MouseScroll(wheelDelta);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(eventType), eventType, null);
            }
        }
Ejemplo n.º 10
0
        protected override int HookCallbackProcedure(int nCode, int wParam, IntPtr lParam)
        {
            if (nCode > -1 && (MouseDown != null || MouseUp != null || MouseMove != null))
            {
                MouseLLHookStruct mouseHookStruct =
                    (MouseLLHookStruct)Marshal.PtrToStructure(lParam, typeof(MouseLLHookStruct));

                MouseButtons   button    = GetButton(wParam);
                MouseEventType eventType = GetEventType(wParam);

                MouseEventArgs e = new MouseEventArgs(
                    button,
                    (eventType == MouseEventType.DoubleClick ? 2 : 1),
                    mouseHookStruct.pt.x,
                    mouseHookStruct.pt.y,
                    (eventType == MouseEventType.MouseWheel ? (short)((mouseHookStruct.mouseData >> 16) & 0xffff) : 0));

                // Prevent multiple Right Click events (this probably happens for popup menus)
                if (button == MouseButtons.Right && mouseHookStruct.flags != 0)
                {
                    eventType = MouseEventType.None;
                }

                switch (eventType)
                {
                case MouseEventType.MouseDown:
                    MouseDown?.Invoke(this, e);
                    break;

                case MouseEventType.MouseUp:
                    Click?.Invoke(this, new EventArgs());
                    MouseUp?.Invoke(this, e);
                    break;

                case MouseEventType.DoubleClick:
                    DoubleClick?.Invoke(this, new EventArgs());
                    break;

                case MouseEventType.MouseWheel:
                    MouseWheel?.Invoke(this, e);
                    break;

                case MouseEventType.MouseMove:
                    MouseMove?.Invoke(this, e);
                    break;

                default:
                    break;
                }
            }
            return(CallNextHookEx(_handleToHook, nCode, wParam, lParam));
        }
Ejemplo n.º 11
0
 private void FireButton(IMouseState state, MouseButtons button, MouseEventType eventType)
 {
     inputService.OnInputEvent(new MouseEventArgs
     {
         ComplexEventType = eventType,
         EventButtons     = button,
         State            = state,
         Delta            = IntVector2.Zero,
         WheelDelta       = 0,
         KeyModifyers     = GetKeyModifyersFromInput(),
         Viewport         = guiLazy.Value.RenderControl.Viewports.Single()
     });
 }
Ejemplo n.º 12
0
        void OnMouseClick(GameObject target, MouseEventType eventType)
        {
            DrawableTweener.TweenSpriteAlpha(_onHoverSprite, _onHoverSprite.alpha, 0,
                                             Settings.Default_AlphaTween_Duration / 3, () =>
            {
                DrawableTweener.TweenSpriteAlpha(_onHoverSprite, _onHoverSprite.alpha, 1,
                                                 Settings.Default_AlphaTween_Duration / 3);
            });

            FlashbackManager.Instance.ResetMemorySequence();

            Console.WriteLine($"{this}: clicked");
        }
Ejemplo n.º 13
0
        private void SendMouseButtonEvent(int x, int y, MouseButton btn, MouseEventType type)
        {
            var msg = new MouseMessage {
                Type        = type,
                X           = x,
                Y           = y,
                GenericType = BrowserEventType.Mouse,
                // Delta = e.Delta,
                Button = btn
            };

            _mainEngine.SendMouseEvent(msg);
        }
Ejemplo n.º 14
0
		/// <summary>
		/// Returns NShapeMouseEventArgs buildt with the provided parameters
		/// </summary>
		public static MouseEventArgsDg GetMouseEventArgs(MouseEventType eventType, MouseButtons mouseButtons, int clicks, int x, int y, int delta, Rectangle controlBounds) {
			mouseEventArgs.SetButtons(mouseButtons);
			mouseEventArgs.SetClicks(clicks);
			mouseEventArgs.SetEventType(eventType);
			if (Geometry.IsValid(controlBounds))
				mouseEventArgs.SetPosition(
					Math.Min(Math.Max(controlBounds.Left, x), controlBounds.Right), 
					Math.Min(Math.Max(controlBounds.Top, y), controlBounds.Bottom)
				);
			else mouseEventArgs.SetPosition(x, y);
			mouseEventArgs.SetWheelDelta(delta);
			mouseEventArgs.SetModifiers(GetModifiers());
			return mouseEventArgs;
		}
Ejemplo n.º 15
0
 internal ChartPaneMouseEventArgs( MouseEventType type,
                                   TimeSeriesChart chart,
                                   PlotPane pane,
                                   MouseEventArgs mouse,
                                   ITimeSeriesSample sample,
                                   float value)
 {
   this.EventType = type;
   this.Chart = chart;
   this.Pane = pane;
   this.MouseEvent = mouse;
   this.SampleAtX = sample;
   this.ValueAtY = value;
 }
Ejemplo n.º 16
0
        public override Control TriggerMouseInput(MouseEventType mouseEventType, MouseState ms)
        {
            List <Control> ZSortedChildren = _children.OrderByDescending(i => i.ZIndex).ToList();

            foreach (var childControl in ZSortedChildren)
            {
                if (childControl.AbsoluteBounds.Contains(ms.Position) && childControl.Visible)
                {
                    return(childControl.TriggerMouseInput(mouseEventType, ms));
                }
            }

            return(null);
        }
Ejemplo n.º 17
0
 internal ChartPaneMouseEventArgs(MouseEventType type,
                                  TimeSeriesChart chart,
                                  PlotPane pane,
                                  MouseEventArgs mouse,
                                  ITimeSeriesSample sample,
                                  float value)
 {
     this.EventType  = type;
     this.Chart      = chart;
     this.Pane       = pane;
     this.MouseEvent = mouse;
     this.SampleAtX  = sample;
     this.ValueAtY   = value;
 }
        public MouseClickEventMessage(MouseEventType eventType, uint xPosition, uint yPosition)
        {
            using (var memoryStream = new MemoryStream())
            {
                var writer = new BinaryWriter(memoryStream);
                writer.Write((byte) eventType);
                writer.Write(xPosition);
                writer.Write(yPosition);

                messageBuffer = memoryStream.ToArray();
            }

            InitialiseFieldPositions();
        }
Ejemplo n.º 19
0
        private void FireRawInputEvent(ref RawInput ri)
        {
            try
            {
                TraceLogger.Instance.WriteLineVerbos("FireRawInputEvent: " + ri.Header.dwType);
                switch (ri.Header.dwType)
                {
                case (int)RawInputType.Mouse:
                    if (RawInputMouseEvent != null)
                    {
                        //if (Enum.IsDefined(typeof(MouseEventType), (short)(ri.Data.Mouse.ulButtons & ushort.MaxValue)))
                        {
                            MouseEventType evt = (MouseEventType)ri.Data.Mouse.ulButtons;
                            int            x   = Cursor.Position.X;
                            int            y   = Cursor.Position.Y;
                            RawInputMouseEvent(evt, x, y);
                        }
                        //else
                        {
                            //TraceLogger.Instance.WriteLineInfo(string.Format("Undefined MouseEventType: {0:X}", ri.Data.Mouse.ulButtons));
                        }
                    }
                    break;

                case (int)RawInputType.KeyBoard:
                    if (RawInputKeyboardEvent != null)
                    {
                        //if (Enum.IsDefined(typeof(KeyboardEventType), (short)ri.Data.Keyboard.Message))
                        {
                            KeyboardEventType evt = (KeyboardEventType)ri.Data.Keyboard.Message;
                            Keys key = (Keys)ri.Data.Keyboard.VKey;
                            RawInputKeyboardEvent(evt, key);
                        }
                        //else
                        {
                            //TraceLogger.Instance.WriteLineInfo(string.Format("Undefined KeyboardEventType: {0:X}", ri.Data.Keyboard.Message));
                        }
                    }
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                TraceLogger.Instance.WriteException(ex);
            }
        }
Ejemplo n.º 20
0
 private void irrlichtPanel_MouseWheel(object sender, MouseEventArgs e)
 {
     if (device != null)
     {
         MouseEventType mev          = MouseEventType.Wheel;
         uint           buttonStates = 7;
         float          wheel        = e.Delta;
         Event          evt          = new Event(mev, e.X, e.Y, wheel, buttonStates);
         smgr.PostEvent(evt);
         if (smgr.ActiveCamera != null)
         {
             lightNode.Position = smgr.ActiveCamera.Position;
         }
     }
 }
Ejemplo n.º 21
0
 internal void OnRightMouseClick()
 {
     /* Called by the GridBox parent of the square
      * when the right mouse button is clicked while in the square's area.
      * Resets the square's BackColor property to the
      * parent's default background color.
      * Basically, "deletes" the color from the square. */
     BackColor = Parent.DefaultBackgroundColor;
     if (Parent.PaintedSquares.ContainsKey(this.Location))
     {
         Parent.PaintedSquares.Remove(this.Location);
     }
     MouseEvent = MouseEventType.Leave; // To signal that we should use Square.BackColor.
     Parent.Invalidate(this.AreaRectangle);
 }
Ejemplo n.º 22
0
        public void SetState(MouseEventType t)
        {
            object o = m_plStateSprites[t];

            if (o != null)
            {
                for (int i = 0; i < m_plStateSprites.Count; i++)
                {
                    ((Sprite)m_plStateSprites.GetByIndex(i)).Visible = false;
                }

                Sprite sp = (Sprite)o;
                sp.Visible = true;
            }
        }
Ejemplo n.º 23
0
        protected override void OnMouseWheel(MouseEventType delta)
        {
            switch (delta)
            {
            case MouseEventType.WheelScrollUp:
                _scrollBar.Value -= _scrollBar.ScrollStep;

                break;

            case MouseEventType.WheelScrollDown:
                _scrollBar.Value += _scrollBar.ScrollStep;

                break;
            }
        }
Ejemplo n.º 24
0
 protected override void OnMouse(MouseEventArgs e, MouseEventType t)
 {
     if (t == MouseEventType.Click)
     {
         m_bChecked = !m_bChecked;
         if (m_bChecked)
         {
             base.SetState(MouseEventType.Enter);
         }
         else
         {
             base.SetState(MouseEventType.Leave);
         }
     }
     //base.base.OnMouse(e,t);
 }
        public static bool IsOfType(this IMouseEvent eventArgs, MouseEventType type)
        {
            if (eventArgs.ComplexEventType == type)
            {
                return(true);
            }
            switch (eventArgs.ComplexEventType)
            {
            case MouseEventType.Click:
                return(type == MouseEventType.Click || type == MouseEventType.Up);

            case MouseEventType.DoubleClick:
                return(type == MouseEventType.DoubleClick || type == MouseEventType.Click || type == MouseEventType.Up);
            }
            return(false);
        }
Ejemplo n.º 26
0
        public void onTouchPcSelector(MouseEventArgs e, MouseEventType.EventType eventType)
        {
            btnReturn.glowOn = false;

            //int eventAction = event.getAction();
            switch (eventType)
            {
                case MouseEventType.EventType.MouseDown:
                case MouseEventType.EventType.MouseMove:
                    int x = (int)e.X;
                    int y = (int)e.Y;

                    if (btnReturn.getImpact(x, y))
                    {
                        btnReturn.glowOn = true;
                    }
                    break;

                case MouseEventType.EventType.MouseUp:
                    x = (int)e.X;
                    y = (int)e.Y;

                    btnReturn.glowOn = false;

                    Player pc = mod.playerList[pcSelectorPcIndex];

                    if (btnReturn.getImpact(x, y))
                    {
                        //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                        //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                        if (pcSelectorType.Equals("spellcaster"))
                        {
                            gv.screenType = "main";
                        }
                    }
                    for (int j = 0; j < mod.playerList.Count; j++)
                    {
                        if (btnPartyIndex[j].getImpact(x, y))
                        {
                            //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                            //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                            pcSelectorPcIndex = j;
                        }
                    }
                    break;
            }
        }
Ejemplo n.º 27
0
 protected override void OnMouse(MouseEventArgs e, MouseEventType t)
 {
     if (t == MouseEventType.Down)
         this.Color = Color.FromArgb(this.Color.R, this.Color.G, 0);
     else if (t == MouseEventType.Up || t == MouseEventType.UpOutside || t == MouseEventType.Click)
         this.Color = Color.FromArgb(this.Color.R, this.Color.G, 255);
     else if (t == MouseEventType.Enter)
         this.Color = Color.FromArgb(0, this.Color.G, this.Color.B);
     else if (t == MouseEventType.Leave)
         this.Color = Color.FromArgb(255, this.Color.G, this.Color.B);
     else if (t == MouseEventType.StillDown)
     {
         Scaling = new EPointF(1.0f+0.005f*e.X, 1);
         Loc = new EPointF(e.X, e.Y);
         Blend = (int)(100*e.X*1.0/100);
     }
 }
        /// <summary>
        /// Get unique source id for mouse event.
        /// </summary>
        /// <param name="eventType">Type of mouse event.</param>
        /// <param name="scroll">Scroll event source.</param>
        /// <param name="scrollDirection">Type of scroll event.</param>
        /// <param name="button">Button event source.</param>
        /// <param name="buttonDirection">Type of button event.</param>
        /// <returns>Unique id for event.</returns>
        public static int GetEventSourceId(MouseEventType eventType, ScrollSource scroll, ScrollChangeDirection scrollDirection, ButtonSource button, ButtonChangeDirection buttonDirection)
        {
            switch (eventType)
            {
            case MouseEventType.Move:
                return((int)eventType);

            case MouseEventType.Scroll:
                return((int)eventType + ((int)scroll * Multiplier2) + ((int)scrollDirection * Multiplier3));

            case MouseEventType.Button:
                return((int)eventType + ((int)button * Multiplier2) + ((int)buttonDirection * Multiplier3));

            default:
                return(0);
            }
        }
Ejemplo n.º 29
0
        private LayerMouseEventArgs GetMouseEventArgs(MouseEventType eventType, MouseEventArgs eventArgs)
        {
            // Find clicked layer item
            Layer     layer     = null;
            LayerItem layerItem = LayerItem.None;

            ListViewHitTestInfo hitTestInfo = HitTest(eventArgs.Location);

            if (hitTestInfo != null && hitTestInfo.Item != null)
            {
                // Set Layer
                layer = ((LayerInfo)hitTestInfo.Item.Tag).layer;
                // Determine subitem type
                int colIdx = hitTestInfo.Item.SubItems.IndexOf(hitTestInfo.SubItem);
                if (colIdx == idxColumnState)
                {
                    layerItem = LayerItem.ActiveState;
                }
                else if (colIdx == idxColumnVisibility)
                {
                    layerItem = LayerItem.Visibility;
                }
                else if (colIdx == idxColumnName)
                {
                    // Check if the click was inside the layer name's text bounds
                    Size txtSize = TextRenderer.MeasureText(hitTestInfo.SubItem.Text, Font);
                    if (Geometry.RectangleContainsPoint(hitTestInfo.SubItem.Bounds.X, hitTestInfo.SubItem.Bounds.Y, txtSize.Width,
                                                        txtSize.Height, eventArgs.X, eventArgs.Y))
                    {
                        layerItem = LayerItem.Name;
                    }
                }
                else if (colIdx == idxColumnLowerZoomBound)
                {
                    layerItem = LayerItem.MinZoom;
                }
                else if (colIdx == idxColumnUpperZoomBound)
                {
                    layerItem = LayerItem.MaxZoom;
                }
            }
            // Create EventArgs and fire event
            layerItemMouseEventArgs.SetMouseEvent(layer, layerItem, eventType, eventArgs);
            return(layerItemMouseEventArgs);
        }
Ejemplo n.º 30
0
        void SendMouseEvent(double ev_x, double ev_y, MouseEventType type)
        {
            double x, y;
            int    drawing_square = drawing_area.DrawingSquare;

            x = ev_x - drawing_area.OffsetX;
            y = ev_y - drawing_area.OffsetY;

            if (x < 0 || y < 0 || x > drawing_square || y > drawing_square)
            {
                return;
            }

            x = x / drawing_square;
            y = y / drawing_square;

            session.MouseEvent(this, new MouseEventArgs(x, y, type));
        }
Ejemplo n.º 31
0
        public static void MouseDown(MouseEventType type, int x, int y)
        {
            SetCursorPos(x, y);
            switch (type)
            {
            case MouseEventType.LEFT:
                Mouse(LBDOWN);
                break;

            case MouseEventType.RIGHT:
                Mouse(RBDOWN);
                break;

            case MouseEventType.WHEEL:
                Mouse(MBDOWN);
                break;
            }
        }
Ejemplo n.º 32
0
 /// <summary>
 /// 发送鼠标事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 /// <param name="flag"></param>
 private void sendMouseEvent(object sender, MouseEventArgs e, MouseEventType flag)
 {
     if (currentControler == null)
     {
         lbl_Message.Text = ("你还没连接任何主机或连接中断!");
     }
     else
     {
         PictureBox screenPict = (PictureBox)sender;
         Point      epoint     = ToScreenPoint(screenPict, e.Location);
         MouseEvent code       = new MouseEvent(flag, epoint.X, epoint.Y);
         code.Head = CodeHead.CONTROL_MOUSE;
         if (epoint.X != -1)
         {
             currentControler.SendCode(code);
         }
     }
 }
Ejemplo n.º 33
0
        /// <summary>
        /// 发送鼠标数据给浏览器
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="btn"></param>
        /// <param name="type"></param>
        private void SendMouseButtonEvent(int x, int y, MouseButton btn, MouseEventType type)
        {
            if (_mainEngine == null)
            {
                return;
            }

            MouseMessage msg = new MouseMessage
            {
                Type        = type,
                X           = x,
                Y           = y,
                GenericType = MessageLibrary.BrowserEventType.Mouse,
                // Delta = e.Delta,
                Button = btn
            };

            _mainEngine.SendMouseEvent(msg);
        }
Ejemplo n.º 34
0
 public void FireEvent(MouseEventType t, Vector3 position)
 {
     if (t == MouseEventType.Down)
     {
         DownAction(position);
     }
     else if (t == MouseEventType.Up)
     {
         UpAction(position);
     }
     else if (t == MouseEventType.RightDown)
     {
         RightDownAction(position);
     }
     else if (t == MouseEventType.RightUp)
     {
         RightUpAction(position);
     }
 }
Ejemplo n.º 35
0
        public static void MouseUp(MouseEventType type, int x, int y)
        {
            int ret = SetCursorPos(x, y);

            switch (type)
            {
            case MouseEventType.LEFT:
                Mouse(LBUP);
                break;

            case MouseEventType.RIGHT:
                Mouse(RBUP);
                break;

            case MouseEventType.WHEEL:
                Mouse(MBUP);
                break;
            }
        }
Ejemplo n.º 36
0
        public static MouseEventArgs CreateMouseEvent(this IWidget widget, MouseEventType type, MouseButton button, int x, int y, InputFlags flags = InputFlags.None)
        {
            switch (button)
            {
            case MouseButton.Left:
                flags |= InputFlags.Mouse1;
                break;

            case MouseButton.Right:
                flags |= InputFlags.Mouse3;
                break;

            case MouseButton.Middle:
                flags |= InputFlags.Mouse2;
                break;
            }

            return(new MouseEventArgs(widget, new MouseEventData(type, flags, TimeSpan.FromMilliseconds(10), 0, new Point(x, y), button)));
        }
Ejemplo n.º 37
0
 /// <summary>
 /// Returns NShapeMouseEventArgs buildt with the provided parameters
 /// </summary>
 public static MouseEventArgsDg GetMouseEventArgs(MouseEventType eventType, MouseButtons mouseButtons, int clicks, int x, int y, int delta, Rectangle controlBounds)
 {
     mouseEventArgs.SetButtons(mouseButtons);
     mouseEventArgs.SetClicks(clicks);
     mouseEventArgs.SetEventType(eventType);
     if (Geometry.IsValid(controlBounds))
     {
         mouseEventArgs.SetPosition(
             Math.Min(Math.Max(controlBounds.Left, x), controlBounds.Right),
             Math.Min(Math.Max(controlBounds.Top, y), controlBounds.Bottom)
             );
     }
     else
     {
         mouseEventArgs.SetPosition(x, y);
     }
     mouseEventArgs.SetWheelDelta(delta);
     mouseEventArgs.SetModifiers(GetModifiers());
     return(mouseEventArgs);
 }
        private void OnMouseDown(object sender, MouseEventArgs e)
        {
            switch (e.Button)
            {
                case MouseButtons.Left:
                    dragStartMouseEventType = MouseEventType.Left;
                    break;
                case MouseButtons.Middle:
                    dragStartMouseEventType = MouseEventType.Middle;
                    break;
                case MouseButtons.Right:
                    dragStartMouseEventType = MouseEventType.Right;
                    break;
                default:
                    return;
            }

            dragStartX = e.X;
            dragStartY = e.Y;
        }
Ejemplo n.º 39
0
        public override void MouseEvent(MouseEventType ev, MouseButtons mb, int x, int y)
        {
            foreach (var osEmulatorGuiElement in Elements)
            {
                osEmulatorGuiElement.IsFocused = false;
                osEmulatorGuiElement.MouseEvent(ev, mb, x, y);
            }
            if (mb == MouseButtons.Left && ev == MouseEventType.Up)
            {
                bool was = false;
                OsEmulatorDirectory selected = null;
                foreach (var directory in Elements.OfType <OsEmulatorDirectory>())
                {
                    if (directory.IsSelected)
                    {
                        selected = directory;
                    }
                    directory.IsSelected = false;
                }

                DirectoryInfo toOpen = null;
                foreach (var directory in Elements.OfType <OsEmulatorDirectory>())
                {
                    Rectangle r = new Rectangle((int)directory.Position.X, (int)directory.Position.Y, 30, 30);
                    if (r.IntersectsWith(new Rectangle(Cursor.X, Cursor.Y, 1, 1)))
                    {
                        if (selected == directory)
                        {
                            toOpen = directory.Info;
                            was    = true;
                        }
                        directory.IsSelected = true;
                    }
                }

                if (was)
                {
                    UpdateDirectoriesElements(toOpen.FullName);
                }
            }
        }
Ejemplo n.º 40
0
 public MouseEventData(
     MouseEventType eventType,
     InputFlags flags,
     TimeSpan time,
     int frame,
     Point position,
     MouseButton button   = MouseButton.None,
     int clickCount       = 0,
     int scrollWheelValue = 0,
     int scrollWheelDelta = 0)
 {
     ClickCount       = clickCount;
     Time             = time;
     Frame            = frame;
     EventType        = eventType;
     Button           = button;
     Position         = position;
     ScrollWheelValue = scrollWheelValue;
     ScrollWheelDelta = scrollWheelDelta;
     Flags            = flags;
 }
Ejemplo n.º 41
0
        public void AddMouseEvent(MouseEventType eventType, Action action)
        {
            switch (eventType)
            {
            case MouseEventType.OnMouseMove:
                mouse.MouseMoveAction = action;
                break;

            case MouseEventType.OnMouseHover:
                mouse.MouseHoverAction = action;
                break;

            case MouseEventType.OnMouseScrollUp:
                mouse.MouseScrollUpAction = action;
                break;

            case MouseEventType.OnMouseScrollDown:
                mouse.MouseScrollDownAction = action;
                break;
            }
        }
Ejemplo n.º 42
0
 public void SetEventType(MouseEventType eventType)
 {
     this.eventType = eventType;
 }
Ejemplo n.º 43
0
 /// <summary>
 /// Returns NShapeMouseEventArgs buildt with the provided parameters
 /// </summary>
 public static MouseEventArgsDg GetMouseEventArgs(MouseEventType eventType, MouseButtons mouseButtons, int clicks, int x, int y, int delta)
 {
     return GetMouseEventArgs(eventType, mouseButtons, clicks, x, y, delta, Geometry.InvalidRectangle);
 }
Ejemplo n.º 44
0
 /// <summary>
 /// Returns NShapeMouseEventArgs extracted from information provided by the <see cref="T:System.Windows.Forms.Control" /> class.
 /// </summary>
 public static MouseEventArgsDg GetMouseEventArgs(Control control, MouseEventType eventType, int clicks, int delta)
 {
     Point mousePos = control.PointToClient(Control.MousePosition);
     return GetMouseEventArgs(eventType, Control.MouseButtons, clicks, mousePos.X, mousePos.Y, delta, control.Bounds);
 }
Ejemplo n.º 45
0
 /// <summary>
 /// Extracts and returns NShapeMouseEventArgs from <see cref="T:Windows.Forms.MouseEventArgs" />.
 /// </summary>
 public static MouseEventArgsDg GetMouseEventArgs(MouseEventType eventType, MouseEventArgs e, Rectangle controlBounds)
 {
     return GetMouseEventArgs(eventType, e.Button, e.Clicks, e.X, e.Y, e.Delta, controlBounds);
 }
Ejemplo n.º 46
0
		/// <summary>
		/// Initializing a new instance of <see cref="T:Dataweb.NShape.Controllers.MouseEventArgsDg" />.
		/// </summary>
		public MouseEventArgsDg(MouseEventType eventType, MouseButtonsDg buttons, int clicks, int delta, Point location,
		                        KeysDg modifiers)
		{
			this.buttons = buttons;
			this.clicks = clicks;
			this.wheelDelta = delta;
			this.eventType = eventType;
			this.position = location;
			this.modifiers = modifiers;
		}
Ejemplo n.º 47
0
			public LayerListViewMouseEventArgs(Layer layer, LayerItem item,
				MouseEventType eventType, MouseButtonsDg buttons, int clickCount, int wheelDelta,
				Point position, KeysDg modifiers)
				: base(layer, item, eventType, buttons, clickCount, wheelDelta, position, modifiers) {
			}
Ejemplo n.º 48
0
 private void m_sliderHandle_MouseEvent(Sprite sender, System.Windows.Forms.MouseEventArgs e, MouseEventType t)
 {
     if (t == Endogine.Sprite.MouseEventType.StillDown || t == Endogine.Sprite.MouseEventType.Click)
     {
         //m_sliderHandle.Color = System.Drawing.Color.FromArgb((int)(m_sliderHandle.Position*255),255,255);
         if (SliderEvent!=null)
             SliderEvent(m_sliderHandle.Position, t);
     }
 }
Ejemplo n.º 49
0
 void EnqueueEvent(MouseButtons button, MouseEventType mouseEventType, int delta = 0)
 {
     events.Enqueue(new MouseEventInfo
     {
         EventType = mouseEventType,
         Buttons = button,
         Delta = delta,
         X = gameWindow.Mouse.X,
         Y = gameWindow.Mouse.Y
     });
 }
Ejemplo n.º 50
0
        public void onTouchItemSelector(MouseEventArgs e, MouseEventType.EventType eventType)
        {
            btnInventoryLeft.glowOn = false;
            btnInventoryRight.glowOn = false;
            btnInfo.glowOn = false;
            btnAction.glowOn = false;
            btnExit.glowOn = false;
            if ((itemSelectorType.Equals("container")) || (itemSelectorType.Equals("equip")))
            {
                btnAction2.glowOn = false;
            }

            //int eventAction = event.getAction();
            switch (eventType)
            {
            case MouseEventType.EventType.MouseDown:
            case MouseEventType.EventType.MouseMove:
                int x = (int) e.X;
                int y = (int) e.Y;
                if (btnInventoryLeft.getImpact(x, y))
                {
                    btnInventoryLeft.glowOn = true;
                }
                else if (btnInventoryRight.getImpact(x, y))
                {
                    btnInventoryRight.glowOn = true;
                }
                else if (btnInfo.getImpact(x, y))
                {
                    btnInfo.glowOn = true;
                }
                else if (btnAction.getImpact(x, y))
                {
                    btnAction.glowOn = true;
                }
                else if (btnExit.getImpact(x, y))
                {
                    btnExit.glowOn = true;
                }
                else if (((itemSelectorType.Equals("container")) || (itemSelectorType.Equals("equip"))) && (btnAction2.getImpact(x,y)))
                {
                    btnAction2.glowOn = true;
                }
                break;

            case MouseEventType.EventType.MouseUp:
                x = (int) e.X;
                y = (int) e.Y;

                btnInventoryLeft.glowOn = false;
                btnInventoryRight.glowOn = false;
                btnInfo.glowOn = false;
                btnAction.glowOn = false;
                btnExit.glowOn = false;
                if ((itemSelectorType.Equals("container")) || (itemSelectorType.Equals("equip")))
                {
                    btnAction2.glowOn = false;
                }

                for (int j = 0; j < slotsPerPage; j++)
                {
                    if (btnInventorySlot[j].getImpact(x, y))
                    {
                        //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                        //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                        if (inventorySlotIndex == j)
                        {
                            //doItemAction(false);
                            if (itemSelectorType.Equals("container"))
                            {
                                ItemRefs itRef = GetCurrentlySelectedItemRefs();
                                gv.mod.partyInventoryRefsList.Add(itRef.DeepCopy());
                                thisItemRefs.Remove(itRef);
                            }
                            else if (itemSelectorType.Equals("equip"))
                            {
                                switchEquipment();
                                if (callingScreen.Equals("party"))
                                {
                                    gv.screenType = "party";
                                }
                                else if (callingScreen.Equals("combatParty"))
                                {
                                    gv.screenType = "combatParty";
                                }
                            }
                        }
                        inventorySlotIndex = j;
                    }
                }
                if (btnInventoryLeft.getImpact(x, y))
                {
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    if (inventoryPageIndex > 0)
                    {
                        inventoryPageIndex--;
                        btnPageIndex.Text = (inventoryPageIndex + 1) + "/10";
                    }
                }
                else if (btnInventoryRight.getImpact(x, y))
                {
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    if (inventoryPageIndex < 9)
                    {
                        inventoryPageIndex++;
                        btnPageIndex.Text = (inventoryPageIndex + 1) + "/10";
                    }
                }
                else if (btnInfo.getImpact(x, y))
                {
                    if (isSelectedItemSlotInPartyInventoryRange())
                    {
                        ItemRefs itRef = GetCurrentlySelectedItemRefs();
                        if (itRef == null) { return;}
                        Item it = mod.getItemByResRef(itRef.resref);
                        if (it == null) {return;}
                        gv.sf.ShowFullDescription(it);
                    }
                }
                else if (btnAction.getImpact(x, y))
                {
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    if (itemSelectorType.Equals("container"))
                    {
                        //TAKE ALL
                        foreach (ItemRefs s in thisItemRefs)
                        {
                            gv.mod.partyInventoryRefsList.Add(s.DeepCopy());
                        }
                        thisItemRefs.Clear();
                        gv.screenType = "main";
                    }
                    else if (itemSelectorType.Equals("equip"))
                    {
                        switchEquipment();
                        if (callingScreen.Equals("party"))
                        {
                            gv.screenType = "party";
                        }
                        else if (callingScreen.Equals("combatParty"))
                        {
                            gv.screenType = "combatParty";
                        }
                    }
                    doCleanUp();
                }
                else if (btnExit.getImpact(x, y))
                {
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    if (itemSelectorType.Equals("container"))
                    {
                        gv.screenType = "main";
                    }
                    else if (itemSelectorType.Equals("equip"))
                    {
                        if (callingScreen.Equals("party"))
                        {
                            gv.screenType = "party";
                        }
                        else if (callingScreen.Equals("combatParty"))
                        {
                            gv.screenType = "combatParty";
                        }
                    }
                    doCleanUp();
                }
                else if (((itemSelectorType.Equals("container")) || (itemSelectorType.Equals("equip"))) && (btnAction2.getImpact(x, y)))
                {
                    if (itemSelectorType.Equals("container"))
                    {
                        ItemRefs itRef = GetCurrentlySelectedItemRefs();
                        gv.mod.partyInventoryRefsList.Add(itRef.DeepCopy());
                        thisItemRefs.Remove(itRef);
                    }
                    else if (itemSelectorType.Equals("equip"))
                    {
                        unequipItem();
                        if (callingScreen.Equals("party"))
                        {
                            gv.screenType = "party";
                        }
                        else if (callingScreen.Equals("combatParty"))
                        {
                            gv.screenType = "combatParty";
                        }
                    }
                    doCleanUp();

                }
                break;
            }
        }
Ejemplo n.º 51
0
        private void m_frame_MouseEvent(Sprite sender, System.Windows.Forms.MouseEventArgs e, MouseEventType t)
        {
            if (t == Endogine.Sprite.MouseEventType.StillDown || t == Endogine.Sprite.MouseEventType.Click)
            {
                Sprite spTo = (Sprite)m_sliderHandle;
                Sprite spFrom = (Sprite)m_frame;

                //spTo.invalidate(spTo.m_mvRenderOutput) --TODO:
                spFrom.CheckMouse(
                    new System.Windows.Forms.MouseEventArgs(
                        System.Windows.Forms.MouseButtons.None, 0, -10000,-10000, 0),
                    new EPointF(-10000,-10000), true, false);
                //spTo.calcRenderOutput();

                EPointF pntLocInParent = spTo.ConvRootLocToParentLoc(m_endogine.MouseLoc.ToEPointF());
                spTo.Loc = pntLocInParent;
                spTo.CheckMouse(e, pntLocInParent, true, true);
            }
        }
Ejemplo n.º 52
0
        /// <ToBeCompleted></ToBeCompleted>
        protected internal void SetMouseEvent(MouseEventType eventType, MouseButtonsDg buttons, 
			int clickCount, int wheelDelta, Point position, KeysDg modifiers)
        {
            this.eventType = eventType;
            this.buttons = buttons;
            this.clicks = clickCount;
            this.modifiers = modifiers;
            this.position = position;
            this.wheelDelta = wheelDelta;
        }
Ejemplo n.º 53
0
        /// <ToBeCompleted></ToBeCompleted>
        public LayerMouseEventArgs(Layer layer, LayerItem item, 
			MouseEventType eventType, MouseButtonsDg buttons, int clickCount, int wheelDelta, 
			Point position, KeysDg modifiers)
            : base(eventType, buttons, clickCount, wheelDelta, position, modifiers)
        {
            this.layer = layer;
            this.item = item;
        }
Ejemplo n.º 54
0
        public void onTouchParty(MouseEventArgs e, MouseEventType.EventType eventType, bool inCombat)
        {
            btnLevelUp.glowOn = false;
            btnPartyRoster.glowOn = false;
            btnHelp.glowOn = false;
            btnInfo.glowOn = false;
            btnReturn.glowOn = false;
            btnSpells.glowOn = false;
            btnTraits.glowOn = false;
            btnEffects.glowOn = false;
            btnOthers.glowOn = false;

            //int eventAction = event.getAction();
            switch (eventType)
            {
            case MouseEventType.EventType.MouseDown:
            case MouseEventType.EventType.MouseMove:
                int x = (int) e.X;
                int y = (int) e.Y;

                if (btnLevelUp.getImpact(x, y))
                {
                    btnLevelUp.glowOn = true;
                }
                else if (btnPartyRoster.getImpact(x, y))
                {
                    btnPartyRoster.glowOn = true;
                }
                else if (btnHelp.getImpact(x, y))
                {
                    btnHelp.glowOn = true;
                }
                else if (btnInfo.getImpact(x, y))
                {
                    btnInfo.glowOn = true;
                }
                else if (btnReturn.getImpact(x, y))
                {
                    btnReturn.glowOn = true;
                }
                else if (btnSpells.getImpact(x, y))
                {
                    btnSpells.glowOn = true;
                }
                else if (btnTraits.getImpact(x, y))
                {
                    btnTraits.glowOn = true;
                }
                else if (btnEffects.getImpact(x, y))
                {
                    btnEffects.glowOn = true;
                }
                else if (btnOthers.getImpact(x, y))
                {
                    btnOthers.glowOn = true;
                }
                break;

            case MouseEventType.EventType.MouseUp:
                x = (int) e.X;
                y = (int) e.Y;

                btnLevelUp.glowOn = false;
                btnPartyRoster.glowOn = false;
                btnHelp.glowOn = false;
                btnInfo.glowOn = false;
                btnReturn.glowOn = false;
                btnSpells.glowOn = false;
                btnTraits.glowOn = false;
                btnEffects.glowOn = false;
                btnOthers.glowOn = false;

                Player pc = mod.playerList[gv.cc.partyScreenPcIndex];

                if (btnSpells.getImpact(x, y))
                {
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    string spellList = "";
                    foreach (string s in pc.knownSpellsTags)
                    {
                        Spell sp = mod.getSpellByTag(s);
                        spellList += sp.name + "<br>";
                    }
                    gv.sf.MessageBoxHtml("<big><b>KNOWN SPELLS</b></big><br><br>" + spellList);
                }
                else if (btnTraits.getImpact(x, y))
                {
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    string traitList = "";
                    foreach (string s in pc.knownTraitsTags)
                    {
                        Trait tr = mod.getTraitByTag(s);
                        traitList += tr.name + "<br>";
                    }
                    gv.sf.MessageBoxHtml("<big><b>KNOWN TRAITS</b></big><br><br>" + traitList);
                }
                else if (btnEffects.getImpact(x, y))
                {
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    string allEffects = "";
                    foreach (Effect ef in pc.effectsList)
                    {
                        int left = ef.durationInUnits - ef.currentDurationInUnits;
                        allEffects += ef.name + " (" + left + ")" + "<br>";
                    }
                    gv.sf.MessageBoxHtml("<big><b>CURRENT EFFECTS</b></big><br><b><small>(#) denotes effect time left</small></b><br><br>" + allEffects);
                }
                else if (btnOthers.getImpact(x, y))
                {
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    gv.sf.MessageBoxHtml("<big><b><u>SAVING THROW MODIFIERS</u></b></big><br>" +
                            "Fortitude: " + pc.fortitude + "<br>" +
                            "Will: " + pc.will + "<br>" +
                            "Reflex: " + pc.reflex + "<br><br>" +
                            "<big><b><u>RESISTANCES (%)</u></b></big><br>" +
                            "Acid: " + pc.damageTypeResistanceTotalAcid + "<br>" +
                            "Cold: " + pc.damageTypeResistanceTotalCold + "<br>" +
                            "Normal: " + pc.damageTypeResistanceTotalNormal + "<br>" +
                            "Electricity: " + pc.damageTypeResistanceTotalElectricity + "<br>" +
                            "Fire: " + pc.damageTypeResistanceTotalFire + "<br>" +
                            "Magic: " + pc.damageTypeResistanceTotalMagic + "<br>" +
                            "Poison: " + pc.damageTypeResistanceTotalPoison + "<br>"
                            );
                }
                else if (btnMainHand.getImpact(x, y))
                {
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    if (gv.cc.partyItemSlotIndex == 0)
                    {
                        switchEquipment(inCombat);
                    }
                    gv.cc.partyItemSlotIndex = 0;
                }
                else if (btnHead.getImpact(x, y))
                {
                    if (inCombat)
                    {
                        gv.sf.MessageBoxHtml("Can't equip/unequip this item in combat.");
                        return;
                    }
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    if (gv.cc.partyItemSlotIndex == 1)
                    {
                        switchEquipment(inCombat);
                    }
                    gv.cc.partyItemSlotIndex = 1;
                }
                else if (btnNeck.getImpact(x, y))
                {
                    if (inCombat)
                    {
                        gv.sf.MessageBoxHtml("Can't equip/unequip this item in combat.");
                        return;
                    }
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    if (gv.cc.partyItemSlotIndex == 2)
                    {
                        switchEquipment(inCombat);
                    }
                    gv.cc.partyItemSlotIndex = 2;
                }
                else if (btnOffHand.getImpact(x, y))
                {
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    if (gv.cc.partyItemSlotIndex == 3)
                    {
                        switchEquipment(inCombat);
                    }
                    gv.cc.partyItemSlotIndex = 3;
                }
                else if (btnRing.getImpact(x, y))
                {
                    if (inCombat)
                    {
                        gv.sf.MessageBoxHtml("Can't equip/unequip this item in combat.");
                        return;
                    }
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    if (gv.cc.partyItemSlotIndex == 4)
                    {
                        switchEquipment(inCombat);
                    }
                    gv.cc.partyItemSlotIndex = 4;
                }
                else if (btnBody.getImpact(x, y))
                {
                    if (inCombat)
                    {
                        gv.sf.MessageBoxHtml("Can't equip/unequip this item in combat.");
                        return;
                    }
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    if (gv.cc.partyItemSlotIndex == 5)
                    {
                        switchEquipment(inCombat);
                    }
                    gv.cc.partyItemSlotIndex = 5;
                }
                else if (btnFeet.getImpact(x, y))
                {
                    if (inCombat)
                    {
                        gv.sf.MessageBoxHtml("Can't equip/unequip this item in combat.");
                        return;
                    }
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    if (gv.cc.partyItemSlotIndex == 6)
                    {
                        switchEquipment(inCombat);
                    }
                    gv.cc.partyItemSlotIndex = 6;
                }
                else if (btnRing2.getImpact(x, y))
                {
                    if (inCombat)
                    {
                        gv.sf.MessageBoxHtml("Can't equip/unequip this item in combat.");
                        return;
                    }
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    if (gv.cc.partyItemSlotIndex == 7)
                    {
                        switchEquipment(inCombat);
                    }
                    gv.cc.partyItemSlotIndex = 7;
                }
                else if (btnAmmo.getImpact(x, y))
                {
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    if (gv.cc.partyItemSlotIndex == 8)
                    {
                        switchEquipment(inCombat);
                    }
                    gv.cc.partyItemSlotIndex = 8;
                }

                else if (btnLevelUp.getImpact(x, y))
                {
                    if (inCombat)
                    {
                        gv.sf.MessageBoxHtml("Can't Level up during combat.");
                        return;
                    }
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    if (mod.playerList[gv.cc.partyScreenPcIndex].IsReadyToAdvanceLevel())
                    {
                        if (mod.playerList[gv.cc.partyScreenPcIndex].charStatus.Equals("Dead"))
                        {
                            //Toast.makeText(gv.gameContext, "Can't Level Up a Dead Character", Toast.LENGTH_SHORT).show();
                        }
                        else
                        {
                            doLevelUp();
                        }
                    }
                }
                else if (btnHelp.getImpact(x, y))
                {
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    tutorialMessageParty(true);
                }
                else if (btnInfo.getImpact(x, y))
                {
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    Item it = new Item();
                    if (gv.cc.partyItemSlotIndex == 0) { it = mod.getItemByResRef(pc.MainHandRefs.resref);}
                    else if (gv.cc.partyItemSlotIndex == 1) { it = mod.getItemByResRef(pc.HeadRefs.resref);}
                    else if (gv.cc.partyItemSlotIndex == 2) { it = mod.getItemByResRef(pc.NeckRefs.resref);}
                    else if (gv.cc.partyItemSlotIndex == 3) { it = mod.getItemByResRef(pc.OffHandRefs.resref);}
                    else if (gv.cc.partyItemSlotIndex == 4) { it = mod.getItemByResRef(pc.RingRefs.resref);}
                    else if (gv.cc.partyItemSlotIndex == 5) { it = mod.getItemByResRef(pc.BodyRefs.resref);}
                    else if (gv.cc.partyItemSlotIndex == 6) { it = mod.getItemByResRef(pc.FeetRefs.resref);}
                    else if (gv.cc.partyItemSlotIndex == 7) { it = mod.getItemByResRef(pc.Ring2Refs.resref);}
                    else if (gv.cc.partyItemSlotIndex == 8) { it = mod.getItemByResRef(pc.AmmoRefs.resref);}
                    if (it != null)
                    {
                        gv.sf.ShowFullDescription(it);
                    }
                }
                else if (btnReturn.getImpact(x, y))
                {
                    //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                    //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                    if (inCombat)
                    {
                        if (gv.screenCombat.canMove)
                        {
                            gv.screenCombat.currentCombatMode = "move";
                        }
                        else
                        {
                            gv.screenCombat.currentCombatMode = "attack";
                        }
                        gv.screenType = "combat";
                    }
                    else
                    {
                        gv.screenType = "main";
                    }
                }
                else if (btnPartyRoster.getImpact(x, y))
                {
                    if (!inCombat)
                    {
                        //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                        //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                        gv.screenType = "partyRoster";
                        //gv.TrackerSendScreenView("PartyRoster");
                        //gv.TrackerSendEventPartyRoster("Open");
                    }
                }
                if (!inCombat)
                {
                    for (int j = 0; j < mod.playerList.Count; j++)
                    {
                        if (btnPartyIndex[j].getImpact(x, y))
                        {
                            //if (mod.playButtonSounds) {gv.playSoundEffect(android.view.SoundEffectConstants.CLICK);}
                            //if (mod.playButtonHaptic) {gv.performHapticFeedback(android.view.HapticFeedbackConstants.VIRTUAL_KEY);}
                            mod.selectedPartyLeader = j;
                            gv.cc.addLogText("lime", mod.playerList[j].name + " is Party Leader");
                            if (gv.cc.partyScreenPcIndex == j)
                            {
                                doInterPartyConvo(); //not used in The Raventhal
                            }
                            gv.cc.partyScreenPcIndex = j;
                        }
                    }
                }
                break;
            }
        }
Ejemplo n.º 55
0
			protected internal void SetMouseEvent(Layer layer, LayerItem item, MouseEventType eventType, MouseEventArgs eventArgs) {
				this.SetMouseEvent(eventType, (MouseButtonsDg)eventArgs.Button, eventArgs.Clicks, eventArgs.Delta, eventArgs.Location, (KeysDg)Control.ModifierKeys);
				this.Layer = layer;
				this.Item = item;
			}
Ejemplo n.º 56
0
        private void OnMouseEvent(GameObject target,MouseEventType type)
        {
            Console.WriteLine("Event: " + type + " triggered on " + target);

        }
Ejemplo n.º 57
0
			protected internal void SetMouseEvent(Layer layer, LayerItem item, MouseEventType eventType, MouseEventArgsDg eventArgs) {
				this.SetMouseEvent(eventType, eventArgs.Buttons, eventArgs.Clicks, eventArgs.WheelDelta, eventArgs.Position, eventArgs.Modifiers);
				this.Item = item;
				this.Layer = layer;
			}
Ejemplo n.º 58
0
 /// <summary>
 /// Extracts and returns NShapeMouseEventArgs from <see cref="T:Windows.Forms.MouseEventArgs" />.
 /// </summary>
 public static MouseEventArgsDg GetMouseEventArgs(MouseEventType eventType, MouseEventArgs e)
 {
     return GetMouseEventArgs(eventType, e.Button, e.Clicks, e.X, e.Y, e.Delta);
 }
Ejemplo n.º 59
0
		/// <ToBeCompleted></ToBeCompleted>
		public ShapeMouseEventArgs(IEnumerable<Shape> shapes, Diagram diagram, MouseEventType eventType,
		                           MouseButtonsDg buttons, int clicks, int delta, Point location, KeysDg modifiers)
			: base(eventType, buttons, clicks, delta, location, modifiers)
		{
			if (shapes == null) throw new ArgumentNullException("shapes");
			this.shapes.AddRange(shapes);
			this.diagram = diagram;
		}
Ejemplo n.º 60
0
 /// <summary>
 /// ��������¼�
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 /// <param name="flag"></param>
 private void sendMouseEvent(object sender, MouseEventArgs e,MouseEventType flag)
 {
     if (currentControler == null)
         lbl_Message.Text=("�㻹û�����κ������������ж�!");
     else
     {
         PictureBox screenPict = (PictureBox)sender;
         Point epoint = ToScreenPoint(screenPict, e.Location);
         MouseEvent code = new MouseEvent(flag, epoint.X, epoint.Y);
         code.Head = CodeHead.CONTROL_MOUSE;
         if (epoint.X != -1)
             currentControler.SendCode(code);
     }
 }