CIA Compliance Manager API Documentation - v1.1.6
    Preparing search index...

    Function getKeyCombination

    • Get key combination string from keyboard event

      Converts KeyboardEvent to a normalized key combination string. Handles platform differences (Cmd vs. Ctrl) and special keys.

      Parameters

      • event: KeyboardEvent

        The keyboard event

      Returns string

      Key combination string (e.g., 'ctrl+shift+k')

      // In event handler
      document.addEventListener('keydown', (event) => {
      const combo = getKeyCombination(event);

      // Match against shortcuts
      if (combo === 'ctrl+shift+k' || combo === 'cmd+shift+k') {
      event.preventDefault();
      openCommandPalette();
      }

      // Log for debugging
      console.log('Key combo:', combo);
      // Examples: 'ctrl+s', 'cmd+k', 'shift+enter', 'escape'
      });

      // Handle special keys
      // Space key: 'ctrl+space'
      // Escape key: 'escape'
      // Enter key: 'shift+enter'