public static Get ( Keys key ) : |
||
key | Keys | The key. |
return |
/// <summary> /// Returns true when they is in the <see cref="KeysReleased"/> collection. /// </summary> /// <param name="key">The key to check.</param> /// <returns>True when the key was released this update frame.</returns> public bool IsKeyReleased(Keys key) { return(KeysReleased.Contains(AsciiKey.Get(key))); }
/// <summary> /// Returns true if the key is not in the <see cref="KeysDown"/> collection regardless of shift state. /// </summary> /// <param name="key">The key to check.</param> /// <returns>True when the key is not being pressed.</returns> public bool IsKeyUp(Keys key) { return(!KeysDownInternal.Contains(AsciiKey.Get(key, _state)) && !KeysDownInternal.Contains(AsciiKey.Get(key, true, _state))); }
/// <summary> /// Returns true if the key is in the <see cref="KeysDown"/> collection. /// </summary> /// <param name="key">The key to check.</param> /// <returns>True when the key is being pressed.</returns> public bool IsKeyDown(Keys key) { return(KeysDown.Contains(AsciiKey.Get(key))); }
/// <summary> /// Returns true when the key is in the <see cref="KeysPressed"/> collection regardless of shift state. /// </summary> /// <param name="key">The key to check.</param> /// <returns>True when the key was considered first pressed.</returns> public bool IsKeyPressed(Keys key) { return(KeysPressedInternal.Contains(AsciiKey.Get(key, _state)) || KeysPressedInternal.Contains(AsciiKey.Get(key, true, _state))); }
/// <summary> /// Returns true when the key is in the <see cref="KeysReleased"/> collection regardless of shift state. /// </summary> /// <param name="key">The key to check.</param> /// <returns>True when the key was released this update frame.</returns> public bool IsKeyReleased(Keys key) => KeysReleasedInternal.Contains(AsciiKey.Get(key, _state)) || KeysReleasedInternal.Contains(AsciiKey.Get(key, true, _state));
/// <summary> /// Returns true if the key is in the <see cref="KeysDown"/> collection regardless of shift state. /// </summary> /// <param name="key">The key to check.</param> /// <returns>True when the key is being pressed.</returns> public bool IsKeyDown(Keys key) => KeysDownInternal.Contains(AsciiKey.Get(key, _state)) || KeysDownInternal.Contains(AsciiKey.Get(key, true, _state));
/// <summary> /// Returns true if the key is not in the <see cref="KeysDown"/> collection. /// </summary> /// <param name="key">The key to check.</param> /// <returns>True when the key is not being pressed.</returns> public bool IsKeyUp(Keys key) { return(!KeysDownInternal.Contains(AsciiKey.Get(key))); }
/// <summary> /// Returns true when the key is in the <see cref="KeysPressed"/> collection. /// </summary> /// <param name="key">The key to check.</param> /// <returns>True when the key was considered first pressed.</returns> public bool IsKeyPressed(Keys key) { return(KeysPressedInternal.Contains(AsciiKey.Get(key))); }