SSE Hooks

useKbd

Custom hook that detects the operating system (Mac vs.

Installation

npx sse-tool add use-kbd

Usage

import { useKbd } from "./{hooks file}";

const { isMac, getKbdKey } = useKbd();
// Returns "⌘" on Mac, "Ctrl" on Windows
const metaSymbol = getKbdKey("meta");
return <div>Press {metaSymbol} + C to copy</div>;

API

Return Value

Returns Object.

An object containing the OS detection state and a key mapping function.

Changelog

No recent changes.
Built with Love • © 2026