input-keyboard-mouse-touch

Centralize keyboard, mouse, touch, pointer, drag, and gamepad input in Phaser 4.

Updated Jun 21, 2021
One-click install
npx skills add https://github.com/mahirocoko/mahirocoko --skill input-keyboard-mouse-touch-mahirocoko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: input-keyboard-mouse-touch
Source: https://github.com/mahirocoko/mahirocoko/tree/main/plugins/phaser/skills/input-keyboard-mouse-touch
Command: npx skills add https://github.com/mahirocoko/mahirocoko --skill input-keyboard-mouse-touch-mahirocoko

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Phaser developers often struggle to manage input across keyboard, mouse, touch, pointer, drag, drop, and gamepad in a unified way, leading to scattered event handling and inconsistent behavior.

Core Features & Use Cases

  • Unified input system access via this.input across scenes for keyboard, pointer, drag and drop, hit areas, and gamepad.
  • Easy setup of interactive objects with setInteractive, drag events, and hit areas, enabling responsive gameplay and UI interactions.
  • Real-world use: implement player movement with cursor keys, click to shoot, drag items, and support for multiple pointers and gamepads.

Quick Start

Create a Phaser Scene and wire up the input handlers using this.input, set up interactive objects with setInteractive, and listen for keyboard and pointer events to drive game behavior.

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, mouse, and touch input in Phaser 4?

You can manage keyboard, mouse, and touch input in Phaser 4 by centralizing event handling through the unified input plugin, accessing interactive objects and pointer events via this.input.

How do I set up drag and drop for game objects in Phaser 4?

Drag and drop is set up by applying setInteractive to objects and wiring drag events through the input plugin, enabling responsive object interactivity and hit area detection.

Can I use gamepad controls alongside pointer events in a Phaser scene?

Yes, gamepad integration works alongside pointer events in a Phaser scene through the input plugin, allowing you to combine cursor key movement, clicking, and gamepad controls.

Does Phaser 4 support multiple pointers for simultaneous touch interactions?

Phaser 4 supports multiple pointers natively, enabling simultaneous touch interactions and multi-touch gameplay through the centralized input system and interactive object APIs.

Why does my Phaser 4 object not respond to pointer events?

Objects fail to respond when setInteractive is not applied or hit areas are misconfigured, preventing the input plugin from registering pointer events on the interactive objects.