Class ShortcutKey

The ShortcutKey implements key combination used for triggering keyboard shortcuts. The class follows the 'copy-on-write' pattern, which means that every operation returns a copy of the shortcut key with updates values. It also implies that the values of the shortcut key cannot be directly modified.

The concept of immutability improves sharing of objects as all types in TypeScript are assigned by identity, instead of by-value (e.g. a copy) as in other programming languages like C.

Constructors

Properties

Accessors

Methods

Constructors

Properties

_key: EnumValue<ButtonCode, number>
_modifier: EnumValue<ButtonModifier, number>

Blank shortcut key that cannot be triggered.

Accessors

Methods

  • Copies all properties defined by the prototype of ShortcutKey from other to this instance.

    Parameters

    Returns ShortcutKey

  • Clones this instance and returns a new ShortcutKey with identical values.

    Returns ShortcutKey

  • Determines if both shortcut keys have the same modifier and button code.

    Parameters

    Returns boolean

  • Returns a string representation of an object.

    Returns string

  • Determines if both shortcut keys have the same modifier and button code.

    Parameters

    Returns boolean