Esempio n. 1
0
        public void Update(KeyboardStateBase keyboardState, MouseStateBase mouseState, IGameTiming gameTime)
        {
            var previousDown = this.isDown;

            this.isDown = this.mappingKeys.Any(keyboardState.IsKeyDown)
                || this.mappingButtons.Any(mouseState.IsButtonDown);

            if (this.isDown && this.buttonDownAction != null) this.buttonDownAction.Invoke(gameTime);
            if (!this.isDown && this.buttonUpAction != null) this.buttonUpAction.Invoke(gameTime);

            if (this.buttonClickAction != null && previousDown && !this.isDown) this.buttonClickAction.Invoke(gameTime);

            if (this.buttonStateAction != null) this.buttonStateAction.Invoke(this.isDown, gameTime);
        }
 public void Update(KeyboardStateBase keyboardStateState, IGameTiming gameTime)
 {
     this.keyboardTrackingAction.Invoke(keyboardStateState, gameTime);
 }