mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
Register global keyboard shortcuts: Cmd/Ctrl+K to focus search, Cmd/Ctrl+/ for tools view, Cmd/Ctrl+Shift+D to toggle theme, Cmd/Ctrl+Alt+1-8 for quick tool navigation. Uses platform-aware mod key detection (Cmd on Mac, Ctrl on Windows/Linux).
16 lines
374 B
TypeScript
16 lines
374 B
TypeScript
import { useKeyboardShortcuts } from "@/hooks/use-keyboard-shortcuts";
|
|
|
|
/**
|
|
* Wrapper that registers global keyboard shortcuts.
|
|
* Must be rendered inside a <BrowserRouter> so that
|
|
* useNavigate() works inside the hook.
|
|
*/
|
|
export function KeyboardShortcutProvider({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
useKeyboardShortcuts();
|
|
return <>{children}</>;
|
|
}
|