示例#1
0
        private void ToucheDown(Object o, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.D2)
            {
                viewState = new ViewPerspectiveState();
                FonctionsNatives.changeToPerspective();
            }

            if (e.KeyCode == Keys.D1)
            {
                viewState = new ViewOrthoState();
                FonctionsNatives.changeToOrtho();
            }

            if (e.KeyValue == (char)Keys.Subtract || (e.KeyValue == (char)Keys.OemMinus))
            {
                FonctionsNatives.zoomOut();
            }

            if (e.KeyValue == (char)Keys.Add || (e.KeyValue == (char)Keys.Oemplus && e.Modifiers == Keys.Shift))
            {
                FonctionsNatives.zoomIn();
            }
            if (viewState is ViewOrthoState)
            {
                if (e.KeyValue == (char)Keys.Up)
                {
                    FonctionsNatives.translater(0, 1);
                }

                if (e.KeyValue == (char)Keys.Left)
                {
                    FonctionsNatives.translater(-1, 0);
                }

                if (e.KeyValue == (char)Keys.Down)
                {
                    FonctionsNatives.translater(0, -1);
                }

                if (e.KeyValue == (char)Keys.Right)
                {
                    FonctionsNatives.translater(1, 0);
                }
            }
            if (viewState is ViewPerspectiveState)
            {
                if (e.KeyValue == (char)Keys.Up)
                {
                    FonctionsNatives.rotaterXY(0, 0.05);
                }

                if (e.KeyValue == (char)Keys.Left)
                {
                    FonctionsNatives.rotaterXY(0.05, 0);
                }

                if (e.KeyValue == (char)Keys.Down)
                {
                    FonctionsNatives.rotaterXY(0, -0.05);
                }

                if (e.KeyValue == (char)Keys.Right)
                {
                    FonctionsNatives.rotaterXY(-0.05, 0);
                }
            }

            if (e.KeyValue == (char)Keys.Escape && pause == false)
            {
                pause = true;
                menuStrip1.Show();
                e.Handled = true;
                FonctionsNatives.pauserSon();
            }
            if (e.KeyValue == (char)Keys.Escape && pause == true && e.Handled == false)
            {
                pause = false;
                menuStrip1.Hide();
                e.Handled = true;
                FonctionsNatives.pauserSon();
            }


            if (e.KeyCode == touches[0] && !PGJ1isPressed)
            {
                FonctionsNatives.animerPaletteGJ1(true);

                PGJ1isPressed = true;
            }

            if (e.KeyCode == touches[1] && !PDJ1isPressed)
            {
                FonctionsNatives.animerPaletteDJ1(true);

                PDJ1isPressed = true;
            }


            if (e.KeyCode == touches[2] && !PGJ2isPressed && configSimple_.estMultiplayer_ && !configSimple_.joueurVirtuel_)
            {
                FonctionsNatives.animerPaletteGJ2(true);

                PGJ2isPressed = true;
            }


            if (e.KeyCode == touches[3] && !PDJ2isPressed && configSimple_.estMultiplayer_ && !configSimple_.joueurVirtuel_)
            {
                FonctionsNatives.animerPaletteDJ2(true);

                PDJ2isPressed = true;
            }


            if (e.KeyCode == touches[4] && !ressortPressed)
            {
                FonctionsNatives.animerRessort(true);
                ressortPressed = true;
            }
        }
示例#2
0
        private void ToucheUp(Object o, KeyEventArgs e)
        {
            if (e.KeyCode == touches[0] && PGJ1isPressed)
            {
                FonctionsNatives.animerPaletteGJ1(false);
                PGJ1isPressed = false;
            }
            if (e.KeyCode == touches[1] && PDJ1isPressed)
            {
                FonctionsNatives.animerPaletteDJ1(false);
                PDJ1isPressed = false;
            }

            if (e.KeyCode == touches[2] && PGJ2isPressed && configSimple_.estMultiplayer_ && !configSimple_.joueurVirtuel_)
            {
                FonctionsNatives.animerPaletteGJ2(false);
                PGJ2isPressed = false;
            }

            if (e.KeyCode == touches[3] && PDJ2isPressed && configSimple_.estMultiplayer_ && !configSimple_.joueurVirtuel_)
            {
                FonctionsNatives.animerPaletteDJ2(false);
                PDJ2isPressed = false;
            }
            if (e.KeyCode == touches[4] && ressortPressed)
            {
                FonctionsNatives.animerRessort(false);
                ressortPressed = false;
            }

            if (e.KeyValue == (char)Keys.Back)
            {
                recupererTouches();
                FonctionsNatives.reinitialiserPartie();
            }

            if (e.KeyCode == Keys.J)
            {
                lumAmbiante = !lumAmbiante;
                FonctionsNatives.changeLumAmbiant();
                DateTime temps = DateTime.Now;
                if (lumAmbiante && debugLum)
                {
                    Console.WriteLine("{0:hh:mm:ss.fff} - Lumiere AMBIANTE OUVERTE", temps);
                }
                else if (debugLum)
                {
                    Console.WriteLine("{0:hh:mm:ss.fff} - Lumiere AMBIANTE FERMEE", temps);
                }
            }
            if (e.KeyCode == Keys.K)
            {
                lumDirect = !lumDirect;
                FonctionsNatives.changeLumDirect();
                DateTime temps = DateTime.Now;
                if (lumDirect && debugLum)
                {
                    Console.WriteLine("{0:hh:mm:ss.fff} - Lumiere DIRECTIONELLE OUVERTE", temps);
                }
                else if (debugLum)
                {
                    Console.WriteLine("{0:hh:mm:ss.fff} - Lumiere DIRECTIONELLE FERMEE", temps);
                }
            }
            if (e.KeyCode == Keys.L)
            {
                spotlights = !spotlights;
                FonctionsNatives.changeLumSpot();
                DateTime temps = DateTime.Now;
                if (spotlights && debugLum)
                {
                    Console.WriteLine("{0:hh:mm:ss.fff} - Lumiere SPOTLIGHT OUVERTE", temps);
                }
                else if (debugLum)
                {
                    Console.WriteLine("{0:hh:mm:ss.fff} - Lumiere SPOTLIGHT FERMEE", temps);
                }
            }
        }