Class
Chord

Represents a keyboard chord composed of key combinations and modifiers for input binding and shortcuts.

Definition

Namespace:Telerik.WinControls.Keyboard

Assembly:Telerik.WinControls.dll

Syntax:

cs-api-definition
[TypeConverter(typeof(ChordConverter))]
public class Chord : IComparable

Inheritance: objectChord

Implements: IComparable

Constructors

Chord()

Initializes a new instance of the Chord class.

Declaration

cs-api-definition
public Chord()

Chord(List<Keys>)

Initializes a new instance of the Chord class using a list of keys.

Declaration

cs-api-definition
public Chord(List<Keys> keys)

Parameters

keys

List<Keys>

The list of keys that compose this chord.

Chord(List<Keys>, ChordModifier)

Initializes a new instance of the Chord class using a list of keys and a chord modifier.

Declaration

cs-api-definition
public Chord(List<Keys> keys, ChordModifier chordModifier)

Parameters

keys

List<Keys>

The list of keys that compose this chord.

chordModifier

ChordModifier

The modifier keys (Alt, Ctrl, Shift) for this chord.

Chord(string)

Initializes a new instance of the Chord class using a string representation of keys.

Declaration

cs-api-definition
public Chord(string keys)

Parameters

keys

string

The string representation of the keys that compose this chord.

Properties

ChordKeys

Gets the string representation of the non-modifier keys in this chord.

Declaration

cs-api-definition
public string ChordKeys { get; }

Property Value

string

A string describing the main keys (excluding modifiers) used in this chord.

ChordModifier

Gets or sets the chord modifier that defines which modifier keys are pressed.

Declaration

cs-api-definition
public ChordModifier ChordModifier { get; set; }

Property Value

ChordModifier

A ChordModifier instance specifying Alt, Ctrl, and Shift key states.

Keys

Gets or sets the string representation of the keys in this chord.

Declaration

cs-api-definition
public string Keys { get; set; }

Property Value

string

A string describing the key combination for this chord.

KeysInternal

Gets or sets the internal list of keys that compose this chord.

Declaration

cs-api-definition
[Browsable(false)]
public List<Keys> KeysInternal { get; set; }

Property Value

List<Keys>

A list of keys used internally for chord management.

ModifierKeys

Gets the string representation of the modifier keys (Alt, Ctrl, Shift) in this chord.

Declaration

cs-api-definition
public string ModifierKeys { get; }

Property Value

string

A string describing the modifier keys used in this chord.

Methods

Clear()

Clears all keys and modifiers from this chord.

Declaration

cs-api-definition
public void Clear()

CompareTo(object)

Compares this chord with another chord for equality and ordering.

Declaration

cs-api-definition
public int CompareTo(object obj)

Parameters

obj

object

The chord to compare with this instance.

Returns

int

Zero if equal, positive if this chord is greater, negative otherwise.

Implements IComparable.CompareTo(object)

ProccessModifiers()

Processes the modifier keys (Alt, Ctrl, Shift) from the keys collection and moves them to the chord modifier.

Declaration

cs-api-definition
public void ProccessModifiers()

ReverseProccessModifiers()

Reverses the modifier processing by adding modifier keys back to the keys collection from the chord modifier.

Declaration

cs-api-definition
public void ReverseProccessModifiers()

ToString()

Returns the string representation of this chord.

Declaration

cs-api-definition
public override string ToString()

Returns

string

A string representing the key combination of this chord.

Overrides object.ToString()