three-gamepad-controls
v0.22.0
Published
Gamepad support for Three.js controls.
Maintainers
Readme
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

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 projectspnpm:
pnpm add three three-gamepad-controls
pnpm add -D @types/three # optional: for TypeScript projectsYarn:
yarn add three three-gamepad-controls
yarn add -D @types/three # optional: for TypeScript projectsDeno:
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 projectsBun:
bun add three three-gamepad-controls
bun add -d @types/three # optional: for TypeScript projects📖 Documentation
- Core — The fundamental building blocks.
- GamepadInput - Low-level reader for gamepad buttons, axes, sticks, and transitions.
- Gamepad Stick Processing - Stateless processors, pipelines, and action bindings.
- Haptic Feedback - Optional gamepad vibration effects with graceful degradation.
- Multiple Gamepads - Assign different gamepads to controls, players, and gameplay inputs.
- GamepadControls — Abstract base class for custom gamepad controls.
- GamepadArcballControls - Gamepad support for
ArcballControls. - GamepadDragControls - Gamepad support for
DragControls. - GamepadFirstPersonControls — Gamepad support for
FirstPersonControls. - GamepadFlyControls — Gamepad support for
FlyControls. - GamepadMapControls — Gamepad support for
MapControls. - GamepadOrbitControls — Gamepad support for
OrbitControls. - GamepadPointerLockControls — Gamepad support for
PointerLockControls. - GamepadTrackballControls — Gamepad support for
TrackballControls. - GamepadTransformControls — Gamepad support for
TransformControls.
