The KeyboardState type exposes the following members.

Constructors

  NameDescription
Public methodKeyboardState
Initializes a new instance of the KeyboardState class

Methods

  NameDescription
Public methodEquals(Object) (Overrides Object..::..Equals(Object).)
Public methodEquals(KeyboardState)
Returns true if the other keyboard state contains the same keys, has the same caps lock state and time value.
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode (Overrides Object..::..GetHashCode()()()().)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)

Operators

  NameDescription
Public operatorStatic memberEquality
Public operatorStatic memberInequality

Properties

  NameDescription
Public propertyCapsLock
Gets whether or not the caps lock is enabled.
Public propertyStatic memberEmpty
Public propertyKeyChars
Returns all the pressed characters. For example if the KeyCodes property contains SHIFT and A, this property will return 'A' or if the KeyCodes property contains CTRL, ALT and Q, this property will return '@' on a german keyboard.
Public propertyKeyCodes
Returns all the pressed keys.
Public propertyModifiers
Returns all the pressed modifier keys in one enumeration.
Public propertyTime
Used to distinguish two keyboard states if they contain the same same key codes. Useful if a key is pressed for a long time which should generate repeated key strokes.

See Also