validateHotkey

Function: validateHotkey()

ts
function validateHotkey(hotkey): ValidationResult;

Defined in: validate.ts:24

Validates a hotkey string and returns any warnings or errors.

Checks for:

  • Valid syntax (modifier+...+key format)
  • Known modifiers
  • Known keys

Parameters

hotkey

The hotkey string to validate

Hotkey | string & object

Returns

ValidationResult

A ValidationResult with validity status, warnings, and errors

Example

ts
validateHotkey('Mod+S')
// { valid: true, warnings: [], errors: [] }

validateHotkey('')
// { valid: false, warnings: [], errors: ['Hotkey cannot be empty'] }