Skip to content

Repository files navigation

Three.js Gamepad Controls

Gamepad support for Three.js controls, built on top of Web Gamepad API.

Warning

This library has not reached version 1.0.0 and should not yet be considered stable. Until 1.0.0, minor releases may include breaking changes.

Architecture

Layered architecture showing the shared gamepad input foundation branching into direct application input and Three.js control integrations.

The library is organized around a shared input foundation that handles gamepad selection, polling, button states, axes, sticks, haptics, and standard mappings. Applications can consume this input directly for gameplay, menus, and custom interactions, or use GamepadControls and its ready-made or custom wrappers to integrate gamepads with Three.js controls.

📦 Installation

npm:

npm i three three-gamepad-controls
npm i -D @types/three # optional: for TypeScript projects

pnpm:

pnpm add three three-gamepad-controls
pnpm add -D @types/three # optional: for TypeScript projects

Yarn:

yarn add three three-gamepad-controls
yarn add -D @types/three # optional: for TypeScript projects

Deno:

When using deno.json, Deno stores dependencies in imports and does not separate devDependencies; -D only applies when writing to package.json.

# deno.json
deno add three @types/three three-gamepad-controls
# package.json
deno add --package-json three three-gamepad-controls
deno add --package-json -D @types/three # optional: for TypeScript projects

Bun:

bun add three three-gamepad-controls
bun add -d @types/three # optional: for TypeScript projects

📖 Documentation

About

Gamepad support for Three.js controls.

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages