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); }
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; }
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; } } }
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(); } }
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); }
public KeyRepeatInformation(GameState.GameKeys pkey) { Key = pkey; }
public virtual void ProcessGameKey(IStateOwner pStateOwner, GameState.GameKeys pKey) { //no default implementation. }
public void GameKeyDown(GameState.GameKeys key) { RepeatHandler.GameKeyDown(key); }
/// <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); }