private void GameModule_KeyUp(object sender, KeyPressedEventArgs ev)
        {
            PokePlayer player = (PokePlayer)this.scene.Players["player1"];
            BaseCamera camera = this.scene.Cameras["camera1"];

            // Did we activate?
            switch (ev.Action)
            {
                case "Noclip":
                    this.Test_RequestEvent (player);
                    break;
                //case "Noclip":
                //    player.Density = Convert.ToInt32(!(player.Density == 1));
                //    break;
                case "ZoomIn":
                    camera.Scale(1.2f);
                    break;
                case "ZoomOut":
                    camera.Scale(0.9f);
                    break;
                case "SpeedUp":
                    player.Speed = Helpers.Clamp (player.Speed + 2, 2, 10);
                    break;
                case "SlowDown":
                    player.Speed = Helpers.Clamp(player.Speed - 2, 2, 10);
                    break;
                case "TogglePlayers":
                    this.showplayers = !showplayers;
                    break;
                case "ToggleUnderlayer":
                    this.underlayer = !this.underlayer;
                    break;
                case "ToggleBaselayer":
                    this.baselayer = !this.baselayer;
                    break;
                case "ToggleMiddlelayer":
                    this.middlelayer = !this.middlelayer;
                    break;
                case "ToggleToplayer":
                    this.toplayer = !this.toplayer;
                    break;
                default:
                    break;
            }

            // Check other pressed keys
            if (!player.IgnoreMoveInput)
            {
                if (this.IsDir(ev.KeyPressed))
                {
                    this.context.MovementProvider.EndMove(player, true, false);
                }
            }

            if(ev.Action == "VoiceChat" && this.context.VoiceChatProvider.IsConnected)
                this.context.VoiceChatProvider.EndTalk (player);
        }
        private void GameModule_KeyDown(object sender, KeyPressedEventArgs ev)
        {
            var player = this.scene.Players ["player1"];

            if(this.IsDir (ev.KeyPressed))
            {
                UpdateDirection (ev.KeyPressed);

                if(!player.IgnoreMoveInput)
                {
                    Directions direction = Directions.Any;

                    switch(ev.Action)
                    {
                        case "MoveUp":
                            direction = Directions.North;
                            break;
                        case "MoveDown":
                            direction = Directions.South;
                            break;
                        case "MoveLeft":
                            direction = Directions.West;
                            break;
                        case "MoveRight":
                            direction = Directions.East;
                            break;
                    }

                    this.context.MovementProvider.BeginMove (player, direction);
                }
            }
        }
        private void GameModule_KeyPressed(object sender, KeyPressedEventArgs ev)
        {
            var player = this.scene.Players["player1"];

            if(ev.Action == "VoiceChat" && this.context.VoiceChatProvider.IsConnected)
            {
                this.context.VoiceChatProvider.BeginTalk (player);
            }
        }
 public void MainMenu_KeyPressed(object sender, KeyPressedEventArgs e)
 {
     if (e.KeyPressed == Keys.Enter && this.loaded)
     {
         this.player.Stop();
         this.context.ModuleProvider.PushModule("Login");
     }
 }