TanStack
Hotkey Recorder API Reference

RecorderKeyMode

ts
type RecorderKeyMode = "auto" | "code" | "key";

Defined in: hotkey-recorder.ts:40

How the recorder writes the pressed key:

  • 'auto' (default): by name when the press has one, such as Mod+S or Shift+Enter, and by physical code otherwise, such as Alt+[Digit1] for macOS Option+1. The result reads like a hotkey written by hand, so it compares equal to one, and its label follows the user's keyboard layout. Recorded by code: Shift or macOS Option with a digit or a symbol, dead keys and the numpad.
  • 'code': always by physical code, such as Mod+[KeyS]. The hotkey names a position on the keyboard, whatever that key types.
  • 'key': always by the character or key name the press produced, such as Alt+ß for macOS Option+S.