Hotkey Recorder records wrong key format
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 52/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- typescript
- 領域
- frontend
調査の方向性
createHotkeyRecorder のエントリーポイントから始め、キーボードイベントが Shift+1 と Shift+! をどのように生成するかを比較します。レポートに示されている validateHotkey の関連する動作を確認し、recorder の例を Svelte で再現します。記録された Shift+1 と Option+1 がシフト後の記号に変換されず、物理キー形式を保持すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 744
- フォーク
- 49
- 平均マージ
- 1日 16時間
- マージ済み PR(30日)
- 30
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/hotkeys のほかの issue
-
Dependency Dashboardオープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
TanStack/hotkeys の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
auth: agent-bearer --manager-call is told to use the MCP instance argument on an ambiguous managerオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
bug module: playback
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
chthollyphile/folia-major#739 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
agilepathway/label-checker#773 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信