Skip to content

Add experimental Xbox gamepad test controls#20

Draft
maxiwoj wants to merge 3 commits intomainfrom
codex/add-gamepad-emulation-feature-for-xbox
Draft

Add experimental Xbox gamepad test controls#20
maxiwoj wants to merge 3 commits intomainfrom
codex/add-gamepad-emulation-feature-for-xbox

Conversation

@maxiwoj
Copy link
Copy Markdown
Owner

@maxiwoj maxiwoj commented Mar 10, 2026

Motivation

  • Provide a very small, low-risk way to validate whether the ESP32-S3 build environment and attached hardware can present a gamepad to an Xbox/PC before investing in full gamepad macro support.

Description

  • Add compile-time detection for USBHIDGamepad and a GAMEPAD_SUPPORTED flag, and instantiate/initialize a Gamepad device when available in esp32-s3/hid_handler.cpp.
  • Implement a minimal helper pressGamepadButton() and a new command handler GAMEPAD_TEST:<A|B|X|Y> in processHIDCommand() to send a short tap for A/B/X/Y buttons and report status via Serial; STATUS now reports gamepad availability.
  • Add a simple UI card in esp32-s3/data/www/index.html with A/B/X/Y buttons and a testGamepadButton() implementation in esp32-s3/data/www/script.js that uses the existing /api/command pipeline to trigger tests.
  • Document the test command in docs/API.md and note the experimental feature in esp32-s3/README.md.

Testing

  • Ran targeted code checks using rg to verify the new GAMEPAD_TEST references and UI changes, which reported the expected matches (success).
  • Ran git diff --check style/consistency checks to ensure no trailing errors (success).
  • Served the updated web UI via python3 -m http.server and captured a browser screenshot with Playwright to validate the new Gamepad Test card renders correctly (screenshot generated successfully).
  • Exercised the new API path locally by sending GAMEPAD_TEST commands through the existing /api/command flow in the UI (commands are emitted to Serial; runtime HID availability depends on the installed ESP32 core and will log an error if USBHIDGamepad is not present).

Codex Task

@maxiwoj maxiwoj marked this pull request as draft April 3, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant