SunsetHigh.KeyboardManager.isKeyPressed C# (CSharp) Method

isKeyPressed() public static method

Checks if the given key has just been pressed (i.e. it is down now and was not pressed in the previous update)
public static isKeyPressed ( Keys key ) : bool
key Keys The key to check for
return bool
        public static bool isKeyPressed(Keys key)
        {
            if (currentState == null || priorState == null)
                return false;
            return currentState.IsKeyDown(key) && !priorState.IsKeyDown(key);
        }