Repository navigation
Controls: one-click controller layouts, and Auto picks one for the controller - #84
Merged
Merged
Conversation
…ntroller (LNPANDY#70) The Controls page had only the per-button choice, so playing with an Xbox or a Nintendo controller by its printed letters took four changes by hand. It now has a layout, each one only a DM_PAD_MAP value (the host is unchanged): - Standard layout, the default: nothing passed. The host reads the face buttons by position in the Nintendo layout (front_mac.m pad_read); for PlayStation and other controllers. - By label: A=B,B=A,X=Y,Y=X. GameController reports both families by their letters: an Xbox controller's are Apple's diamond, and a real Pro Controller's A, on the right, arrives as buttonA (seedds/nxnative#382). The host's positional reading turns each into the other letter, so one swap serves both, and for a Nintendo controller it is also its position. - Custom: the buttons chosen by hand. Changing a button switches to it, starting from what the buttons sent in the layout before. - Auto: By label or Standard from GCController.productCategory of the controller connected at Play (Nintendo, Switch Pro, Joy-Con/JoyCon or Xbox in the name). The note says the limit: one map for every controller, so two kinds at once cannot both be right; a per-controller choice belongs in the host (LNPANDY#382). The page shows the connected controller and what Auto picks for it, following connects and disconnects. The layout is stored with the rest of the controls; settings saved before it load as Custom when they had buttons set, else Standard. A preset counts as one change in Settings. The tests check each layout's DM_PAD_MAP, Auto's choice for stand-in categories, an edit switching to Custom, old saved settings, and the swap played through the host's reading for both families; a mutation of the swap fails them. swift build -c release is clean, swift test passes (55, 3 skipped), and the visual QA renders the page scrolled to the layout by the controller's focus, Auto with a stand-in Xbox controller and By label with none. Not checked with a real controller.
v0lumehi
force-pushed
the
feat-70-control-presets
branch
from
October 27, 2026 16:46
8253794 to
9b814c4
Compare
LNPANDY
added a commit
that referenced
this pull request
Oct 27, 2026
…nostics and Saves captures The three visual-QA blocks share one test method; the splice dropped the controller block's do-close, which the compiler placed at end of file (969:1 expected '}' in class).
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.
Closes #70.
Settings → Controls has a Button layout picker with the modes from the discussion in #70. Each mode is only a value of
DM_PAD_MAP, so there is no engine change.DM_PAD_MAPA=B,B=A,X=Y,Y=XGCController.productCategoryThe page shows which controller is connected and what Auto would pick, and updates when controllers come and go. Saved settings from before load as Custom if they had buttons changed, otherwise as Standard.
Why one swap fits both families:
buttonA…buttonYby position (front_mac.m,pad_read).buttonA, as tested in Mac controllers: a radial stick dead zone, value handlers off the main queue, and Nintendo face buttons by name seedds/nxnative#382) and Xbox controllers by their printed letters.Limit, said in the UI: the launcher passes one map for every controller. Auto picks from the controller connected when you press Play, and two different kinds at once can't both be right. A per-controller choice belongs in the host (seedds/nxnative#382).
The layout is stored with the rest of the controls, which apply to every game.
Checked:
swift build -c releaseclean,swift test: 55 pass (3 skipped). The 5 new tests cover each mode's value, Auto per product category (stand-in strings), switching to Custom, and older saved settings.Ideas from seedds/nxnative#102, #180, #295 and #382, and @Nishikori-Yui's structure in #70.