Skip to content

Controller navigation across the launcher (#38) - #56

Merged
LNPANDY merged 3 commits into
LNPANDY:mainfrom
v0lumehi:pr-38-controller
Oct 27, 2026
Merged

LNPANDY merged 3 commits into
LNPANDY:mainfrom
v0lumehi:pr-38-controller

Conversation

@v0lumehi

@v0lumehi v0lumehi commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #38. Builds on #55, which builds on #54. Until those merge this PR shows their commits too. The change here is the last commit.

What a controller does

A game controller moves a focus through the library, Settings, the launch options and the Controls sheet.

Input Action
D-pad or left stick Moves to the nearest control in that direction; repeats while held
A Activates the control
Left / right on a value Changes the value (choice, slider, switch, language, a controller button's mapping)
L / R Switches pages
X Opens the selected game's launch options
B Closes a sheet or goes back
  • Button names: by position, as the game names them (front_mac.m): A on the right, B at the bottom.
  • Collection: moving onto a game's card selects it and scrolls it into view. The sheets and Settings scroll to keep the focus visible.
  • Hint: while a controller is connected, a line at the bottom of the library names the buttons.

Your correctness constraint

Input counts only while the launcher is the active app. GameController sends a controller's input to the app in front, so once a game the launcher started is in front, the launcher gets no input and cannot act behind it.

How it works

  • Own focus model: macOS gives SwiftUI controls keyboard focus only when Full Keyboard Access is on, so the focus is the launcher's own (PadFocus). Each reachable control reports its frame within its scope: the window, or one sheet.
  • Movement: left and right stay in the row; up and down prefer the same column.
  • Ring: the cream ring appears only after a controller has been used, so mouse users never see it. The collection row keeps room for it at its edges.
  • Not covered: the Builds page. Choosing the game files needs the Finder anyway.

Checked

  • swift test: 29 tests pass.
  • PadFocusTests covers the default focus, moves within a row and between rows, values on left/right, and that a new scope starts without a focus.
  • The visual QA capture renders the sheet with the focus shown.
  • Reviewed in the running Mac app (a preview build with all four PRs).
Focus in Launch options The library with a controller connected

…tings (LNPANDY#37)

The sheet listed every row of the app's launcher.json in one column of
sections (Game, Controls, Performance), so the settings a player changes
most sat among the ones only a tuning session needs. The basic ones come
first now, in their sections: frame rate, render scale, console mode,
language and rumble. The rest is behind an Advanced settings row that
says how many it holds and opens them in place.

Which rows are basic comes from the list when it says so (a row's level,
seedds/nxnative#399: settings.tsv's optional level column), else from
the launcher's own list of those five. Apps packed before the column
show the same split.

LaunchOptionsTests: the default split, and a level in launcher.json
winning over it.
, LNPANDY#36)

LNPANDY#35 Display mode: Window or Fullscreen for a Mac game, under the render
scale. The host starts fullscreen when DM_FULLSCREEN is set at all
(front_mac.m), so Window leaves the variable out instead of setting it
empty. A list from settings.tsv will carry the row once it has a
platform condition (seedds/nxnative#352); until then the launcher adds it
to a list that has none.

LNPANDY#36 Render scale in pixels: with the game's base size, the row shows
0.75 as 1200x675 and says what it is a share of ("75% of 1600x900
docked"), for the console mode chosen (1280x720 handheld for Breath of
the Wild). The base size comes from the row's base (seedds/nxnative#399:
a profile's render_base, written by settings.py), else from the game's
profile in the repository, so apps packed before still show pixels. A
game without one keeps the percentage. Play goes through the same list,
so Display mode reaches the app.

LaunchOptionsTests: Display mode's place and its unset Window, the
pixels docked and handheld from the profile, and the percentage without
a base size.
A Mac on a TV needs no keyboard now. A game controller moves a focus
through the library, Settings and both sheets: the D-pad or left stick
goes to the nearest control in that direction (held, it repeats), A
activates it, and on a control that holds a value (a choice, a slider, a
switch, the language, a controller button's mapping) left and right
change the value. L and R switch the pages, X opens the selected game's
launch options, B closes a sheet or goes back. The buttons are named by
position, as the game names them (front_mac.m): A on the right, B at the
bottom. Moving onto a game's card selects it and scrolls it into view;
the sheets and Settings scroll to the focus. A hint at the bottom of the
library names the buttons while a controller is connected.

macOS gives SwiftUI controls keyboard focus only with Full Keyboard
Access on, so the focus is the launcher's own (PadFocus): each control a
controller can reach reports its frame in its scope (the window or one
sheet). Left and right stay in the row; up and down prefer the same
column. The cream ring shows only after a controller was used, so mouse
users never see it, and the collection row keeps room for it at its
edges. Input counts only while the launcher is the active app:
GameController gives a controller to the app in front, so the launcher
never acts behind a game it started. The Builds page is left out:
choosing the game files needs the Finder anyway.

PadFocusTests: the default focus, moves in a row and between rows, values
on left / right, and a new scope starting without a focus; the visual QA
renders the sheet with the focus shown.
@LNPANDY
LNPANDY merged commit 8ccce07 into LNPANDY:main Oct 27, 2026
@v0lumehi
v0lumehi deleted the pr-38-controller branch November 1, 2026 05:10
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.

Library: controller navigation (play from the couch without a keyboard)

2 participants