input-keyboard-mouse-touch

Unify Phaser keyboard, pointer, touch, drag-and-drop, and gamepad input handling.

1|Updated May 3, 2026
One-click install
npx skills add https://github.com/WanderTheWeeb/papas_trauma --skill input-keyboard-mouse-touch-wandertheweeb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: input-keyboard-mouse-touch
Source: https://github.com/WanderTheWeeb/papas_trauma/tree/main/skills/input-keyboard-mouse-touch
Command: npx skills add https://github.com/WanderTheWeeb/papas_trauma --skill input-keyboard-mouse-touch-wandertheweeb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It solves the challenge of implementing reliable, cross-device user input in Phaser games by unifying keyboard, mouse, touch/pointer, drag-and-drop, hit testing, and gamepad handling under a consistent API.

Core Features & Use Cases

  • Keyboard input (polling and events): Use cursor keys, addKey/addKeys, JustDown/JustUp, and key combinations for responsive character controls and UI hotkeys.
  • Pointer/mouse/touch interaction: Listen to scene-level pointer events and Game Object-level interactive events for clicks, hover, movement, wheel, and pointer lock.
  • Interactive gameplay mechanics: Enable drag-and-drop with draggable Game Objects and drop zones, and fine-tune interaction using hit areas (including pixel-perfect) for accurate selection.
  • Gamepad support: Read D-pad, face buttons, analog sticks, and handle connection/disconnection and button events.

Quick Start

Enable keyboard controls with this.input.keyboard.createCursorKeys, make a sprite interactive with setInteractive, then use scene-level pointerdown to react to clicks or taps and update movement logic in update() based on isDown/JustDown.

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 a Phaser game?

Phaser input handling can be unified across keyboard, mouse, and touch by using this.input.keyboard for cursor keys, setInteractive on Game Objects for pointer events, and scene-level pointerdown listeners to capture taps and clicks.

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

Drag and drop in Phaser is implemented by calling setInteractive on Game Objects, enabling draggable state, and defining drop zones to receive pointer events that track object movement and release accurately.

Does Phaser support gamepad controllers for interactive scene navigation?

Phaser gamepad support includes reading D-pad, face buttons, and analog sticks, handling connection/disconnection events, and dispatching button events for controller-driven scene navigation.

How do I create keyboard combos and hotkeys for Phaser UI controls?

Keyboard combos and UI hotkeys in Phaser use this.input.keyboard.addKey or addKeys combined with JustDown/JustUp polling to trigger responsive character controls and selection logic.

What is the best way to do pixel-perfect hit testing for Phaser interactive objects?

Pixel-perfect hit testing in Phaser is achieved by configuring custom hit areas with setInteractive, allowing accurate pointer selection on interactive Game Objects regardless of transparent sprite boundaries.

Why are my Phaser touch events not registering on mobile scenes?

Phaser touch events require Game Objects to have setInteractive enabled with properly defined hit areas, and scene-level pointer listeners must be active to dispatch pointerdown events for mobile touch handling.