Repository navigation
ESP32: a USB gamepad's bumpers switch weapons, its d-pad picks and uses Force powers - #7
Merged
Merged
Conversation
…es Force powers There was no way to change weapons or use a Force power from a USB gamepad on the Tab5. ESP32 used the homebrew joystick defaults, whose L/R binds (next item / next weapon on B10 / B11) were never fed by stdControl_ReadControls, and the joystick hat was held at 0. - sithControl_MapDefaultsJoystick: an ESP32 branch with the desktop layout for a USB gamepad. B10 / B11 (L1 / R1) = previous / next weapon; the hat (its d-pad) left / right = previous / next Force power, up = use it (held). The touch pad keeps B1-B4 and Select keeps B7, as on the other homebrew ports. - stdControl_ReadControls feeds B10 / B11 from bits 10 / 11 of joy_buttons (tab5-emu puts L1 / R1 alone there, once the pad has shown it has triggers to fire with). It feeds the hat in play from the new jk_esp_input_t.dpad, the d-pad alone; JK's menus already navigate with the d-pad as keys, so they don't get the hat too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
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 USB gamepad can switch weapons and use Force powers
There was no way to change weapons or use a Force power from a USB gamepad on the Tab5. ESP32 took the homebrew joystick defaults (
sithControl_MapDefaultsJoystick). Their L/R binds, next item and next weapon on B10/B11, were never fed bystdControl_ReadControls, and the joystick hat was held at 0.sithControl_MapDefaultsJoystick: a newTARGET_ESP32branch, placed ahead of the homebrew one, with the desktop layout for a USB gamepad:INPUT_FUNC_USESKILL;stdControl_ReadControls(ESP32):joy_buttons, where tab5-emu puts L1/R1 alone once the pad has shown it has triggers to fire with;jk_esp_input_t.dpad, the d-pad alone. JK's menus already navigate with the d-pad as keys, so they don't get the hat too.Testing (Tab5, with esp-cpp/tab5-emu#42)
A temporary test hook injected each press through the host's input path in level 1, with all weapons and the light Force powers given by cheats:
Fire on R2/L2 and the face buttons are unchanged (#6). On real hardware (a Backbone Pro), the bumpers and Force controls were tried by hand: everything worked except the d-pad, which needed the tab5-emu side to read its d-pad usages (no hat switch). That is fixed in the tab5-emu PR.
🤖 Generated with Claude Code
https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY