コード例 #1
0
 public void HandleGameKey(IStateOwner pOwner, GameState.GameKeys g, KeyInputSource pSource)
 {
     if (pSource == KeyInputSource.Input_Keyboard && CurrentGameState is IDirectKeyboardInputState)
     {
         return;                                                                                            //do nothing if it supports that interface.
     }
     CurrentGameState.HandleGameKey(pOwner, g);
 }
コード例 #2
0
 public void GameKeyUp(GameState.GameKeys Key)
 {
     Debug.Print("keyUp in DAS Handler:" + Key.ToString() + new StackTrace().ToString());
     if (!RepeatKeys.Contains(Key))
     {
         return;
     }
     KeyData[Key].LastKeyUp      = DateTime.Now;
     KeyData[Key].LastRepeatTime = DateTime.MaxValue;
 }
コード例 #3
0
 public override void ProcessGameKey(IStateOwner pStateOwner, GameState.GameKeys pKey)
 {
     if (IsActivated)
     {
         if (pKey == GameState.GameKeys.GameKey_Left)
         {
             Confirmation = true;
         }
         else if (pKey == GameState.GameKeys.GameKey_Right)
         {
             Confirmation = false;
         }
     }
 }
コード例 #4
0
 public void GameKeyDown(GameState.GameKeys Key)
 {
     Debug.Print("keyDown in DAS Handler:" + Key.ToString() + new StackTrace().ToString());
     if (!RepeatKeys.Contains(Key))
     {
         return;
     }
     KeyData[Key].LastKeyDown = DateTime.Now;
     if (DASRepeatThread == null)
     {
         DASRepeatThread = new Thread(DASThread);
         DASRepeatThread.Start();
     }
 }
コード例 #5
0
        public void HandleKey(GameState.GameKeys key, bool DownState, bool UpState, TetrisGame.KeyInputSource pSource)
        {
            if (ActiveKeys.Contains(key) && !DownState)
            {
                ActiveKeys.Remove(key);
                GameKeyUp(key);
                return;
            }

            if (ActiveKeys.Contains(key))
            {
                return;
            }
            if (!DownState)
            {
                return;
            }
            ActiveKeys.Add(key);
            GameKeyDown(key);
            IgnoreController = false;
            Game.HandleGameKey(_Owner, key, pSource);
        }
コード例 #6
0
 public KeyRepeatInformation(GameState.GameKeys pkey)
 {
     Key = pkey;
 }
コード例 #7
0
 public virtual void ProcessGameKey(IStateOwner pStateOwner, GameState.GameKeys pKey)
 {
     //no default implementation.
 }
コード例 #8
0
 public void GameKeyDown(GameState.GameKeys key)
 {
     RepeatHandler.GameKeyDown(key);
 }
コード例 #9
0
 /// <summary>
 /// Called before default handling of a key by the game. return true if the key was handled to stop the default handling of said key.
 /// Note that this is called on all the blockGroups in play, so returning true won't stop other blockgroups from receiving the key themselves.
 /// </summary>
 /// <param name="pOwner"></param>
 /// <param name="key"></param>
 /// <returns></returns>
 public virtual bool HandleGameKey(IStateOwner pOwner, GameState.GameKeys key)
 {
     return(false);
 }