Skip to content

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

Open
thisishuey wants to merge 1 commit into
JoeGeC:mainfrom
thisishuey:add-android-buttons
Open

thisishuey wants to merge 1 commit into
JoeGeC:mainfrom
thisishuey:add-android-buttons

Conversation

@thisishuey

Copy link
Copy Markdown

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.

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>
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