like2d
    Preparing search index...

    Module scene/prefab/mapGamepad

    An automagical gamepad mapper.

    like.gamepadconnected = (index) =>
    scenes.push(mapGamepad({ buttons: buttonSetGBA, sticks: 0 }, 0), false)

    Add this to your codebase and activating a gamepad causes a button mapping screen to pop up. It will request to map any buttons not already covered by the automapping database.

    If you're wondering what scenes refers to, check out SceneManager to get started.

    Note: many browsers only fire gamepadconnected on first button press, so always writing "P2: press any button" is a fine idea.

    Functions

    mapGamepad

    Type Aliases

    MapMode

    Variables

    buttonSetAll
    buttonSetGBA
    buttonSetNES
    buttonSetPS1
    buttonSetSNES