From 0de4150abc93c68a6292d6fcb326ab7a09623443 Mon Sep 17 00:00:00 2001 From: Mohammed Ja Date: Thu, 19 Feb 2026 14:20:58 +0300 Subject: [PATCH 1/2] feat(hotkeys): add numpad key support --- .changeset/numpad-keys-support.md | 5 ++++ packages/hotkeys/src/constants.ts | 49 +++++++++++++++++++++++++++++++ packages/hotkeys/src/hotkey.ts | 23 +++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 .changeset/numpad-keys-support.md diff --git a/.changeset/numpad-keys-support.md b/.changeset/numpad-keys-support.md new file mode 100644 index 0000000..ae78f7e --- /dev/null +++ b/.changeset/numpad-keys-support.md @@ -0,0 +1,5 @@ +--- +'@tanstack/hotkeys': minor +--- + +Add numpad key support with NumpadKey type including Numpad0-9, NumpadAdd, NumpadSubtract, NumpadMultiply, NumpadDivide, NumpadDecimal, and NumpadEnter diff --git a/packages/hotkeys/src/constants.ts b/packages/hotkeys/src/constants.ts index ae6631d..911bf30 100644 --- a/packages/hotkeys/src/constants.ts +++ b/packages/hotkeys/src/constants.ts @@ -5,6 +5,7 @@ import type { LetterKey, NavigationKey, NumberKey, + NumpadKey, PunctuationKey, } from './hotkey' @@ -300,6 +301,35 @@ export const PUNCTUATION_KEYS = new Set([ '`', ]) +/** + * Set of all valid numpad keys. + * + * Numpad keys are commonly used for data entry and calculator-style input. + * They produce distinct `event.key` values from the main number row: + * - `Numpad0`-`Numpad9` for digits + * - `NumpadAdd`, `NumpadSubtract`, `NumpadMultiply`, `NumpadDivide` for operators + * - `NumpadDecimal` for the decimal point + * - `NumpadEnter` for the numpad enter key + */ +export const NUMPAD_KEYS = new Set([ + 'Numpad0', + 'Numpad1', + 'Numpad2', + 'Numpad3', + 'Numpad4', + 'Numpad5', + 'Numpad6', + 'Numpad7', + 'Numpad8', + 'Numpad9', + 'NumpadAdd', + 'NumpadSubtract', + 'NumpadMultiply', + 'NumpadDivide', + 'NumpadDecimal', + 'NumpadEnter', +]) + /** * Set of all valid non-modifier keys. * @@ -321,6 +351,7 @@ export const ALL_KEYS = new Set([ ...NAVIGATION_KEYS, ...EDITING_KEYS, ...PUNCTUATION_KEYS, + ...NUMPAD_KEYS, ]) /** @@ -393,6 +424,24 @@ const KEY_ALIASES: Record = { PgDn: 'PageDown', pgup: 'PageUp', pgdn: 'PageDown', + + // Numpad variants (lowercase aliases) + numpad0: 'Numpad0', + numpad1: 'Numpad1', + numpad2: 'Numpad2', + numpad3: 'Numpad3', + numpad4: 'Numpad4', + numpad5: 'Numpad5', + numpad6: 'Numpad6', + numpad7: 'Numpad7', + numpad8: 'Numpad8', + numpad9: 'Numpad9', + numpadadd: 'NumpadAdd', + numpadsubtract: 'NumpadSubtract', + numpadmultiply: 'NumpadMultiply', + numpaddivide: 'NumpadDivide', + numpaddecimal: 'NumpadDecimal', + numpadenter: 'NumpadEnter', } /** diff --git a/packages/hotkeys/src/hotkey.ts b/packages/hotkeys/src/hotkey.ts index 756a9c9..16940a5 100644 --- a/packages/hotkeys/src/hotkey.ts +++ b/packages/hotkeys/src/hotkey.ts @@ -125,6 +125,28 @@ export type PunctuationKey = | '.' | '`' +/** + * Numpad keys for numeric keypad operations. + * These keys are commonly used for data entry and calculator-style input. + */ +export type NumpadKey = + | 'Numpad0' + | 'Numpad1' + | 'Numpad2' + | 'Numpad3' + | 'Numpad4' + | 'Numpad5' + | 'Numpad6' + | 'Numpad7' + | 'Numpad8' + | 'Numpad9' + | 'NumpadAdd' + | 'NumpadSubtract' + | 'NumpadMultiply' + | 'NumpadDivide' + | 'NumpadDecimal' + | 'NumpadEnter' + /** * Keys that don't change their value when Shift is pressed. * These keys produce the same `KeyboardEvent.key` value whether Shift is held or not. @@ -141,6 +163,7 @@ type NonPunctuationKey = | EditingKey | NavigationKey | FunctionKey + | NumpadKey /** * All supported non-modifier keys. From b93986d546bcd64ac1be81a2428a8f8fd4260759 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 11:45:20 +0000 Subject: [PATCH 2/2] ci: apply automated fixes --- docs/reference/functions/detectPlatform.md | 2 +- docs/reference/functions/normalizeKeyName.md | 2 +- docs/reference/functions/resolveModifier.md | 2 +- docs/reference/index.md | 2 ++ .../interfaces/FormatDisplayOptions.md | 4 +-- .../interfaces/HotkeyCallbackContext.md | 6 ++-- docs/reference/interfaces/ParsedHotkey.md | 14 ++++----- docs/reference/interfaces/RawHotkey.md | 14 ++++----- docs/reference/interfaces/ValidationResult.md | 8 ++--- docs/reference/type-aliases/HeldKey.md | 2 +- docs/reference/type-aliases/Hotkey.md | 2 +- docs/reference/type-aliases/HotkeyCallback.md | 2 +- docs/reference/type-aliases/Key.md | 2 +- docs/reference/type-aliases/NumpadKey.md | 31 +++++++++++++++++++ .../type-aliases/RegisterableHotkey.md | 2 +- docs/reference/variables/ALL_KEYS.md | 5 +-- docs/reference/variables/EDITING_KEYS.md | 2 +- docs/reference/variables/FUNCTION_KEYS.md | 2 +- .../variables/KEY_DISPLAY_SYMBOLS.md | 2 +- docs/reference/variables/LETTER_KEYS.md | 2 +- .../variables/MAC_MODIFIER_SYMBOLS.md | 2 +- docs/reference/variables/MODIFIER_ALIASES.md | 2 +- docs/reference/variables/MODIFIER_KEYS.md | 2 +- docs/reference/variables/MODIFIER_ORDER.md | 2 +- docs/reference/variables/NAVIGATION_KEYS.md | 2 +- docs/reference/variables/NUMBER_KEYS.md | 2 +- docs/reference/variables/NUMPAD_KEYS.md | 21 +++++++++++++ docs/reference/variables/PUNCTUATION_KEYS.md | 2 +- .../variables/STANDARD_MODIFIER_LABELS.md | 2 +- 29 files changed, 100 insertions(+), 45 deletions(-) create mode 100644 docs/reference/type-aliases/NumpadKey.md create mode 100644 docs/reference/variables/NUMPAD_KEYS.md diff --git a/docs/reference/functions/detectPlatform.md b/docs/reference/functions/detectPlatform.md index 4428a37..7c509fb 100644 --- a/docs/reference/functions/detectPlatform.md +++ b/docs/reference/functions/detectPlatform.md @@ -9,7 +9,7 @@ title: detectPlatform function detectPlatform(): "mac" | "windows" | "linux"; ``` -Defined in: [constants.ts:30](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L30) +Defined in: [constants.ts:31](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L31) Detects the current platform based on browser navigator properties. diff --git a/docs/reference/functions/normalizeKeyName.md b/docs/reference/functions/normalizeKeyName.md index d561d46..0ff3548 100644 --- a/docs/reference/functions/normalizeKeyName.md +++ b/docs/reference/functions/normalizeKeyName.md @@ -9,7 +9,7 @@ title: normalizeKeyName function normalizeKeyName(key): string; ``` -Defined in: [constants.ts:422](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L422) +Defined in: [constants.ts:471](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L471) Normalizes a key name to its canonical form. diff --git a/docs/reference/functions/resolveModifier.md b/docs/reference/functions/resolveModifier.md index 1838ab6..f8ee5d7 100644 --- a/docs/reference/functions/resolveModifier.md +++ b/docs/reference/functions/resolveModifier.md @@ -9,7 +9,7 @@ title: resolveModifier function resolveModifier(modifier, platform): CanonicalModifier; ``` -Defined in: [constants.ts:155](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L155) +Defined in: [constants.ts:156](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L156) Resolves the platform-adaptive 'Mod' modifier to the appropriate canonical modifier. diff --git a/docs/reference/index.md b/docs/reference/index.md index b296021..4e6d6a9 100644 --- a/docs/reference/index.md +++ b/docs/reference/index.md @@ -44,6 +44,7 @@ title: "@tanstack/hotkeys" - [Modifier](type-aliases/Modifier.md) - [NavigationKey](type-aliases/NavigationKey.md) - [NumberKey](type-aliases/NumberKey.md) +- [NumpadKey](type-aliases/NumpadKey.md) - [PunctuationKey](type-aliases/PunctuationKey.md) - [RegisterableHotkey](type-aliases/RegisterableHotkey.md) @@ -60,6 +61,7 @@ title: "@tanstack/hotkeys" - [MODIFIER\_ORDER](variables/MODIFIER_ORDER.md) - [NAVIGATION\_KEYS](variables/NAVIGATION_KEYS.md) - [NUMBER\_KEYS](variables/NUMBER_KEYS.md) +- [NUMPAD\_KEYS](variables/NUMPAD_KEYS.md) - [PUNCTUATION\_KEYS](variables/PUNCTUATION_KEYS.md) - [STANDARD\_MODIFIER\_LABELS](variables/STANDARD_MODIFIER_LABELS.md) diff --git a/docs/reference/interfaces/FormatDisplayOptions.md b/docs/reference/interfaces/FormatDisplayOptions.md index c233eef..f34e512 100644 --- a/docs/reference/interfaces/FormatDisplayOptions.md +++ b/docs/reference/interfaces/FormatDisplayOptions.md @@ -5,7 +5,7 @@ title: FormatDisplayOptions # Interface: FormatDisplayOptions -Defined in: [hotkey.ts:367](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L367) +Defined in: [hotkey.ts:390](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L390) Options for formatting hotkeys for display. @@ -17,6 +17,6 @@ Options for formatting hotkeys for display. optional platform: "mac" | "windows" | "linux"; ``` -Defined in: [hotkey.ts:369](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L369) +Defined in: [hotkey.ts:392](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L392) The target platform. Defaults to auto-detection. diff --git a/docs/reference/interfaces/HotkeyCallbackContext.md b/docs/reference/interfaces/HotkeyCallbackContext.md index 9790013..9b23225 100644 --- a/docs/reference/interfaces/HotkeyCallbackContext.md +++ b/docs/reference/interfaces/HotkeyCallbackContext.md @@ -5,7 +5,7 @@ title: HotkeyCallbackContext # Interface: HotkeyCallbackContext -Defined in: [hotkey.ts:387](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L387) +Defined in: [hotkey.ts:410](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L410) Context passed to hotkey callbacks along with the keyboard event. @@ -17,7 +17,7 @@ Context passed to hotkey callbacks along with the keyboard event. hotkey: Hotkey; ``` -Defined in: [hotkey.ts:389](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L389) +Defined in: [hotkey.ts:412](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L412) The original hotkey string that was registered @@ -29,6 +29,6 @@ The original hotkey string that was registered parsedHotkey: ParsedHotkey; ``` -Defined in: [hotkey.ts:391](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L391) +Defined in: [hotkey.ts:414](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L414) The parsed representation of the hotkey diff --git a/docs/reference/interfaces/ParsedHotkey.md b/docs/reference/interfaces/ParsedHotkey.md index a142d43..db2fb19 100644 --- a/docs/reference/interfaces/ParsedHotkey.md +++ b/docs/reference/interfaces/ParsedHotkey.md @@ -5,7 +5,7 @@ title: ParsedHotkey # Interface: ParsedHotkey -Defined in: [hotkey.ts:308](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L308) +Defined in: [hotkey.ts:331](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L331) A parsed representation of a hotkey string. @@ -33,7 +33,7 @@ useHotkey(parsed, handler) // Works even if userInput isn't in Hotkey type alt: boolean; ``` -Defined in: [hotkey.ts:316](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L316) +Defined in: [hotkey.ts:339](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L339) Whether the Alt key is required @@ -45,7 +45,7 @@ Whether the Alt key is required ctrl: boolean; ``` -Defined in: [hotkey.ts:312](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L312) +Defined in: [hotkey.ts:335](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L335) Whether the Control key is required @@ -57,7 +57,7 @@ Whether the Control key is required key: Key | string & object; ``` -Defined in: [hotkey.ts:310](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L310) +Defined in: [hotkey.ts:333](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L333) The non-modifier key (e.g., 'S', 'Escape', 'F1', '/', '['). Can be any string for flexibility. @@ -69,7 +69,7 @@ The non-modifier key (e.g., 'S', 'Escape', 'F1', '/', '['). Can be any string fo meta: boolean; ``` -Defined in: [hotkey.ts:318](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L318) +Defined in: [hotkey.ts:341](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L341) Whether the Meta (Command) key is required @@ -81,7 +81,7 @@ Whether the Meta (Command) key is required modifiers: CanonicalModifier[]; ``` -Defined in: [hotkey.ts:320](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L320) +Defined in: [hotkey.ts:343](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L343) List of canonical modifier names that are required, in canonical order @@ -93,6 +93,6 @@ List of canonical modifier names that are required, in canonical order shift: boolean; ``` -Defined in: [hotkey.ts:314](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L314) +Defined in: [hotkey.ts:337](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L337) Whether the Shift key is required diff --git a/docs/reference/interfaces/RawHotkey.md b/docs/reference/interfaces/RawHotkey.md index a0255a8..c644107 100644 --- a/docs/reference/interfaces/RawHotkey.md +++ b/docs/reference/interfaces/RawHotkey.md @@ -5,7 +5,7 @@ title: RawHotkey # Interface: RawHotkey -Defined in: [hotkey.ts:343](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L343) +Defined in: [hotkey.ts:366](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L366) A raw hotkey object for programmatic registration. @@ -35,7 +35,7 @@ useHotkey({ key: 'S', mod: true, shift: true }, handler) // Mod+Shift+S optional alt: boolean; ``` -Defined in: [hotkey.ts:353](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L353) +Defined in: [hotkey.ts:376](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L376) Whether the Alt key is required. Defaults to false. @@ -47,7 +47,7 @@ Whether the Alt key is required. Defaults to false. optional ctrl: boolean; ``` -Defined in: [hotkey.ts:349](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L349) +Defined in: [hotkey.ts:372](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L372) Whether the Control key is required. Defaults to false. @@ -59,7 +59,7 @@ Whether the Control key is required. Defaults to false. key: Key | string & object; ``` -Defined in: [hotkey.ts:345](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L345) +Defined in: [hotkey.ts:368](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L368) The non-modifier key (e.g., 'S', 'Escape', 'F1'). @@ -71,7 +71,7 @@ The non-modifier key (e.g., 'S', 'Escape', 'F1'). optional meta: boolean; ``` -Defined in: [hotkey.ts:355](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L355) +Defined in: [hotkey.ts:378](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L378) Whether the Meta (Command) key is required. Defaults to false. @@ -83,7 +83,7 @@ Whether the Meta (Command) key is required. Defaults to false. optional mod: boolean; ``` -Defined in: [hotkey.ts:347](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L347) +Defined in: [hotkey.ts:370](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L370) Platform-adaptive modifier: Command on macOS, Control on Windows/Linux. Defaults to false. @@ -95,6 +95,6 @@ Platform-adaptive modifier: Command on macOS, Control on Windows/Linux. Defaults optional shift: boolean; ``` -Defined in: [hotkey.ts:351](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L351) +Defined in: [hotkey.ts:374](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L374) Whether the Shift key is required. Defaults to false. diff --git a/docs/reference/interfaces/ValidationResult.md b/docs/reference/interfaces/ValidationResult.md index 32c2345..49d0c95 100644 --- a/docs/reference/interfaces/ValidationResult.md +++ b/docs/reference/interfaces/ValidationResult.md @@ -5,7 +5,7 @@ title: ValidationResult # Interface: ValidationResult -Defined in: [hotkey.ts:375](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L375) +Defined in: [hotkey.ts:398](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L398) Result of validating a hotkey string. @@ -17,7 +17,7 @@ Result of validating a hotkey string. errors: string[]; ``` -Defined in: [hotkey.ts:381](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L381) +Defined in: [hotkey.ts:404](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L404) Error messages about invalid syntax @@ -29,7 +29,7 @@ Error messages about invalid syntax valid: boolean; ``` -Defined in: [hotkey.ts:377](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L377) +Defined in: [hotkey.ts:400](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L400) Whether the hotkey is valid (can still have warnings) @@ -41,6 +41,6 @@ Whether the hotkey is valid (can still have warnings) warnings: string[]; ``` -Defined in: [hotkey.ts:379](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L379) +Defined in: [hotkey.ts:402](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L402) Warning messages about potential issues diff --git a/docs/reference/type-aliases/HeldKey.md b/docs/reference/type-aliases/HeldKey.md index ada5d42..6db507b 100644 --- a/docs/reference/type-aliases/HeldKey.md +++ b/docs/reference/type-aliases/HeldKey.md @@ -9,7 +9,7 @@ title: HeldKey type HeldKey = CanonicalModifier | Key; ``` -Defined in: [hotkey.ts:154](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L154) +Defined in: [hotkey.ts:177](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L177) Keys that can be tracked as "held" (pressed down). Includes both modifier keys and regular keys. diff --git a/docs/reference/type-aliases/Hotkey.md b/docs/reference/type-aliases/Hotkey.md index 6a8c5ad..6b76f2b 100644 --- a/docs/reference/type-aliases/Hotkey.md +++ b/docs/reference/type-aliases/Hotkey.md @@ -14,7 +14,7 @@ type Hotkey = | FourModifierHotkey; ``` -Defined in: [hotkey.ts:283](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L283) +Defined in: [hotkey.ts:306](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L306) A type-safe hotkey string. diff --git a/docs/reference/type-aliases/HotkeyCallback.md b/docs/reference/type-aliases/HotkeyCallback.md index 728df70..29020e1 100644 --- a/docs/reference/type-aliases/HotkeyCallback.md +++ b/docs/reference/type-aliases/HotkeyCallback.md @@ -9,7 +9,7 @@ title: HotkeyCallback type HotkeyCallback = (event, context) => void; ``` -Defined in: [hotkey.ts:408](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L408) +Defined in: [hotkey.ts:431](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L431) Callback function type for hotkey handlers. diff --git a/docs/reference/type-aliases/Key.md b/docs/reference/type-aliases/Key.md index 6ea2748..538175f 100644 --- a/docs/reference/type-aliases/Key.md +++ b/docs/reference/type-aliases/Key.md @@ -9,6 +9,6 @@ title: Key type Key = NonPunctuationKey | PunctuationKey; ``` -Defined in: [hotkey.ts:148](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L148) +Defined in: [hotkey.ts:171](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L171) All supported non-modifier keys. diff --git a/docs/reference/type-aliases/NumpadKey.md b/docs/reference/type-aliases/NumpadKey.md new file mode 100644 index 0000000..f1c4af1 --- /dev/null +++ b/docs/reference/type-aliases/NumpadKey.md @@ -0,0 +1,31 @@ +--- +id: NumpadKey +title: NumpadKey +--- + +# Type Alias: NumpadKey + +```ts +type NumpadKey = + | "Numpad0" + | "Numpad1" + | "Numpad2" + | "Numpad3" + | "Numpad4" + | "Numpad5" + | "Numpad6" + | "Numpad7" + | "Numpad8" + | "Numpad9" + | "NumpadAdd" + | "NumpadSubtract" + | "NumpadMultiply" + | "NumpadDivide" + | "NumpadDecimal" + | "NumpadEnter"; +``` + +Defined in: [hotkey.ts:132](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L132) + +Numpad keys for numeric keypad operations. +These keys are commonly used for data entry and calculator-style input. diff --git a/docs/reference/type-aliases/RegisterableHotkey.md b/docs/reference/type-aliases/RegisterableHotkey.md index ca996bb..38b4e51 100644 --- a/docs/reference/type-aliases/RegisterableHotkey.md +++ b/docs/reference/type-aliases/RegisterableHotkey.md @@ -9,7 +9,7 @@ title: RegisterableHotkey type RegisterableHotkey = Hotkey | RawHotkey; ``` -Defined in: [hotkey.ts:362](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L362) +Defined in: [hotkey.ts:385](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/hotkey.ts#L385) A hotkey that can be passed to `HotkeyManager.register()` and `useHotkey()`. Either a type-safe string (`Hotkey`) or a raw object (`RawHotkey`). diff --git a/docs/reference/variables/ALL_KEYS.md b/docs/reference/variables/ALL_KEYS.md index 818f62c..c1dabe0 100644 --- a/docs/reference/variables/ALL_KEYS.md +++ b/docs/reference/variables/ALL_KEYS.md @@ -12,10 +12,11 @@ const ALL_KEYS: Set< | FunctionKey | NavigationKey | EditingKey -| PunctuationKey>; + | PunctuationKey +| NumpadKey>; ``` -Defined in: [constants.ts:317](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L317) +Defined in: [constants.ts:347](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L347) Set of all valid non-modifier keys. diff --git a/docs/reference/variables/EDITING_KEYS.md b/docs/reference/variables/EDITING_KEYS.md index 1d630d1..f3ddf72 100644 --- a/docs/reference/variables/EDITING_KEYS.md +++ b/docs/reference/variables/EDITING_KEYS.md @@ -9,7 +9,7 @@ title: EDITING_KEYS const EDITING_KEYS: Set; ``` -Defined in: [constants.ts:270](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L270) +Defined in: [constants.ts:271](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L271) Set of all valid editing and special keys. diff --git a/docs/reference/variables/FUNCTION_KEYS.md b/docs/reference/variables/FUNCTION_KEYS.md index 270c10b..14cb466 100644 --- a/docs/reference/variables/FUNCTION_KEYS.md +++ b/docs/reference/variables/FUNCTION_KEYS.md @@ -9,7 +9,7 @@ title: FUNCTION_KEYS const FUNCTION_KEYS: Set; ``` -Defined in: [constants.ts:230](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L230) +Defined in: [constants.ts:231](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L231) Set of all valid function keys (F1-F12). diff --git a/docs/reference/variables/KEY_DISPLAY_SYMBOLS.md b/docs/reference/variables/KEY_DISPLAY_SYMBOLS.md index 73ac054..876082d 100644 --- a/docs/reference/variables/KEY_DISPLAY_SYMBOLS.md +++ b/docs/reference/variables/KEY_DISPLAY_SYMBOLS.md @@ -9,7 +9,7 @@ title: KEY_DISPLAY_SYMBOLS const KEY_DISPLAY_SYMBOLS: Record; ``` -Defined in: [constants.ts:505](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L505) +Defined in: [constants.ts:554](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L554) Special key symbols for display formatting. diff --git a/docs/reference/variables/LETTER_KEYS.md b/docs/reference/variables/LETTER_KEYS.md index 96d4c69..5788400 100644 --- a/docs/reference/variables/LETTER_KEYS.md +++ b/docs/reference/variables/LETTER_KEYS.md @@ -9,7 +9,7 @@ title: LETTER_KEYS const LETTER_KEYS: Set; ``` -Defined in: [constants.ts:175](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L175) +Defined in: [constants.ts:176](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L176) Set of all valid letter keys (A-Z). diff --git a/docs/reference/variables/MAC_MODIFIER_SYMBOLS.md b/docs/reference/variables/MAC_MODIFIER_SYMBOLS.md index 472c857..592b60e 100644 --- a/docs/reference/variables/MAC_MODIFIER_SYMBOLS.md +++ b/docs/reference/variables/MAC_MODIFIER_SYMBOLS.md @@ -9,7 +9,7 @@ title: MAC_MODIFIER_SYMBOLS const MAC_MODIFIER_SYMBOLS: Record; ``` -Defined in: [constants.ts:461](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L461) +Defined in: [constants.ts:510](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L510) Modifier key symbols for macOS display. diff --git a/docs/reference/variables/MODIFIER_ALIASES.md b/docs/reference/variables/MODIFIER_ALIASES.md index 3c831e7..ae557e9 100644 --- a/docs/reference/variables/MODIFIER_ALIASES.md +++ b/docs/reference/variables/MODIFIER_ALIASES.md @@ -9,7 +9,7 @@ title: MODIFIER_ALIASES const MODIFIER_ALIASES: Record; ``` -Defined in: [constants.ts:102](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L102) +Defined in: [constants.ts:103](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L103) Maps modifier key aliases to their canonical form or platform-adaptive 'Mod'. diff --git a/docs/reference/variables/MODIFIER_KEYS.md b/docs/reference/variables/MODIFIER_KEYS.md index f22f3ec..409ceaa 100644 --- a/docs/reference/variables/MODIFIER_KEYS.md +++ b/docs/reference/variables/MODIFIER_KEYS.md @@ -9,7 +9,7 @@ title: MODIFIER_KEYS const MODIFIER_KEYS: Set; ``` -Defined in: [constants.ts:81](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L81) +Defined in: [constants.ts:82](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L82) Set of canonical modifier key names for fast lookup. diff --git a/docs/reference/variables/MODIFIER_ORDER.md b/docs/reference/variables/MODIFIER_ORDER.md index 6f33862..e613ee6 100644 --- a/docs/reference/variables/MODIFIER_ORDER.md +++ b/docs/reference/variables/MODIFIER_ORDER.md @@ -9,7 +9,7 @@ title: MODIFIER_ORDER const MODIFIER_ORDER: CanonicalModifier[]; ``` -Defined in: [constants.ts:67](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L67) +Defined in: [constants.ts:68](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L68) Canonical order for modifiers in normalized hotkey strings. diff --git a/docs/reference/variables/NAVIGATION_KEYS.md b/docs/reference/variables/NAVIGATION_KEYS.md index 2cebdc3..6404634 100644 --- a/docs/reference/variables/NAVIGATION_KEYS.md +++ b/docs/reference/variables/NAVIGATION_KEYS.md @@ -9,7 +9,7 @@ title: NAVIGATION_KEYS const NAVIGATION_KEYS: Set; ``` -Defined in: [constants.ts:252](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L252) +Defined in: [constants.ts:253](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L253) Set of all valid navigation keys for cursor movement and document navigation. diff --git a/docs/reference/variables/NUMBER_KEYS.md b/docs/reference/variables/NUMBER_KEYS.md index 5da0b89..f671664 100644 --- a/docs/reference/variables/NUMBER_KEYS.md +++ b/docs/reference/variables/NUMBER_KEYS.md @@ -9,7 +9,7 @@ title: NUMBER_KEYS const NUMBER_KEYS: Set; ``` -Defined in: [constants.ts:211](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L211) +Defined in: [constants.ts:212](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L212) Set of all valid number keys (0-9). diff --git a/docs/reference/variables/NUMPAD_KEYS.md b/docs/reference/variables/NUMPAD_KEYS.md new file mode 100644 index 0000000..7d700b6 --- /dev/null +++ b/docs/reference/variables/NUMPAD_KEYS.md @@ -0,0 +1,21 @@ +--- +id: NUMPAD_KEYS +title: NUMPAD_KEYS +--- + +# Variable: NUMPAD\_KEYS + +```ts +const NUMPAD_KEYS: Set; +``` + +Defined in: [constants.ts:314](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L314) + +Set of all valid numpad keys. + +Numpad keys are commonly used for data entry and calculator-style input. +They produce distinct `event.key` values from the main number row: +- `Numpad0`-`Numpad9` for digits +- `NumpadAdd`, `NumpadSubtract`, `NumpadMultiply`, `NumpadDivide` for operators +- `NumpadDecimal` for the decimal point +- `NumpadEnter` for the numpad enter key diff --git a/docs/reference/variables/PUNCTUATION_KEYS.md b/docs/reference/variables/PUNCTUATION_KEYS.md index 9087000..71cb74e 100644 --- a/docs/reference/variables/PUNCTUATION_KEYS.md +++ b/docs/reference/variables/PUNCTUATION_KEYS.md @@ -9,7 +9,7 @@ title: PUNCTUATION_KEYS const PUNCTUATION_KEYS: Set; ``` -Defined in: [constants.ts:291](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L291) +Defined in: [constants.ts:292](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L292) Set of all valid punctuation keys commonly used in keyboard shortcuts. diff --git a/docs/reference/variables/STANDARD_MODIFIER_LABELS.md b/docs/reference/variables/STANDARD_MODIFIER_LABELS.md index a6c1303..c16d9f1 100644 --- a/docs/reference/variables/STANDARD_MODIFIER_LABELS.md +++ b/docs/reference/variables/STANDARD_MODIFIER_LABELS.md @@ -9,7 +9,7 @@ title: STANDARD_MODIFIER_LABELS const STANDARD_MODIFIER_LABELS: Record; ``` -Defined in: [constants.ts:483](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L483) +Defined in: [constants.ts:532](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/constants.ts#L532) Modifier key labels for Windows/Linux display.