Exemplo n.º 1
0
        private void ControllerOnButtonDown(object sender, ButtonEventArgs buttonEventArgs)
        {
            if ((buttonEventArgs.Button & Button.A) != 0)
                Invoke((MethodInvoker) (() => roundToggleControl1.Toggle = true));
            
            if ((buttonEventArgs.Button & Button.B) != 0)
                Invoke((MethodInvoker)(() => roundToggleControl2.Toggle = true));

            if ((buttonEventArgs.Button & Button.Y) != 0)
                Invoke((MethodInvoker)(() => roundToggleControl3.Toggle = true));

            if ((buttonEventArgs.Button & Button.X) != 0)
                Invoke((MethodInvoker)(() => roundToggleControl4.Toggle = true));

            if ((buttonEventArgs.Button & Button.BACK) != 0)
                Invoke((MethodInvoker)(() => roundToggleControl5.Toggle = true));

            if ((buttonEventArgs.Button & Button.START) != 0)
                Invoke((MethodInvoker)(() => roundToggleControl6.Toggle = true));

            if ((buttonEventArgs.Button & Button.LEFT_SHOULDER) != 0)
                Invoke((MethodInvoker)(() => roundToggleControl7.Toggle = true));

            if ((buttonEventArgs.Button & Button.RIGHT_SHOULDER) != 0)
                Invoke((MethodInvoker)(() => roundToggleControl8.Toggle = true));


        }
Exemplo n.º 2
0
        private void OnButtonUp(object sender, ButtonEventArgs buttonEventArgs)
        {
            if ((buttonEventArgs.Button & Button.A) != 0)
            {
                if (UpA != null)
                    UpA(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.B) != 0)
            {
                if (UpB != null)
                    UpB(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.Y) != 0)
            {
                if (UpY != null)
                    UpY(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.X) != 0)
            {
                if (UpX != null)
                    UpX(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.RIGHT_SHOULDER) != 0)
            {
                if (UpRBack != null)
                    UpRBack(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.LEFT_SHOULDER) != 0)
            {
                if (UpLBack != null)
                    UpLBack(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.BACK) != 0)
            {
                if (UpBack != null)
                    UpBack(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.START) != 0)
            {
                if (UpStart != null)
                    UpStart(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.RIGHT_THUMB) != 0)
            {
                if (UpRight != null)
                    UpRight(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.LEFT_THUMB) != 0)
            {
                if (UpLeft != null)
                    UpLeft(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.DPAD_DOWN) != 0)
            {
                if (UpDDown != null)
                    UpDDown(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.DPAD_RIGHT) != 0)
            {
                if (UpDRight != null)
                    UpDRight(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.DPAD_LEFT) != 0)
            {
                if (UpDLeft != null)
                    UpDLeft(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.DPAD_UP) != 0)
            {
                if (UpDUp != null)
                    UpDUp(this, EventArgs.Empty);
            }
        }
Exemplo n.º 3
0
        private void OnButtonDown(object sender, ButtonEventArgs buttonEventArgs)
        {
            if ((buttonEventArgs.Button & Button.A) != 0)
            {
                if (DownA != null)
                    DownA(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.B) != 0)
            {
                if (DownB != null)
                    DownB(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.Y) != 0)
            {
                if (DownY != null)
                    DownY(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.X) != 0)
            {
                if (DownX != null)
                    DownX(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.RIGHT_SHOULDER) != 0)
            {
                if (DownRBack != null)
                    DownRBack(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.LEFT_SHOULDER) != 0)
            {
                if (DownLBack != null)
                    DownLBack(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.BACK) != 0)
            {
                if (DownBack != null)
                    DownBack(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.START) != 0)
            {
                if (DownStart != null)
                    DownStart(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.RIGHT_THUMB) != 0)
            {
                if (DownRight != null)
                    DownRight(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.LEFT_THUMB) != 0)
            {
                if (DownLeft != null)
                    DownLeft(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.DPAD_DOWN) != 0)
            {
                if (DownDDown != null)
                    DownDDown(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.DPAD_RIGHT) != 0)
            {
                if (DownDRight != null)
                    DownDRight(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.DPAD_LEFT) != 0)
            {
                if (DownDLeft != null)
                    DownDLeft(this, EventArgs.Empty);
            }

            if ((buttonEventArgs.Button & Button.DPAD_UP) != 0)
            {
                if (DownDUp != null)
                    DownDUp(this, EventArgs.Empty);
            }
        }