dev-phaser-input-handlers

Implements keyboard, mouse, touch, and gamepad input handling for Phaser 3 games.

1|Updated Mar 19, 2026
One-click install
npx skills add https://github.com/fiando/bake-tycoon --skill dev-phaser-input-handlers-fiando
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dev-phaser-input-handlers
Source: https://github.com/fiando/bake-tycoon/tree/main/.github/skills/dev-phaser-input-handlers
Command: npx skills add https://github.com/fiando/bake-tycoon --skill dev-phaser-input-handlers-fiando

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Handling player input across keyboard, mouse, touch, and gamepad in Phaser games often leads to fragmented code paths, manual DOM event listeners, and missing mobile or controller support. This Skill provides unified patterns for managing all input methods through Phaser's input system. ## Core Features & Use Cases - Unified Input API: Replace manual DOM event listeners with Phaser's pointer, keyboard, and gamepad plugins so mouse and touch share one code path. - Virtual Joystick for Mobile: Build an on-screen joystick with pointer ID tracking for multi-touch on Android and iOS devices. - Input Manager Abstraction: Centralize movement, jump, and attack queries across keyboard, gamepad, and virtual controls with a reusable InputManager class. - Use Case: When adding controller support to a platformer, use the gamepad patterns to read analog sticks, D-pad, and face buttons with automatic keyboard fallback. ## Quick Start Add keyboard, touch, and gamepad controls to my Phaser scene using a unified input manager with a virtual joystick for mobile.

Frequently Asked Questions about dev-phaser-input-handlers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle keyboard input in Phaser 3?▼

Create cursor keys with this.input.keyboard.createCursorKeys() in the create() method, or use addKeys('W,A,S,D') for custom bindings. Check isDown in update() for held keys and Phaser.Input.Keyboard.JustDown for one-shot triggers.

How to add gamepad support to a Phaser game?▼

Phaser 3 auto-enables the gamepad plugin. Listen for the connected event on this.input.gamepad, then read axes with pad.axes[0].getValue() and buttons via pad.buttons[index].isDown in the update loop.

Does Phaser unify mouse and touch input?▼

Yes, Phaser's pointer events like pointerdown and pointermove fire for both mouse and touch automatically. A single handler receives a Pointer object with x and y coordinates regardless of input source.

How do I create a virtual joystick for mobile in Phaser?▼

Draw a base and knob circle, then track pointerdown, pointermove, and pointerup events within the joystick radius. Store the pointer ID for multi-touch safety and normalize the knob offset into a -1 to 1 movement vector.

Why should I avoid creating Key objects in the update loop?▼

Creating Key objects every frame wastes memory and breaks JustDown/JustUp state tracking. Create all keys once in create() and reuse them, combining event listeners with polling where appropriate.