Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Hotkey Recorder records wrong key format

クローズ
#104 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TanStack/hotkeys のほかの issue

TanStack/hotkeys の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。