public static bool isKeyPressed(Keys key) { if (currentState == null || priorState == null) return false; return currentState.IsKeyDown(key) && !priorState.IsKeyDown(key); }