input-keyboard-mouse-touch

Handle keyboard, mouse, touch, drag-and-drop, and gamepad input in Phaser scenes.

Updated Feb 11, 2026
One-click install
npx skills add https://github.com/ArtRiv/game-topicos-especiais --skill input-keyboard-mouse-touch-artriv
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: input-keyboard-mouse-touch
Source: https://github.com/ArtRiv/game-topicos-especiais/tree/main/skills/input-keyboard-mouse-touch
Command: npx skills add https://github.com/ArtRiv/game-topicos-especiais --skill input-keyboard-mouse-touch-artriv

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill reduces the friction of implementing reliable user input handling in Phaser by giving a single, consistent way to manage keyboard, mouse/pointer, touch, drag-and-drop, and gamepad controls.

Core Features & Use Cases

  • Unified Scene Input: Use this.input to process input events and poll state each frame, including keyboard, pointers, and gamepad.
  • Interactive Objects & Hit Areas: Enable input on Game Objects with setInteractive() and choose default texture hit areas, geometric shapes, or pixel-perfect detection when needed.
  • Pointer & Drag Workflows: Support click/hover, multi-touch, pointer lock, and full drag-and-drop pipelines with thresholds, drag events, and drop zones.
  • Gamepad Support: Enable gamepad input via this.input.gamepad, read d-pad/button/analog sticks, and react to connection and button events.
  • Use Cases: Building movement controls, menu interaction, clickable UI, touch-friendly interactions, drag-and-drop inventory systems, and controller-based gameplay.

Quick Start

Call setInteractive() on the Game Object you want to respond to, then listen to this.input.on('pointerdown', ...) for scene-wide clicks and sprite.on('pointerdown', ...) for object-specific interactions.

Frequently Asked Questions about input-keyboard-mouse-touch

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

FAQPage Schema
How do I handle keyboard and mouse input in Phaser scenes?

Handle keyboard and mouse input in Phaser by using `this.input` to process events and poll state each frame, ensuring consistent scene-wide and object-specific controls.

How do I set up drag and drop with drop zones in Phaser?

Implement drag and drop in Phaser by calling `setInteractive()` on Game Objects, configuring hit areas, and listening to drag events with thresholds and drop zone support.

Can I use gamepad controllers for gameplay in Phaser?

Yes, you can use gamepad controllers in Phaser by enabling `this.input.gamepad`, reading d-pad/button/analog sticks, and reacting to connection and button events.

What is the best way to manage multi-touch and pointer events in Phaser?

The best way to manage multi-touch in Phaser is using unified scene input via `this.input` to support click/hover, multi-touch, pointer lock, and event-driven workflows.

How do I configure pixel-perfect hit areas for interactive objects in Phaser?

Configure pixel-perfect hit areas in Phaser by calling `setInteractive()` on Game Objects and choosing default texture hit areas, geometric shapes, or pixel-perfect detection.