C# Class GameEngine.Extensions.KeyboardExtensions

Afficher le fichier Open project: MichaelAquilina/Some-2D-RPG

Méthodes publiques

Méthode Description
GetKeyDownState ( KeyboardState keyboardState, Keys key, object lockObject, bool lockKey = true ) : bool

Returns a boolean value specifying whether the key specified in the parameter is currently down or not. If the key is down then the method will *lock* the key with the specified lockObject until it has been released and this method is called again. This method is very useful for performing 'one-time' actions for an Entity or Script that should not be repeated while the key is kept pressed by the user.

Private Methods

Méthode Description
AddToLockedKeys ( object lockObject, Keys value ) : void
RemoveFromLockedKeys ( object lockObject, Keys value ) : bool

Method Details

GetKeyDownState() public static méthode

Returns a boolean value specifying whether the key specified in the parameter is currently down or not. If the key is down then the method will *lock* the key with the specified lockObject until it has been released and this method is called again. This method is very useful for performing 'one-time' actions for an Entity or Script that should not be repeated while the key is kept pressed by the user.
public static GetKeyDownState ( KeyboardState keyboardState, Keys key, object lockObject, bool lockKey = true ) : bool
keyboardState Microsoft.Xna.Framework.Input.KeyboardState The current KeyboardState retrieved by the calling method.
key Keys Key to check and lock if found to be down.
lockObject object The object with which to associate the lock. All other objects will still retrieve a true in the next method call.
lockKey bool Boolean value specifying if the method should use the locking mechanism or not. True by default.
Résultat bool