feat(hotkeys): add numpad key support#28
feat(hotkeys): add numpad key support#28MohammedALjaberi wants to merge 2 commits intoTanStack:mainfrom
Conversation
@tanstack/hotkeys
@tanstack/hotkeys-devtools
@tanstack/react-hotkeys
@tanstack/react-hotkeys-devtools
@tanstack/solid-hotkeys
@tanstack/solid-hotkeys-devtools
commit: |
953305a to
513d22c
Compare
f2ae091 to
b93986d
Compare
|
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. |
Summary
Add type-safe support for numpad keys, enabling autocomplete for shortcuts like
Mod+Numpad1orNumpadEnter.🎯 Changes
NumpadKeytype with 16 numpad keys:Numpad0-Numpad9,NumpadAdd,NumpadSubtract,NumpadMultiply,NumpadDivide,NumpadDecimal,NumpadEnterNUMPAD_KEYSconstant set for validationALL_KEYSunionNumpadKeytoNonPunctuationKeyfor proper Shift combination typingUse Cases
✅ Checklist
pnpm run test:pr.🚀 Release Impact