Sdílet prostřednictvím


KeyboardState Members

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

Public Properties

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

Public Methods

Name Description
Public Method Equals Overloaded. 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 ReferenceEquals (Inherited from Object.)
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

How to: Detect Whether a Key Is Pressed

Concepts

Input Overview

Reference

KeyboardState Structure
Microsoft.Xna.Framework.Input Namespace