Skip to content

Restore gamepad-to-UI input visualization in base station web controls#85

Merged
dorkmo merged 3 commits into
mainfrom
copilot/fix-gamepad-input-visuals
May 29, 2026
Merged

Restore gamepad-to-UI input visualization in base station web controls#85
dorkmo merged 3 commits into
mainfrom
copilot/fix-gamepad-input-visuals

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 29, 2026

The web UI detected connected gamepads but did not reflect live axis/button input on virtual controls, leaving operators without visual feedback during gamepad operation. This change aligns virtual joystick/button visuals with the same gamepad state already driving control payloads.

  • Virtual joystick rendering now mirrors gamepad axes

    • Added pad visual sync helpers in web/app.js to project state.lhx/lhy/rhx/rhy onto the left/right joystick canvases.
    • Gamepad poll path now updates pad visuals each cycle.
    • Pad visuals are explicitly reset on disconnect and when controls are locked.
  • Virtual button strip now mirrors active control bits

    • Added button visual sync logic that toggles .active on each button[data-btn] using the current control bitmask.
    • Visual state is refreshed for gamepad-driven input and on-screen pointer input, so combined gamepad + screen input remains correctly represented.
  • UI styling for active virtual control buttons

    • Added .active styles for data-btn buttons in web/index.html (top bar + settings drawer) to make pressed states visible.
function syncButtonVisuals(mask) {
  buttonVisuals.forEach(({ el, maskBit }) => {
    el.classList.toggle('active', !!(mask & maskBit));
  });
}

// Gamepad path
state.buttons = (buttons | screenButtons) & 0xFFFF;
syncButtonVisuals(state.buttons);

Copilot AI linked an issue May 29, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix gamepad inputs not showing up on website screen Restore gamepad-to-UI input visualization in base station web controls May 29, 2026
Copilot finished work on behalf of dorkmo May 29, 2026 20:23
Copilot AI requested a review from dorkmo May 29, 2026 20:23
@dorkmo dorkmo marked this pull request as ready for review May 29, 2026 20:33
Copilot AI review requested due to automatic review settings May 29, 2026 20:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restores live visual feedback on the base-station web UI's virtual joysticks and button strip so they mirror the gamepad state already being transmitted, plus adds CSS for the new .active button state.

Changes:

  • Add syncPadVisuals() / setFromAxes() so on-screen pads echo state.lhx/lhy/rhx/rhy from the gamepad poll, and reset on disconnect / lock.
  • Add syncButtonVisuals() to toggle .active on button[data-btn] from the current button bitmask, refreshed by both gamepad and pointer paths.
  • Add .active styling for data-btn buttons in the top bar and settings drawer.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
LifeTrac-v25/DESIGN-CONTROLLER/base_station/web/app.js Adds pad/button visual-sync helpers and wires them into gamepad poll, disconnect, lock, and pointer paths.
LifeTrac-v25/DESIGN-CONTROLLER/base_station/web/index.html Adds CSS for .active state on virtual control buttons.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dorkmo dorkmo merged commit 34432d2 into main May 29, 2026
1 check passed
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.

Gamepad inputs not showing up on website screen.

3 participants