useKeyCombo
Events
A React hook that detects when a specific combination of keys is pressed simultaneously, useful for implementing keyboard shortcuts and hotkeys.
Installation
npm install @thibault.sh/hooksAPI Reference
Signature
type KeyCombo = string[];
function useKeyCombo(targetCombo: KeyCombo): booleanParameters
| Name | Type | Description | Default |
|---|---|---|---|
targetCombo | KeyCombo (string[]) | Array of key names that make up the combination. | - |
Returns
boolean
Boolean indicating if all keys in the combination are currently pressed.