Creates a new instance of the KeysKey class.
Optional
enableDebugMode: boolean = falseWhether to enable debug mode. When debug mode is enabled, additional console logs will be displayed. This may result in some performance issues. It's recommended to disable debug mode in a production environment.
Static
AllReadonly
prototype: FunctionStatic
EditingStatic
FunctionStatic
LetterStatic
LockStatic
ModifierStatic
MultimediaStatic
NavigationStatic
NumberStatic
SpecialStatic
SpecialStatic
SpecialReadonly
prototype: FunctionStatic
WhiteStatic
debugStatic
optimizedStatic
AndChecks if all the keys match the provided event.
The DOM event that was triggered.
Rest
...keys: default[]A list of keys to check against the event. Can be provided as an array, KeysKeys groups (And / Or) or just lose arguments (will be interpreted as And).
Static
IsChecks if keys match the provided event. Basically just a wrapper for the .And method but it's a more intuitive name when checking for a single key.
The DOM event that was triggered.
Rest
...keys: default[]A list of keys to check against the event. Can be provided as an array, KeysKeys groups (And / Or) or just lose arguments (will be interpreted as And).
Static
OptimizedChecks if keys match the provided event. If one key doesn't match it immediately terminates and does nto provide a full list of matches. This is faster than the And method.
The DOM event that was triggered.
Rest
...keys: default[]A list of keys to check against the event. Can be provided as an array, KeysKeys groups (And / Or) or just lose arguments (will be interpreted as And).
Static
OrChecks if one of the keys matches the provided event.
The DOM event that was triggered.
Rest
...keys: default[]A list of keys to check against the event. Can be provided as an array, KeysKeys groups (And / Or) or just lose arguments (will be interpreted as And).
Static
Private
matchFor internal use by the exposed methods. Checks if a list of keys match the provided event.
Rest
...keys: default[]Generated using TypeDoc
This is the main class of the library. It contains all the methods to check if a key event matches a key or a combination of keys.