In This Article

KeyGesture Class

Defines a keyboard shortcut combination.

public class KeyGesture
Inheritance:
object object

Constructors

KeyGesture(Keys, ModifierKeys)

Initializes a new instance of the KeyGesture class.

public KeyGesture(Keys key, ModifierKeys modifiers)
Parameter Type Description
key Keys

The key associated with this KeyGesture.

modifiers ModifierKeys

The modifier keys associated with this KeyGesture.

Properties

Key

Gets the key associated with this KeyGesture.

public Keys Key { get; }

Property Value

Keys:

The key associated with this KeyGesture.

Modifiers

Gets the modifier keys associated with this KeyGesture.

public ModifierKeys Modifiers { get; }

Property Value

ModifierKeys:

The modifier keys associated with this KeyGesture.

Methods

Matches(Keys)

Returns whether the specified Keys from a a key event match this gesture.

public bool Matches(Keys keys)
Parameter Type Description
keys Keys

The Keys to examine.

Returns

bool:

true if the specified Keys from a a key event match this gesture; otherwise, false.

ToString()

Converts the object to a String.

public override string ToString()

Returns

string:

A string whose value represents this object.

Inherited Members