Hotkey Recorder records wrong key format
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start at the createHotkeyRecorder entry point and compare how keyboard events produce Shift+1 versus Shift+!. Check the related validateHotkey behavior shown in the report, then reproduce the recorder example in Svelte. Done means recorded Shift+1 and Option+1 preserve their physical key format instead of becoming shifted symbols.
Written by the indexing model from the issue text.
Description
TanStack Hotkeys version
0.7.1
Framework/Library version
Svelte 0.9.1
Describe the bug and the steps to reproduce it
When using createHotkeyRecorder, the recorded hotkey is using the wrong format.
When I record a Shift+1 hotkey, it captures a Shift+! instead. Same happens for the option key; Option+1 captures ⌥ ¡.
Using the validateHotkey function, validateHotkey('Shift+1') is valid and has no errors and warnings, but validateHotkey('Shift+!') has this warning: "Unknown key: '!'. This may still work but won't have type-safe autocomplete."
Expectation
Recording Shift+1 should return Shift+1, not Shift+!
Code
<script lang="ts">
import { createHotkeyRecorder, formatForDisplay, validateHotkey } from '@tanstack/svelte-hotkeys';
const recorder = createHotkeyRecorder({
onRecord: (hotkey) => {
console.log({
hotkey,
recorded: recorder.recordedHotkey,
formatForDisplay: formatForDisplay(hotkey),
});
},
});
console.log('validateHotkey("Shift+1")', validateHotkey('Shift+1'));
console.log('validateHotkey("Shift+!")', validateHotkey('Shift+!'));
</script>
<button
onclick={() => {
recorder.startRecording();
}}
>
Record
</button>
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
Screenshots or Videos (Optional)
https://github.com/user-attachments/assets/2097c392-1c24-4586-8656-9ab5d1e9fa7a
Do you intend to try to help solve this bug with your own PR?
No, because I do not have time to dig into it
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
- Dominant language
- TypeScript
- Stars
- 738
- Forks
- 48
- Avg merge
- 16h 23m
- Merged PRs (30d)
- 11
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from TanStack/hotkeys
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
ignoreInput isn't detected across realmsPossibly taken @wojtowicz-artur claimed this 84 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
TanStack/hotkeys#105 · 2 comments ·
Maintainers usually reply within 1 day
-
`useKeyHold` / `KeyStateTracker` latches a modifier forever when a `keyup` is swallowed without a `blur` (e.g. macOS Cmd+Shift+4)Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 50/100
TanStack/hotkeys#143 · 1 reaction ·
Maintainers usually reply within 1 day
-
'Space'-shortcut overrides native behavior triggering focused elementsPossibly taken @KevinVandy claimed this 13 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 56/100
TanStack/hotkeys#142 · 1 comment ·
Maintainers usually reply within 1 day
All issues in TanStack/hotkeys
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NousResearch/hermes-agent#136483 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
factory-active factory-automatic task-bug-reproduction-success task-identify-harness-labels-done task-identify-issue-type-done
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
vercel/ai#22796 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug]: Web chat input doesn't regain focus after a reply finishesPossibly taken @GaijinSystems claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
zeroclaw-labs/zeroclaw#11658 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
babylonlabs-io/babylon-toolkit#2711 ·
Maintainers usually reply within 1 day