Repository navigation
Hold mouse buttons with drive --key mouse0:<ms> - #2003
Merged
Merged
Conversation
--key sent mouse0 as a keyboard code, which nothing reads, so a playtest could not fire Scrap Signal's hold-to-fire guns; only --click-at fired, one round per click. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RwsemkhoUGyeQkdkKFmUmw
Noisemaker111
enabled auto-merge
October 20, 2026 15:11
Owner
Author
|
Generated by Claude Code |
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.
A Scrap Signal playtest couldn't fire its hold-to-fire guns:
drive --key mouse0:1200sentmouse0as a keyboard code, which nothing reads. Only--click-atfired, one round per click.templates/gameSurfaceFocus.ts:mouseButtonForCodemaps the shell's pointer binding codes (mouse0/mouse1/mouse2) to the CDP button andbuttonsmask;gameSurfaceCenterreturns the play canvas centre. Both are self-contained, so they embed intodrive.mjslike the existing helpers.holdKeyin the drive template: a mouse code moves to the canvas centre, presses, waits with the same duration-plus-one-frame rule as key holds, then releases. Keyboard codes are unchanged. Usage text and the scaffold's agent notes mention it;changes/drive-mouse-hold.md.Verification
bun test packages/jgengine/src/templates packages/jgengine/src/driveNative.test.ts— 61 pass, 0 fail (5 new, including a serialization round-trip);check-types— pass;bun run gen— ok;ship:preflight— ok--click "GUNK" --wait 30000 --key mouse0:8000took the pistol from 12 to 11 rounds. Headless runs at about 0.2 fps, so one shot fits in the hold.Generated by Claude Code