type KeyCombo = string[]; /** * Hook that detects when a specific combination of keys is pressed simultaneously. * * Useful for implementing keyboard shortcuts, hotkeys, or complex key combinations * in your React components. The hook tracks all currently pressed keys and returns * true when all keys in the target combination are active. * * @param targetCombo - Array of key names that make up the combination * * @returns Boolean indicating if all keys in the combination are currently pressed * * @example * ```tsx * function App() { * const isSaveCombo = useKeyCombo(['Control', 's']); * const isUndoCombo = useKeyCombo(['Control', 'z']); * const isComplexCombo = useKeyCombo(['Control', 'Shift', 'p']); * * useEffect(() => { * if (isSaveCombo) { * console.log('Save shortcut pressed!'); * // Handle save action * } * }, [isSaveCombo]); * * return ( *
*

Press Ctrl+S to save

*

Save combo active: {isSaveCombo ? 'Yes' : 'No'}

*
* ); * } * ``` * * @see https://thibault.sh/hooks/use-key-combo */ declare function useKeyCombo(targetCombo: KeyCombo): boolean; export { useKeyCombo };