Repository navigation
手柄:一代 / 二代 Joy-Con 拆合与颜色、P1–P8 玩家灯同步、独立四键布局(含任天堂手柄)与启动器即时生效、开发用模拟手柄 - #1759
Merged
jhaizhou-ops merged 2 commits intoNov 20, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Open
Owner
|
nevenhsu 谢谢这支,内容很扎实:为了在没有实体一代 Joy-Con 的情况下也能调试,专门做了模拟手柄工具(只在本机构建里出现);修了多套一代 Joy-Con 重排或单只重连后玩家位错位、Joy-Con 2 断一只重连和跨重启首次不自动合并的问题;还有 P1–P8 玩家灯同步。 有一处想先和你对一下:「四键布局只给非 Switch 手柄」。刚发布的 v0.6.0 里,我们特意让 Mac 上的任天堂手柄(Switch Pro、Joy-Con 等)也能选「Xbox 位置布局」(下键确认、右键取消),和 iPhone 上一致,这一条也写进了发版说明。照这支的改法,任天堂手柄就选不了这个布局了。如果你的本意是界面上别让人误会,可以考虑保留这个选项、只把说明写清楚;具体由负责的维护者评审时一起定。 已经转给负责 Mac 启动器和手柄的维护者,按正常节奏评审。有问题会在这里提。 |
nevenhsu
marked this pull request as draft
November 20, 2026 12:23
nevenhsu
marked this pull request as ready for review
November 20, 2026 12:44
Contributor
Author
|
感谢反馈!已按建议补充调整(提交
相关单测( |
Owner
|
nevenhsu 谢谢,改得很周到:任天堂手柄的四键布局入口留下了,而且和非任天堂手柄分开配置;顺手修好了改完布局后启动器里导航和底栏提示不即时生效的问题,单测也补齐了。已经转告负责的维护者,按正常节奏评审。 |
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.
背景与问题
LauncherPadInput.swift将任天堂手柄(含 Switch 2 直连通道relay.buttons)写死为.identity,导致修改任天堂手柄四键布局后在启动器内未即时生效。主要改动
PlayerAssignment.swift、Gen1HIDWatcher.swift、NS2LauncherController.swift):sideways)不再持久化到偏好,重开 App 后首次连上照常自动合并。Gen1HIDWatcher.swift、ControllerIcon.swift、SystemControllers.swift):0x10读取 SPI0x6050出厂机身与按键颜色并在面板图示中渲染。PlayerAssignment.swift、Gen1HIDWatcher.swift、SystemControllers.swift、NS2Transport.m、ns2_connection_helper.m、Switch2ProConnectionPopover.swift):0x30)与 Joy-Con 2 / Pro 2(BLEns2_set_player_lights)完整支持 P1–P8 四灯位图;系统手柄通过GCController.playerIndex同步(受 macOSGCControllerPlayerIndex枚举限制为 P1–P4,面板 UI 仍完整显示 P1–P8)。Switch2ProConnectionPopover.swift、ControllerFaceMappingEditor.swift、LauncherPadInput.swift、LauncherPadNavigation.swift、l10n/*.json):nintendo配置,不与其他手柄共用:LauncherPadInput.swift对任天堂手柄与 Switch 2relay.buttons写死.identity的缺陷,使任天堂手柄修改四键布局后在启动器导航与底栏按键提示中立即生效。ControllerColorSimulator.swift、S2ArmUpdateMenu.swift、LauncherView.swift、launchers/macos/README.md):SUFeedURL的本机 / 自测构建中且执行defaults write <bundle id> S2AControllerSimulate -bool YES后,App 菜单才出现「模拟手柄」浮动面板;带SUFeedURL的正式发行版菜单中不会显示。launchers/macos/README.md写明开启与关闭方式。实际验证
launchers/macos/frontend:ControllerFaceMappingTests(9/9 通过,含新增的任天堂手柄启动器即时生效测试)、ControllerPopoverLayoutTests(5/5 通过,含新增的系统/专用通道任天堂手柄独立四键浮层测试)、ControllerAcceptanceGen1Tests(2/2)、ControllerAssignNavigationTests(4/4)。launchers/macos:NS2PanelSnapshotTests(7/7 通过)、bash tests/macos_native_input_test.sh全量通过。自检(tools/contrib_check.sh,第一层)
3bd642e68(基线891339343,upstream/main)已跑全量full档位(43 步绿 39、红 3 经CONTRIB_BASE_RERUN=1确认与基线逐项相同,新红 0 步);本次追加e897a60f5仅改动 Mac 启动器前端 6 个 Swift/文档文件,相关单测与macos_native_input_test.sh均已全量通过。