Skip to content

Commit 0160bde

Browse files
kixelatedclaude
andauthored
Fix keyboard input handling in GameCard component (#1312)
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 985f9fe commit 0160bde

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

js/moq-boy/src/ui/components/GameCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ function GameCardInner() {
3232

3333
const onKeyDown = (e: KeyboardEvent) => {
3434
if (!isActive()) return;
35-
if (e.repeat) return;
3635

3736
const button = KEY_MAP[e.key];
3837
if (button) {
38+
e.preventDefault();
39+
if (e.repeat) return;
3940
game.heldButtons.add(button);
4041
game.sendButtons();
41-
e.preventDefault();
4242
} else if (e.key === "Escape" && ctx.expanded()) {
4343
game.expanded.set(undefined);
4444
e.preventDefault();

0 commit comments

Comments
 (0)