normalizeKey
normalizeKey(
key):string
Defined in: extensions/commands/utils.ts:27
Normalizes modifier keys to a bitmask that’s used by getKeysFromEvent. All keys are case insensitive.
Rules:
alt→1ctrlorcontrol→2metaorcmd→4shift→8mod→4on Mac,2otherwise
Parameters
Section titled “Parameters”string
Key to normalize.
Returns
Section titled “Returns”string
Normalized and lowercase key.
Example
Section titled “Example”normalizeKey("a") // "0+a"normalizeKey("+") // "0++"normalizeKey("ctrl+alt+a") // "3+a"normalizeKey("10+ALT+a") // "11+a"normalizeKey("shift+alt+12+a") // "13+a"