fix: 1G 入力時のフリーズバグを修正#29
Merged
mskasa merged 1 commit intoebitenginefrom Apr 2, 2026
Merged
Conversation
G キーが Shift より 1 フレーム先に検出されると prevG=true がセットされ、 次フレームで Shift+G を押しても !shift 条件が合わず prevG が永久に解除 されなかった。IsKeyPressed で G が押し続けられている状態を確認することで このタイミング問題を解消する。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
原因
prevGフラグ(gキー入力後の待機状態)が解除されずにフリーズする問題を修正。再現パス
1を押す →inputNum=1に蓄積G(Shift+G)を押す際、G キーが Shift より 1 フレーム先に検出されるgとして検出 →prevG=true!shift && IsKeyJustPressed(G)が false →CmdNone、prevGは true のまま修正内容
prevG モード内で
shift && ebiten.IsKeyPressed(KeyG)(G が押し続けられていて Shift も押されている)を検出した場合にprevGを解除してCmdFileBottomを返すようにした。IsKeyJustPressedではなくIsKeyPressedを使うことで、G を押したまま Shift を追加で押すタイミングのずれに対応している。Test plan
1Gを入力してフリーズしないことを確認G(カウントなし)が最終行に移動することを確認ggが最初の行に移動することを確認geが前のワード末尾に移動することを確認🤖 Generated with Claude Code