Esempio n. 1
0
    static void StartMouseMode(ref Joypad controller)
    {
        var isClicked = false;

        while (!IsMouseComboPressed(ref controller))
        {
            Thread.Sleep(20);

            var buttons = controller.GetInput();

            if (!isClicked && buttons.A)
            {
                mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
                isClicked = true;
            }
            else if (isClicked && !buttons.A)
            {
                mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
                isClicked = false;
            }

            if (!IsEmbarkAlive() && buttons.Start && buttons.Select)
            {
                Thread.Sleep(2000);

                if (buttons.Start && buttons.Select)
                {
                    WiggleMouse();

                    StartEmbark();
                }
            }

            if (Math.Abs(buttons.XAxis) < 3000 &&
                Math.Abs(buttons.YAxis) < 3000)
            {
                continue;
            }


            var x = (int)((double)buttons.XAxis * 0.0005);
            var y = (int)((double)-buttons.YAxis * 0.0005);

            Cursor.Position = new Point(Cursor.Position.X + x, Cursor.Position.Y + y);
        }
    }
Esempio n. 2
0
        static bool IsOpenComboPressed(ref Joypad cntr)
        {
            var buttons = cntr.GetInput();

            return(buttons != null && (buttons.Start && buttons.Select));
        }
Esempio n. 3
0
        static bool IsMouseComboPressed(ref Joypad cntr)
        {
            var buttons = cntr.GetInput();

            return(buttons != null && (buttons.Start && buttons.LS));
        }