useKey
Bind keyboard shortcuts with single key, array, and key map overloads. Requires KeyboardProvider.
The primary hook for binding keyboard shortcuts. Requires KeyboardProvider (silently does nothing without one). Not available in copy mode — install the full @diffgazer/keys package.
For the complete API reference including hotkey format and all options, see the @diffgazer/keys documentation.
Usage
Three overloads:
mod maps to Meta on Mac and Ctrl on Windows/Linux. Uppercase single letter implies Shift: "G" matches Shift+G.
useScope
Pushes a named scope onto the stack. While active, only handlers registered in this scope fire. Pops automatically on unmount.
When a scope is pushed, all useKey hooks in the previous scope stop receiving events. This is how dialogs and modals isolate their keyboard handling.