Skip to content

feat(input): a DualShock 4 or DualSense touchpad click can be bound in Controls - #2989

Open
jarynclouatre wants to merge 1 commit into
NotRexed:mainfrom
jarynclouatre:feat/bind-touchpad-click
Open

jarynclouatre wants to merge 1 commit into
NotRexed:mainfrom
jarynclouatre:feat/bind-touchpad-click

Conversation

@jarynclouatre

Copy link
Copy Markdown
Contributor

Since #1846 a DualShock 4's or DualSense's touchpad click opens and closes the Insert menu as F1 does, and it can be nothing else: HOS_PAD_TOUCHPAD was its own bit past HOS_PAD_N, so the Controls page cannot take it and a listening binding masks it out. #2212 asks for it as a remappable input (the map, Minus, is the natural place for it on a PlayStation pad). #2979 may be the same request. Home, and Select with Start, already open the menu on these pads.

Change

  • gpu/vk/vk_api.h: HOS_PAD_TOUCHPAD is the gamepad input after the paddles, before HOS_PAD_N. The saved values of the other inputs do not move. The executable and the renderer must agree on its bit, so MKWVK_API_VERSION goes to 22, as it did when the paddles were added.
  • host/nn_hid.c is unchanged: pad_code, hos_bind and bound_pad_buttons take the touchpad as they take the paddles. The options file keeps it, and the game gets the row it is bound to.
  • gpu/vk/vk_menu.cpp:
    • pad_name calls it "Touchpad".
    • A listening binding no longer masks it.
    • A click presses F1 only while no row of the Controls page has the touchpad as Input 1 or Input 2. The new touchpad_bound asks the host's bindings for every row that takes a gamepad input, the ocarina notes included.
    • Defaults do not change: unbound, and after Reset to defaults, a click opens the menu as now.
  • Prompts: the touchpad has no prompt artwork. Like the paddles, it falls past HOS_PAD_ART_N and shows the bound Switch button's default icon.
  • readme.md: a bound touchpad does its binding instead of opening the menu.

Testing

  • tests/test_touchpad_menu.py:
    • The poll's button block still gives the touchpad its own bit, now the input after the paddles.
    • The menu's Controls table, touchpad_bound, pad_name, the F1 line and the listening binding's mask are cut from vk_menu.cpp and run with a stand-in host. Unbound, a click is F1. Bound to Minus's Input 2, or to an ocarina note, it is not. A listening binding takes the click as its input, and its name is "Touchpad".
  • tests/test_bound_keys.py: an options file with the touchpad as Minus's input reads back, and a click gives the game Minus through bound_pad_buttons.
  • Both fail on main and pass here. The new C++ fixture also compiles with llvm-mingw for Windows.
  • Linux renderer built (hookshot_vk.so).
  • Full suite on Linux: 473 passed, 53 skipped, 2 failed, both the same on main on this machine (test_bake_portability: zstandard is not installed; nx2/test_texture_init_barrier.py: clang++ is not installed).
  • No DualShock 4 or DualSense ran it, and no game ran.

…n Controls

Since the touchpad click opened the Insert menu as F1 it had its own bit past HOS_PAD_N and could be nothing else; players want it for the map (Minus), as on the Switch's own pads.

HOS_PAD_TOUCHPAD is now the gamepad input after the paddles, so the Controls page binds it, the options file keeps it and bound_pad_buttons gives the game its row. While no row takes it as Input 1 or Input 2, a click still opens and closes the menu as F1 does; Reset to defaults leaves it unbound. A bit's meaning changes between the executable and the renderer, so MKWVK_API_VERSION goes to 22.
@jarynclouatre
jarynclouatre marked this pull request as ready for review November 13, 2026 00:24
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.

1 participant