Get() public static méthode

Shortcut to get the AsciiKey for a specific MonoGame/XNA Keys type. Shift is considered not pressed.
public static Get ( Keys key ) : AsciiKey
key Keys The key.
Résultat AsciiKey
Exemple #1
0
 /// <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)));
 }
Exemple #2
0
 /// <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)));
 }
Exemple #3
0
 /// <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)));
 }
Exemple #4
0
 /// <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));
Exemple #7
0
 /// <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)));
 }
Exemple #8
0
 /// <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)));
 }