Brewser Docs
Switch Runtime

Controls Reference

Gamepad mapping, touch, keyboard, and how to exit an app

This page is the reference for how the Switch's controls reach your app, and how players move around Brewser. For the sensor side (motion, orientation), see Input & Sensors.

Gamepad mapping

Joy-Cons and the Pro Controller surface through the standard Gamepad API (navigator.getGamepads()), following the Standard Gamepad layout — so gamepad-aware web games generally work unmodified.

IndexButtonIndexButton
0A8− (Minus)
1B9+ (Plus)
2X10Left stick press
3Y11Right stick press
4L12D-pad Up
5R13D-pad Down
6ZL14D-pad Left
7ZR15D-pad Right

Axes: four, in order left X, left Y, right X, right Y (Y is inverted, per the Standard Gamepad convention — up is negative).

Nintendo A/B, X/Y. Index 0 is the button physically labelled A (bottom-right on a Switch), which is the primary/accept button — and index 1 is B (cancel). This matches the Standard Gamepad's "index 0 = primary" convention, but note the physical positions are mirrored compared to an Xbox pad: A and B are swapped, and X and Y are swapped. If you print button prompts, use the index-to-label mapping above rather than assuming Xbox positions.

Touch

The touchscreen fires standard Touch and Pointer events (and synthesises click). Remember touch works only in handheld mode — a docked console has no touchscreen — so always provide a gamepad path too.

Keyboard

Text input uses an on-screen keyboard overlay, driven by the controller: move the cursor, A activates the key under it, B cancels, and + submits. It's invoked automatically when a web form field needs input.

Your manifest can also declare a buttonMapping that maps keyboard keys to Switch controls, so a keyboard-driven web game can be played with the controller.

Exiting an app

There's no single universal quit combo; instead:

To do thisPress
Go back to the catalogueL (the left shoulder) — pops you out of the app back to Brewser
Exit the app+ — published apps are configured to exit on Plus
Quit Brewser entirely (to the Homebrew Menu)HOME
Leave an app's ad-hoc fullscreen (e.g. a video or canvas that went fullscreen)L + R together

Docked vs handheld

  • Resolution. Apps render at 720p; docked output is scaled up to the TV. Design for 720p and it looks right everywhere — see Performance.
  • Touch is handheld-only (above).
  • The software cursor (for mouse-style interaction) can be shown or hidden per dock state via the manifest's hideMouseDocked / hideMouseUndocked flags.

On this page