Input Keyboard Mouse Touch
Keyboard, mouse, touch, and gamepad input for Phaser 4 Scenes via the this.input plugin.
- CCM score
- 74 of 100
- skills.sh installs
- 1.3K
- GitHub stars
- 40.8K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers keyboard polling and events, pointer clicks and movement, multi-touch, mouse wheel, drag and drop, and gamepad input
- Includes hit areas for circle, ellipse, rectangle, triangle, and polygon shapes, plus pixel-perfect hit testing
- Provides
Pointerproperties for position, button state, velocity, and drag distance, and interactive Game Object setup viasetInteractive - Designed for Phaser 4 projects that handle player input through event listeners or per-frame state polling
Install
$ npx -y skills add phaserjs/phaser --skill input-keyboard-mouse-touch -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Input: Keyboard, Mouse, Touch, and Gamepad
Phaser provides a unified input system accessed via
this.inputin any Scene. It supports keyboard polling and events, mouse/pointer interaction with Game Objects (click, hover, drag), multi-touch, mouse wheel, and gamepad input. Input can be handled through event listeners or by polling state each frame.
Key source paths: src/input/InputPlugin.js, src/input/Pointer.js, src/input/keyboard/KeyboardPlugin.js, src/input/keyboard/keys/Key.js, src/input/keyboard/keys/KeyCodes.js, src/input/keyboard/combo/KeyCombo.js, src/input/gamepad/GamepadPlugin.js, src/input/gamepad/Gamepad.js, src/input/events/, src/input/keyboard/events/
Related skills: ../sprites-and-images/SKILL.md, ../events-system/SKILL.md, ../scenes/SKILL.md
Quick Start (basic keyboard + pointer input)
class MyScene extends Phaser.Scene {
create() {
// Keyboard: create cursor keys (up, down, left, right, space, shift)
this.cursors = this.input.keyboard.createCursorKeys();
Details
- Repository
- github.com/phaserjs/phaser
- Categories
- Game Development, Frontend & UI Code
- First seen
- Jun 3, 2026
Questions
What does the input-keyboard-mouse-touch skill do for Phaser games?
It guides handling of user input in Phaser 4, covering keyboard keys, mouse clicks and movement, touch events, pointers, drag and drop, hit areas, interactive objects and gamepad support. It also explains polling input state each frame or using event listeners through this.input in any Scene.
How do I make a sprite clickable in Phaser with this skill?
Call sprite.setInteractive() to enable input on a Game Object, which uses the texture frame as the hit area by default. You can then listen for sprite.on('pointerdown') to react to clicks, and pass a custom shape or pixel-perfect option for finer hit testing.
How do I install the input-keyboard-mouse-touch skill?
Run npx -y skills add phaserjs/phaser --skill input-keyboard-mouse-touch -y in your project. After that, the agent can write Phaser code for keyboard, mouse, touch and gamepad input.
Where does this skill stand in the Game Development category?
It sits in the Game Development category alongside skills such as game-feel, game-ui-ux and level-design. It focuses specifically on the input side of Phaser 4 games rather than on feel, interface or level structure.
More from phaserjs/phaser
All 8Similar to Input Keyboard Mouse Touch
More Game Developmentr3f-interactionenzed/r3f-skills3.7K installsReact Three Fiber input handling covering pointer picking, drag ownership, camera controls, and keyboard movement.
pixijs-eventspixijs/pixijs-skills7.1K installsSkill covering PixiJS v8 pointer, touch, and wheel input handling with eventMode and propagation rules.
phaser-gamedevchongdashu/phaserjs-tinyswords1.1K installsPhaser 3 scene-based game development with Arcade and Matter physics, tilemaps, animations, and input handling.
threejs-interactioncloudai-x/threejs-skills25K installsInteractive picking, camera controls, and drag handling for three.js that behaves the same under WebGL and WebGPU.
hig-inputsraintree-technology/hig-doctor822 installsGuidance on Apple input methods and interaction patterns across iPadOS, macOS, tvOS, watchOS, and visionOS.
threejs-gameplayableintelligence/game-creator1.3K installsOpinionated Three.js game development patterns covering architecture, input handling, and shading for browser-based 3D games.