Repository navigation
Bind Pointer actions like Keyboard and Gamepad, and group devices in Controls - #63
Merged
Merged
Conversation
…Controls Pointer.actions(target, blurHost, bindings) reports bound actions, raw buttons (with back and forward), position, and used, with rebind and parseRebinding, so the mouse merges into Controls. actions.group makes devices used together (keyboard and mouse) one merge entry for lastUsed and available, with devices and rebind keyed by device name. Gamepad and Pointer share one button tracker. The top-down integration groups a mouse click with the keyboard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SandroMaglione
added a commit
that referenced
this pull request
Oct 23, 2026
…demo main (#63) groups devices in Controls: the top-down controls now take a keyboard, a mouse, and a gamepad. The browser host binds Pointer actions on its canvas, and the devtools page's scripted run passes a scripted mouse. Co-Authored-By: Claude Opus 5.5 <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.
Why
Pointerwas the only device without bindings,actionsorused, so it couldn't join aControlsmerge. Merging the mouse as a separate device would also makelastUsedandavailableflicker while the player walks with the keyboard and aims with the mouse.What
Pointer
Pointer.actions(target, blurHost, bindings, options?)replacestrack. The snapshot is{ actions, buttons, position, over, used }.backandforwardbuttons are added, withPointer.buttonNamesandisButton.rebindandparseRebindingwork as on Keyboard and Gamepad.idle,scriptedandrecordingnow take the bindings first. Timelines still name buttons.Controls
actions.group({ keyboard, mouse })makes one merge entry. Its bindings are the union of its devices' bindings, andlastUsedandavailablefollow the group as a whole.devices,rebindandidlestay keyed by device name;lastUseduses the group name.lacking(group(...), [...])covers actions none of the grouped devices binds.lackingdevice inside a group;Internal and integration
internal/buttons.ts): the same press, rebind and parse rules.integration/top-downgroups a mouse click (interact) with the keyboard. A test collects a pickup by clicking while walking, withlastUsedstaying ondesktop.Pointer.Actionsrename.Checks
pnpm run check(632 tests, with type tests for every error above)pnpm pack:checkpnpm bench --compareagainst main: no blocking regressions. Type metrics are unchanged; the benches don't cover the browser package.🤖 Generated with Claude Code