Skip to content

feat(hotkeys): add numpad key support#28

Open
MohammedALjaberi wants to merge 2 commits intoTanStack:mainfrom
MohammedALjaberi:feat-numpad-keys
Open

feat(hotkeys): add numpad key support#28
MohammedALjaberi wants to merge 2 commits intoTanStack:mainfrom
MohammedALjaberi:feat-numpad-keys

Conversation

@MohammedALjaberi
Copy link
Contributor

Summary

Add type-safe support for numpad keys, enabling autocomplete for shortcuts like Mod+Numpad1 or NumpadEnter.

🎯 Changes

  • Add NumpadKey type with 16 numpad keys: Numpad0-Numpad9, NumpadAdd, NumpadSubtract, NumpadMultiply, NumpadDivide, NumpadDecimal, NumpadEnter
  • Add NUMPAD_KEYS constant set for validation
  • Include numpad keys in ALL_KEYS union
  • Add NumpadKey to NonPunctuationKey for proper Shift combination typing

Use Cases

  • Professional apps (accounting, 3D modeling like Blender)
  • Data entry applications
  • Gaming shortcuts
  • Accessibility (one-handed numpad operation)

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 19, 2026

Open in StackBlitz

@tanstack/hotkeys

npm i https://pkg.pr.new/TanStack/hotkeys/@tanstack/hotkeys@28

@tanstack/hotkeys-devtools

npm i https://pkg.pr.new/TanStack/hotkeys/@tanstack/hotkeys-devtools@28

@tanstack/react-hotkeys

npm i https://pkg.pr.new/TanStack/hotkeys/@tanstack/react-hotkeys@28

@tanstack/react-hotkeys-devtools

npm i https://pkg.pr.new/TanStack/hotkeys/@tanstack/react-hotkeys-devtools@28

@tanstack/solid-hotkeys

npm i https://pkg.pr.new/TanStack/hotkeys/@tanstack/solid-hotkeys@28

@tanstack/solid-hotkeys-devtools

npm i https://pkg.pr.new/TanStack/hotkeys/@tanstack/solid-hotkeys-devtools@28

commit: b93986d

@KevinVandy
Copy link
Member

So, this is interesting. My original goal was to not support event.code at all and only use event.key. But I guess everyone actually wants to support everything.

@MohammedALjaberi
Copy link
Contributor Author

MohammedALjaberi commented Feb 19, 2026

So, this is interesting. My original goal was to not support event.code at all and only use event.key. But I guess everyone actually wants to support everything.

@KevinVandy, Given your original design goal of using only event.key, I can close this PR. Let me know if you'd prefer a different approach.

@KevinVandy
Copy link
Member

So, this is interesting. My original goal was to not support event.code at all and only use event.key. But I guess everyone actually wants to support everything.

@KevinVandy, Given your original design goal of using only event.key, I can close this PR. Let me know if you'd prefer a different approach.

I'm just actually wondering if we should overhaul the matching system.

@MohammedALjaberi
Copy link
Contributor Author

So, this is interesting. My original goal was to not support event.code at all and only use event.key. But I guess everyone actually wants to support everything.

@KevinVandy, Given your original design goal of using only event.key, I can close this PR. Let me know if you'd prefer a different approach.

I'm just actually wondering if we should overhaul the matching system.

I appreciate you considering a bigger rethink! aiming for TanStack level quality means building something that truly empowers power users. I’d be excited to see (and help with) a more robust matching system if you decide to go that direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments