Optionalmodifier: EnumValue<ButtonModifier, number>Optionalkey: EnumValue<ButtonCode, number>Copies all properties defined by the prototype of ShortcutKey from other to this instance.
Clones this instance and returns a new ShortcutKey with identical values.
Determines if both shortcut keys have the same modifier and button code.
StaticisDetermines if both shortcut keys have the same modifier and button code.
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.