Skip to content

Let controller buttons act as Android's Home, Back and Screenshot - #31

Merged
JoeGeC merged 4 commits into
JoeGeC:mainfrom
thisishuey:add-android-buttons
Oct 12, 2026
Merged

JoeGeC merged 4 commits into
JoeGeC:mainfrom
thisishuey:add-android-buttons

Conversation

@thisishuey

Copy link
Copy Markdown
Contributor

A Switch 2 controller's Home, Capture and C reach Android only as gamepad keys that no system action answers to, so going home or back from a game, or taking a screenshot, meant reaching for the device itself. On a Retroid Pocket Nova, C on player 1 even arrived as B.

Settings now has an Android buttons section with three rows: Home, Back and Screenshot. Each takes one of Home, Capture, C, GL, GR, − or +, and all start as None. A choice applies to every player while the Virtual Gamepad is on, and the chosen button no longer reaches games.

Home and Back travel on the virtual gamepad. It gains a trailing Consumer Control collection, and ReportMapper moves a bound button out of the gamepad bits into AC Home or AC Back, which Android reads as HOME and BACK. Screenshot runs input keyevent 120 (SYSRQ) through the privileged shell, once per press: a Print Screen usage on the pad took no screenshot on the Nova, while the shell command did.

Only buttons SidewaysMapper never moves are offered, so a button's id is the same in the player's input and in the report. Emulator configs keep their bindings to a bound button, so setting it back to None needs no new Set up. Android always handles Home itself, so a bound Home leaves the game.

Tested on a Retroid Pocket Nova (Android 13) with NSO GameCube controllers: Home, Back and Screenshot each work, and holding the Screenshot button takes one screenshot.

thisishuey and others added 4 commits October 9, 2026 02:21
A Switch 2 controller's Home, Capture and C reach Android only as
gamepad keys that no system action answers to, so going home or back
from a game, or taking a screenshot, meant reaching for the device
itself. On a Retroid Pocket Nova, C on player 1 even arrived as B.

Settings now has an Android buttons section with three rows: Home, Back
and Screenshot. Each takes one of Home, Capture, C, GL, GR, − or +, and
all start as None. A choice applies to every player while the Virtual
Gamepad is on, and the chosen button no longer reaches games.

Home and Back travel on the virtual gamepad. It gains a trailing
Consumer Control collection, and ReportMapper moves a bound button out
of the gamepad bits into AC Home or AC Back, which Android reads as HOME
and BACK. Screenshot runs `input keyevent 120` (SYSRQ) through the
privileged shell, once per press: a Print Screen usage on the pad took
no screenshot on the Nova, while the shell command did.

Only buttons SidewaysMapper never moves are offered, so a button's id is
the same in the player's input and in the report. Emulator configs keep
their bindings to a bound button, so setting it back to None needs no
new Set up. Android always handles Home itself, so a bound Home leaves
the game.

Tested on a Retroid Pocket Nova (Android 13) with NSO GameCube
controllers: Home, Back and Screenshot each work, and holding the
Screenshot button takes one screenshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	feature/gamepad/data/src/test/kotlin/com/joegec/joycon2android/gamepad/ReportMapperTest.kt
Home, Back and Screenshot become targets in each player's mapping card,
under Buttons/Sticks/Motion/Android headings, so they follow the selected
emulator's console like every other binding. A bound button is withheld
from the game on both outputs. Home and Back ride the virtual gamepad's
Consumer keys; Screenshot, and every key over DSU alone, go through the
Shizuku shell once per press, with failures caught and the process closed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JoeGeC

JoeGeC commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Hey, great stuff! Thanks for the contributions.

I made some changes to this one so that the android button mappings are per player/emulator, just like the rest of the mappings, and added usage with DSU.

This improves UX:

  • Keeps all mappings in one place.
  • If the user wants to reuse it for multiple players, they can save the mappings and assign it easily that way. No need to assign the same for every player.
  • Users might have gotten confused if they turn on the option and it doesn't work with DSU.

@JoeGeC
JoeGeC merged commit e6233e5 into JoeGeC:main Oct 12, 2026
1 check passed
@thisishuey
thisishuey deleted the add-android-buttons branch October 12, 2026 22:38
JoeGeC added a commit that referenced this pull request Oct 13, 2026
mygamecache for the console protocol path (#26), thisishuey for the
Android button mapping (#31).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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