Skip to content

host/input: add a setting to press face buttons by their letters - #3018

Closed
suuperior wants to merge 1 commit into
seedds:mainfrom
suuperior:host-pad-letters
Closed

suuperior wants to merge 1 commit into
seedds:mainfrom
suuperior:host-pad-letters

Conversation

@suuperior

Copy link
Copy Markdown

What and why

An Xbox controller's face buttons are mapped by position, as on the console: its bottom button, printed A, presses the Switch's B. A player used to the Xbox letters presses A to confirm and goes back instead. This adds Face buttons by letter (DM_PAD_LETTERS), a Controls setting, off by default, that maps every pad by its letters, as a Nintendo pad already is (pad_apple.h). With it off nothing changes.

Checked

  • Tests: t_pad_apple (both mappings, every pad category); the test_settings, test_launcher_settings, test_env_switches, test_player_env and test_docs tool tests. Removing the new row from docs/env_switches.tsv makes test_env_switches fail, as it should.
  • The Mac host builds (make -C dm/host, Civilization VI's profile) with no new warnings.
  • Devices and OS: MacBook Air (M5), macOS 27.2.1. The same mapping, carried as a local patch, has been used with an Xbox Wireless Controller since 2026-11-15.
  • Not checked: the iOS build, which CI makes. scripts/regress.py was not run: the change is input only, and with the setting off the code path is the one on main.

Front ends

Front-ends: new: DM_PAD_LETTERS, a toggle in the settings list's Controls section

Docs

  • docs/settings.md (a section and its row in the file table), docs/env_switches.tsv, docs/development.md.
  • No game files, keys or data extracted from a game in the change or the attachments

🤖 Generated with Claude Code

An Xbox controller's face buttons are mapped by position, as on the
console: its bottom button, printed A, presses the Switch's B, and its
right button, printed B, presses A. That keeps the console's layout, but
a player used to the Xbox letters presses A to confirm and goes back
instead. pad_apple.h already maps a Nintendo pad name for name.
DM_PAD_LETTERS=1, Face buttons by letter in the Controls section and off
by default, maps every pad that way, since GameController's buttonA to
buttonY are an Xbox pad's printed letters. With it off nothing changes.

The Mac front end and the iOS gamepad read it at start beside
DM_PAD_PRESS_TO_JOIN and log it when on. t_pad_apple checks both
mappings for every pad category. The settings list, docs/settings.md,
docs/env_switches.tsv and docs/development.md name it.

Checked: t_pad_apple, the Mac host build, and the settings, launcher
settings, environment switch, player environment and docs tool tests.
The same mapping, carried as a local patch, has been used with an Xbox
Wireless Controller on a MacBook Air (M5) since 2026-11-15. Not checked:
the iOS build, which CI makes, and regress.py, since the change is input
only and the default path is unchanged.

Front-ends: new: DM_PAD_LETTERS, a toggle in the settings list's Controls section
@github-actions github-actions Bot added host The Horizon host: SVCs, services, threads, memory (dm/host) ios The iPhone and iPad app (dm/ios) mac The Mac front end and app (dm/mac, front_mac.m) docs Documentation labels Nov 19, 2026
@suuperior

Copy link
Copy Markdown
Author

The four failing checks fail the same way on main at a4c8297, the commit this is based on (tests run 44465099205, lint-c run 44465099267):

  • Host unit tests and Sanitizers: t_codec_video.c:111, vt_session_lifecycle's assertion (a->vs && !a->soft)
  • Tool tests: test_nro_pack (2 != 1) and test_shader_toolchain_cache (3 errors)
  • clang-tidy (ratchet): one NullablePassedToNonnull in dm/gfx/tests/t_upload_idle.m

That assertion stopped both host jobs before t_pad_apple ran. It passes here with the CI flags (-O1 -g -fobjc-arc -Wall -Werror), and again with -fsanitize=address,undefined.

@gnavarro24

Copy link
Copy Markdown
Contributor

Hi! This branch is based on a main from before commit c70c242 ("ci: repair host and tool test failures on main"). Most of the failing checks here (Host unit tests, Tool tests, clang-tidy, Build check) come from that older base, not from this change.

To pick up the fix, merge the current main into this branch and push:

git fetch origin
git merge origin/main
git push

If the merge has conflicts, ask here if you want help with them.

@seedds

seedds commented Nov 28, 2026

Copy link
Copy Markdown
Owner

Thanks for putting this together and testing it with an Xbox Wireless Controller, @suuperior.

PR #3387 now carries the same opt-in DM_PAD_LETTERS setting across GameController pads (Mac and iOS) as well as raw HID pads and the Steam Controller, while this branch is narrower and currently conflicts with main. We'll keep your positional-vs-letter usability example in mind as #3387 is reviewed.

Closing this PR as superseded by #3387.

@seedds seedds closed this Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation host The Horizon host: SVCs, services, threads, memory (dm/host) ios The iPhone and iPad app (dm/ios) mac The Mac front end and app (dm/mac, front_mac.m)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants