Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Conversation

@nkymut
Copy link
Contributor

@nkymut nkymut commented May 17, 2025

  • Added support for different gamepad button mappings (XBOX, NES, custom).
  • Refactored global buttonMap to instance variable to support multiple gamepad mappings

Usage

const pad1 = gamepad(0); // Default mapping is XBOX {a: 0, b: 1, x: 2, y: 3}
const pad2 = gamepad(1, 'XBOX'); // XBOX button mapping {a: 0, b: 1, x: 2, y: 3}
const pad3 = gamepad(2, 'NES'); // Nintendo button mapping {a: 1, b: 0, x: 3, y: 2}
const pad4 = gamepad(3, {a: 0, b: 1, x: 2, y: 3}); // Custom mapping

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant