In This Article

KeyGesture Class

Defines a keyboard shortcut combination.

public class KeyGesture
Inheritance:
object object

Constructors

KeyGesture(Keys, ModifierKeys)

Defines a keyboard shortcut combination.

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

The key associated with this KeyGesture.

public Keys Key { get; }

Property Value

Keys

Modifiers

The modifier keys associated with this KeyGesture.

public ModifierKeys Modifiers { get; }

Property Value

ModifierKeys

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()

Returns the string representation of this object.

public override string? ToString()

Returns

string:

The string representation of this object.

Inherited Members

Extension Methods