public bool IsNewKeyPress(Keys key)
{
return (CurrentKeyboardState.IsKeyDown(key) &&
LastKeyboardState.IsKeyUp(key));
}
public override void HandleInput(InputState input) { if (input.IsNewKeyPress(Keys.Enter) && input.CurrentKeyboardState.IsKeyDown(Keys.LeftControl)) { var gdm = ((ScummGame)game).GraphicsDeviceManager; gdm.ToggleFullScreen(); gdm.ApplyChanges(); } else if (input.IsNewKeyPress(Keys.Space)) { engine.IsPaused = !engine.IsPaused; } else { inputManager.UpdateInput(input.CurrentKeyboardState); cursorPos = inputManager.RealPosition; base.HandleInput(input); } }