Example #1
0
 public MouseClick(bool rightClick = false) : base("MouseClick")
 {
     MouseOperations.MouseEventFlags down = rightClick ? MouseOperations.MouseEventFlags.RightDown : MouseOperations.MouseEventFlags.LeftDown;
     MouseOperations.MouseEventFlags up   = rightClick ? MouseOperations.MouseEventFlags.RightUp : MouseOperations.MouseEventFlags.LeftUp;
     next = new AutoActionBuilder()
            .Add(new MouseEvent(down))
            .Add(new MouseEvent(up))
            .Build(this);
 }
Example #2
0
 public MouseEvent(MouseOperations.MouseEventFlags mouseEvent) : base("MouseEvent")
 {
     this.mouseEvent = mouseEvent;
 }
Example #3
0
 public void DoClick(MouseOperations.MouseEventFlags events, int x, int y, int manyClick)
 {
     MouseOperations.SetCursorPosition(x, y);
     MouseOperations.MouseEvent(events);
     // MouseClick(clickSide, x, y, manyClick, speed);
 }
        public void wiimoteChanged(String wsJSON)
        {
            if (playerIndex != 1)
            {
                return;
            }

            WiimoteState ws = JsonConvert.DeserializeObject <WiimoteState>(wsJSON);

            MouseOperations mouseOperations = new MouseOperations();

            MouseOperations.MouseEventFlags leftUpMouse    = MouseOperations.MouseEventFlags.LeftUp;
            MouseOperations.MouseEventFlags leftDownMouse  = MouseOperations.MouseEventFlags.LeftDown;
            MouseOperations.MouseEventFlags rightUpMouse   = MouseOperations.MouseEventFlags.RightUp;
            MouseOperations.MouseEventFlags rightDownMouse = MouseOperations.MouseEventFlags.RightDown;

            if (ws.ButtonState.B == true)
            {
                if (this.BButton == false)
                {
                    MouseOperations.MouseEvent(rightDownMouse);
                    this.BButton = true;
                    isRumbling   = true;
                    Delay.executeAfter(50, () =>
                    {
                        isRumbling = false;
                    });
                }
            }
            else
            {
                if (this.BButton == true)
                {
                    MouseOperations.MouseEvent(rightUpMouse);
                    this.BButton = false;
                    isRumbling   = false;
                }
            }


            if (ws.ButtonState.A == true)
            {
                if (this.AButton == false)
                {
                    MouseOperations.MouseEvent(leftDownMouse);
                    this.AButton = true;
                }
            }
            else
            {
                if (this.AButton == true)
                {
                    MouseOperations.MouseEvent(leftUpMouse);
                    this.AButton = false;
                }
            }

            if (ws.ButtonState.One == true)
            {
                generateKeyPressThread(Keys.A, 0, 0);
            }

            if (ws.ButtonState.Up == true)
            {
                generateKeyPressThread(Keys.Up, 0, 0);
            }

            if (ws.ButtonState.Down == true)
            {
                generateKeyPressThread(Keys.Down, 0, 0);
            }

            if (ws.ButtonState.Left == true)
            {
                generateKeyPressThread(Keys.Left, 0, 0);
            }

            if (ws.ButtonState.Right == true)
            {
                generateKeyPressThread(Keys.Right, 0, 0);
            }


            if (ws.ButtonState.Plus == true)
            {
                if (plusLag > 4)
                {
                    generateKeyPressThread(Keys.VolumeUp, 0, 0);
                    plusLag = 0;
                }
                plusLag++;
            }

            if (ws.ButtonState.Minus == true)
            {
                if (minusLag > 4)
                {
                    generateKeyPressThread(Keys.VolumeDown, 0, 0);
                    minusLag = 0;
                }
                minusLag++;
            }

            if (ws.ButtonState.Home == true)
            {
                if (this.home == false)
                {
                    startHoldKeyPressThread(Keys.VolumeMute, 0);
                    this.home = true;
                }
            }
            else
            {
                if (this.home == true)
                {
                    releaseHoldKeyPressThread(Keys.VolumeMute, 0);
                    this.home = false;
                }
            }

            if (ws.ButtonState.One == true)
            {
                if (this.one == false)
                {
                    //generateKeyPressThread(MouseButtons.Left, 250,0);
                    //System.Diagnostics.Process.Start("TabTip.exe");

                    this.one = true;
                }
            }
            else
            {
                if (this.one == true)
                {
                    this.one = false;
                }
            }
        }