isModifierKey

Function: isModifierKey()

ts
function isModifierKey(key): key is string;
function isModifierKey(key): key is string;

Defined in: parse.ts:242

Checks if a string is a recognized modifier token (including aliases).

For a KeyboardEvent, use isModifier(normalizeKeyName(event.key)) so DOM spellings like OS / Win match the same alias table.

Parameters

key

Key name or alias (e.g. from a hotkey string or event.key)

Key | string & object

Returns

key is string

True if the string is a recognized modifier