Skip to content

A DualShock 4 or DualSense touchpad click opens the menu as F1 - #1846

Merged
hckrman101 merged 1 commit into
NotRexed:mainfrom
nicholasgower:feat/touchpad-menu
Nov 10, 2026
Merged

hckrman101 merged 1 commit into
NotRexed:mainfrom
nicholasgower:feat/touchpad-menu

Conversation

@nicholasgower

@nicholasgower nicholasgower commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Clicking the touchpad on a DualShock 4 or DualSense did nothing, so a PlayStation pad could only open the menu with Home or Select and Start together. The touchpad is a button no Switch controller has, and its click is the natural menu key on those pads: it now does what F1 does.

What changed

  • host/pad_sdl.c reads SDL's touchpad button (button 20 in both SDL2's SDL_CONTROLLER_BUTTON_TOUCHPAD and SDL3's SDL_GAMEPAD_BUTTON_TOUCHPAD) and sets a new HOS_PAD_TOUCHPAD bit (gpu/vk/vk_api.h). The bit is past HOS_PAD_N, so it is not one of the inputs the Controls page can bind to a Switch button.
  • gpu/vk/vk_menu.cpp presses F1's slot (press[6]) on that bit: a click opens the menu while playing, and closes it again, exactly as F1 does. A click while the Controls page is listening for a new binding is ignored.
  • readme.md documents it under In-game menu.

Testing

  • New tests/test_touchpad_menu.py compiles the poll's button block from host/pad_sdl.c over a stand-in SDL and checks that only the touchpad click sets HOS_PAD_TOUCHPAD, that an ordinary button still sets its own bit, and that the bit is outside the bindable positions. It then checks vk_menu.cpp maps it to F1 (press[6]), not Insert/confirm/back, and masks it from the binding listener.
  • python -I -B tests/run_all.py locally: the new check and the menu and pad checks pass (test_touchpad_menu, test_menu_keys, test_stick_rest, test_bound_keys, test_rumble_*, test_hd_rumble, test_input_background). The full run's 11 failures on this PC are environment-only: no clang on PATH, no privilege to create symlinks (WinError 1314), and Python 3.14's \\?\ paths. CI on Linux with the tools installed is the real check.

Build

Rebased onto main (51de681) and built a complete game folder from the user's .nup with nx2/make_game.py: the compile, the hookshot.exe and hookshot_vk.dll links, and shader preparation all succeeded.

main itself does not link right now: #1720's merge left out the vk_replay.cpp half of present ahead, so mkwvk::present_commit and mkwvk::present_defer_into are undefined. Open PR #1858 is the pending fix. I applied that one commit to the working tree for this build only; it is not part of this PR, and the red Vulkan job here is that same main breakage.

Not tested

  • In the game with a real DualShock 4 or DualSense: there is no controller and no dump here. It needs a Windows or Linux run where SDL's HIDAPI driver sees the pad (the bundled SDL2.dll/sdl2-compat and SDL3 both support the button) to confirm the menu opens and closes on a click.
  • No screenshots: the change shows as the existing menu opening from a new input.

No issue links: there is no open issue for it in the repository.

@barrenechea

Copy link
Copy Markdown

I wonder if it shouldn't be the "PS" button in that case, rather than the touchpad click? Would be more "natural" as the guide button I think

@nicholasgower

Copy link
Copy Markdown
Contributor Author

I wonder if it shouldn't be the "PS" button in that case, rather than the touchpad click? Would be more "natural" as the guide button I think

One problem with this idea is that PCs often override the home button with other menus, whether it be Steam Big Picture or Xbox Game Bar. On Playstation controllers, the touchpad is the only button that isn't required for Switch inputs.

…as F1

The touchpad is a button no controller on the Switch has, so the menu
could only be opened from a PlayStation pad with Home or Select and Start
together. Clicking it now does what F1 does: it opens the menu and closes
it again.

SDL numbers the touchpad click 20 in both SDL2 (SDL_CONTROLLER_BUTTON_TOUCHPAD)
and SDL3 (SDL_GAMEPAD_BUTTON_TOUCHPAD), past the buttons pad_sdl.c reads for
the game. The poll sets HOS_PAD_TOUCHPAD from it, a bit past HOS_PAD_N so the
Controls page does not offer it as an input for a Switch button, and menu_tick
presses F1's press[6] with it. A click while a binding listens is ignored.

Tested with the new tests/test_touchpad_menu.py, which compiles the poll's
button block over a stand-in SDL and checks the menu's use, and with the rest
of tests/run_all.py. Not tested in the game: no DualShock 4 or DualSense and
no dump here.

Assisted-by: DeepSeek V4.1 Flash (opencode)
@nicholasgower

Copy link
Copy Markdown
Contributor Author

I've tested this myself, and I can confirm that it works.

@hckrman101
hckrman101 merged commit 907ec4e into NotRexed:main Nov 10, 2026
6 of 10 checks passed
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.

2 participants