[This is preliminary documentation and is subject to change.]

Gets state of particular key.

Namespace: Tools.DevicesT
Assembly: Tools.Win (in Tools.Win.dll) Version: 1.5.3.38916 (1.5.3.38916)

Syntax

C#
public static bool this[
	Keys Key
] { get; }
Visual Basic
Public Shared ReadOnly Property KeyStatus ( _
	Key As Keys _
) As Boolean
	Get
Visual C++
public:
static property bool KeyStatus[Keys Key] {
	bool get (Keys Key);
}
F#
static member KeyStatus : bool
JScript
JScript does not support indexed properties.

Parameters

Key
Type: System.Windows.Forms..::..Keys
Key to get status of. Do not use shift keys (Shift, Alt, Control). ShiftKey, Menu, ControlKey, RShiftKey, LShiftKey, LMenu, RMenu, LControlKey and RControlKey are alloved.

Return Value

True if key is pressed at time when the property is being got.

Remarks

This function can be also use with mouse buttons and respects situation when buttons are swapped. To get state of togglable keys (CapsLock, Scroll, NumLock; this function returns actual Up/Down state of them rather then toggle on/off state) use CapsLock, ScrollLock and NumLock. The Keyboard class also allows you to get state of shif keys (Shift, Control and Alt).

See Also