Skip to content

feat(controller): a pointer on the left stick, clicks with A, the wheel on the right stick - #103

Open
lippdev wants to merge 1 commit into
fix/controller-navigationfrom
feat/pad-pointer
Open

lippdev wants to merge 1 commit into
fix/controller-navigationfrom
feat/pad-pointer

Conversation

@lippdev

@lippdev lippdev commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Stacked on #101 (controller navigation).

Summary

  • Left stick → the browser's pointer on any page. It is a blue ring with a white edge and a dot (the click spot), drawn by spatial.js in its isolated world, so it never passes for the system mouse. Movement uses the existing deadzone and response curve (stickToVelocity).
  • A at the pointer gives a left click (real mouse events at that spot, so hover and click behave like a mouse). A twice within 280 ms (DOUBLE_PRESS_MS) gives a right click, so a single press waits that long. Each click briefly squeezes the ring.
  • The last one used wins: moving the stick hands A to the pointer. Pressing the D-pad hides the pointer and A presses the focused item again.
  • Right stick → the wheel, vertical and sideways, under the pointer (or mid-page before the pointer was ever shown).
  • Arrows mode (YouTube TV, Twitch) keeps the stick on the arrow keys its sites expect. The keyboard, dialogs and the toolbar keep taking the stick as a D-pad. The R3 Cursor mode is unchanged.

Test plan

  • npm run typecheck
  • npm test (118 passed)
  • npm run test:e2e (58 passed, 3 skipped). The new controller.spec.ts test covers: the stick shows the pointer, A gives a left click, A A gives a right click with no extra left click, the D-pad hides the pointer and A presses the focused button, and the right stick scrolls
  • Screenshot of the pointer over Wikipedia
  • Physical controller on the TV (docs/CONTROLLER-TEST.md scenario 7), especially the pointer speed from the sofa

🤖 Generated with Claude Code

…el on the right stick

- The left stick moves the browser's own pointer over any page (a blue
  ring with a dot, so it never passes for the system mouse). A clicks
  where it points; A twice within 280 ms is a right click, so a single
  press waits that long. Each click squeezes the ring.
- The last one used wins: the stick hands A to the pointer, the D-pad
  takes it back for the focused item and hides the pointer.
- The right stick scrolls, up and down and sideways, under the pointer
  (or the middle of the page before the pointer was ever shown).
- Arrows mode (YouTube TV, Twitch) keeps the stick on the arrow keys its
  sites are built for; the keyboard, dialogs and the toolbar still take
  the stick as a D-pad.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant