KeyboardState Members

The following tables list the members exposed by the KeyboardState type.

Public Constructors

Name Description
Public Method KeyboardState Initializes a new instance of the KeyboardState class.

Public Properties

Name Description
Public Property Item Returns the state of a particular key.

Public Methods

Name Description
Public Method Equals Returns a value that indicates whether the current instance is equal to a specified object.
Public Method GetHashCode Gets the hash code for this instance.
Public Method GetPressedKeys Gets an array of values that correspond to the keyboard keys that are currently being pressed.
Public Method GetType (Inherited from Object.)
Public Method IsKeyDown Returns whether a specified key is currently being pressed.
Public Method IsKeyUp Returns whether a specified key is currently not pressed.
Public Method Static op_Equality Compares two objects to determine whether they are the same.
Public Method Static op_Inequality Compares two objects to determine whether they are different.
Public Method ToString (Inherited from ValueType.)

Protected Methods

Name Description
Protected Method Finalize (Inherited from Object.)
Protected Method MemberwiseClone (Inherited from Object.)

See Also

Tasks

Detecting a Key Press (Windows, Windows Phone, Xbox 360)

Concepts

Overview of User Input and Input Devices

Reference

KeyboardState Structure
Microsoft.Xna.Framework.Input Namespace