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 AllStatic EditingStatic FunctionStatic LetterStatic LockStatic ModifierStatic MultimediaStatic NavigationStatic NumberStatic SpecialStatic SpecialA collection of functions within the KeysKey object that assess special key group combinations in key events.
The SpecialCombos object contains various methods to check for specific combinations of keys being pressed
during a KeyEvent. Each method takes a KeyEvent as an argument and returns a boolean indicating whether
the specific key combination is active.
Usage Example:
KeysKey.SpecialCombos.isMetaAndShift(event)
Methods:
isDigit(event: KeyEvent): KeysKey[] | undefined
Returns an array of KeysKey if the key event corresponds to a digit, or undefined otherwise.
isLetter(event: KeyEvent): KeysKey[] | undefined
Returns an array of KeysKey if the key event corresponds to a letter, or undefined otherwise.
isLowerCase(event: KeyEvent): KeysKey[] | undefined
Returns an array of KeysKey if the key event corresponds to a lowercase letter, or undefined otherwise.
isUppercaseLetter(event: KeyEvent): KeysKey[] | undefined
Returns an array of KeysKey if the key event corresponds to an uppercase letter, or undefined otherwise.
isNonEnglishLetter(event: KeyEvent): KeysKey[] | undefined
Returns an array of KeysKey if the key event corresponds to a non-English letter, or undefined otherwise.
`isMetaAndShift(event: KeyEvent): KeysKey
Additional methods follow a similar pattern, analyzing different key combinations.
Static SpecialStatic 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.
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.