private void Window_KeyUp(object sender, KeyEventArgs e)
 {
     KeyController.InputKeyUp(sender, e);
 }
//frameupdate
        protected void FrameUpdateTimer_Update(object sender, ElapsedEventArgs e)
        {
            try
            {
                this.Dispatcher.Invoke(() =>
                {
                    //TimeManagement
                    this.GetNowTime();
                    elapsedTime = nowTime - lastTime;

                    //debug
                    lblDebugA.Content = PlayerStatus.playerPos.X + "," + PlayerStatus.playerPos.Y;
                    lblDebugB.Content = SystemOperator.PixelPerSecond(PlayerStatus.weight);

                    if (elapsedTime < 0)
                    {
                        elapsedTime += 59999;
                    }


                    KeyController.KeyInterval();

                    //GameTransition
                    if (!GameTransition.duringTransition)
                    {
                        GameTransition.GameTransitionController(Canvas, CaLife, CaMana);
                    }

                    //EventAction



                    if (GameTransition.eventStart)
                    {
                        if (GameTransition.lstEventTask.Count > 0)
                        {
                            GameTransition.EventTaskCommander();
                        }


                        if (GameTransition.charaRenderStart)
                        {
                            GameTransition.CharaRender();
                        }

                        if (GameTransition.screenFadeStart)
                        {
                            GameTransition.ScreenFade(Canvas);
                        }

                        if (!GameTransition.eventBalloonIsOpen)
                        {
                            if (GameTransition.eventCount < StageEvent.listEvent.Count)
                            {
                                GameTransition.EventController(Canvas);
                            }
                        }
                        else
                        {
                            if (KeyController.keyReturn)
                            {
                                EnterKeyAction(Canvas);
                            }
                        }
                    }

                    if (KeyController.keyReturn)
                    {
                        EnterKeyAction(Canvas);
                    }

                    //got to Edit Mode
                    if (GameTransition.gameTransition == GameTransitionType.Title)
                    {
                        if (KeyController.keyE)
                        {
                            mainCanvas.Children.Remove(ImageData.imgTitle[0]); mainCanvas.Children.Remove(ImageData.imgTitle[1]);
                            countTime = 0;
                            GameTransition.gameTransition = GameTransitionType.EditMode;
                            timerFrameUpdate.Stop();
                            btnViewStageEditorWindow.IsEnabled = true;
                            btnViewMaterialBrowser.IsEnabled   = true;
                            btnViewImageManager.IsEnabled      = true;
                            btnViewDatabaseWindow.IsEnabled    = true;

                            lblMode.Content = "ゲームモード:エディット";
                        }
                    }

                    //StageDuring game play
                    if (GameTransition.gameTransition == GameTransitionType.StageDuring &&
                        !isDeactivated)
                    {
                        Animator.AnimationItem();
                        Animator.AnimationObject();

                        if (ObjectChecker.isTrigger && !TalkCommander.isTalk)
                        {
                            ObjectBehavior.OnTriggerTouchEvent();
                        }

                        if (TalkCommander.isTalk && !TalkCommander.isTalkOpenBalloon)
                        {
                            TalkCommander.TalkWithNpc(Canvas);
                        }

                        if (TalkCommander.isTalkSelecting)
                        {
                            TalkCommander.TalkSelecting(Canvas);
                        }

                        //first action,last Processing including deletion of list
                        SystemOperator.moveCommonAmountX = 0;
                        SystemOperator.moveCommonAmountY = 0;

                        ObjectChecker.CollisionPtoActionCollider();
                        PlayerBehavior.CollisionPtoE();

                        PlayerBehavior.MovePlayer(Canvas);
                        PlayerBehavior.FallingPlayer();

                        Item.FallingItems();

                        EnemyBehavior.EnemyAction();
                        Animator.AnimationEnemy();

                        SubWeapon.SubWeaponPosUpdate(Canvas);

                        if (PlayerStatus.isMainAttack)
                        {
                            MainWeapon.MainWeaponAttack(Canvas);
                            MainWeapon.MainWeaponCollision(Canvas);
                        }


                        SubWeapon.CollisionSubWeapon(Canvas);

                        PlayerStatus.PlayerStatusUpdate();
                        PlayerBehavior.DamageInvinsibleTimer();

                        SpawnEnemy.RemoveEnemy(Canvas);
                        SpawnEnemy.ReSpawnEnemy(Canvas);
                    }

                    if (Sound.seStop)
                    {
                        if (Sound.sePlayTime < 60)
                        {
                            Sound.sePlayTime++;
                        }
                        else
                        {
                            Sound.sePlayTime = 0;
                            Sound.seStop     = false;
                        }
                    }

                    lastTime = nowTime;
                });
            }
            catch (TaskCanceledException)
            {
            }
        }