@thibault.sh/hooks
Version:
A comprehensive collection of React hooks for browser storage, UI interactions, and more
10 lines (8 loc) • 360 B
TypeScript
type KeyCombo = string[];
/**
* Hook that detects when a specific combination of keys is pressed
* @param targetCombo - Array of keys that make up the combination (e.g., ["Control", "Shift", "a"])
* @returns boolean indicating if the combination is currently active
*/
declare function useKeyCombo(targetCombo: KeyCombo): boolean;
export { useKeyCombo };