melonJS game input
Wires keyboard, mouse, touch and gamepad input in melonJS games, so controls respond and pointer events work.
Claude's review
8/10 Specific melonJS input traps like isKinematic and consume by returning false, with working examples.
We asked Claude the question you would ask: would I be glad I installed this? We only sell skills it rates 7 or higher.
In detail
Use this skill for keyboard, pointer, mouse, touch and gamepad input in melonJS. Covers the bindKey action indirection, registerPointerEvent on regions, the isKinematic requirement that silently blocks pointer events, which of several overlapping objects receives an event and how to consume it, world vs screen pointer coordinates, pointer events on 3D meshes, and gamepad mapping onto the same actions. Triggers on: input, bindKey, isKeyPressed, KEY, bindPointer, mouse button, vibrateGamepad, rumble, activeGamepad, registerPointerEvent, releasePointerEvent, pointerdown, pointerup, pointermove, POINTERMOVE, gamepad, bindGamepad, triggerKeyEvent, virtual gamepad, touch controls, joystick, gamepad-plugin, floating stick, floating button, floating joystick, two thumbs, tap to fire, hideAtRest, mobile controls, KEYDOWN, KEYUP, press any key, splash screen, click, touch, drag, POINTERUP, hit test, event propagation, stop propagating, overlapping, which object gets the click, click a mesh, hit3d, 3D picking.
How you use it
- Add it to your pack, then download your pack (1 credit).
- In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
- Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide
Safety check
Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: melonjs-input
description: "Use this skill for keyboard, pointer, mouse, touch and gamepad input in melonJS. Covers the bindKey action indirection, registerPointerEvent on regions, the isKinematic requirement that silently blocks pointer events, which of several overlapping objects receives an event and how to consume it, world vs screen pointer coordinates, pointer events on 3D meshes, and gamepad mapping onto the same actions. Triggers on: input, bindKey, isKeyPressed, KEY, bindPointer, mouse button, vibrateGamepad, rumble, activeGamepad, registerPointerEvent, releasePointerEvent, pointerdown, pointerup, pointermove, POINTERMOVE, gamepad, bindGamepad, triggerKeyEvent, virtual gamepad, touch controls, joystick, gamepad-plugin, floating stick, floating button, floating joystick, two thumbs, tap to fire, hideAtRest, mobile controls, KEYDOWN, KEYUP, press any key, splash screen, click, touch, drag, POINTERUP, hit test, event propagation, stop propagating, overlapping, which object gets the click, click a mesh, hit3d, 3D picking."
license: MIT
---
# Input: keyboard, pointer and gamepad
## Keyboard goes through named actions
Do not poll key codes. Bind a key to an **action string**, then poll the action —
this is what lets gamepad and virtual controls map onto the same handling.
```js
import { input } from "melonjs";
input.bindKey(input.KEY.LEFT, "left");
input.bindKey(input.KEY.RIGHT, "right");
input.bindKey(input.KEY.X, "jump", true); // true = locked: one press per keydown
// in update()
if (input.isKeyPressed("left")) { /* … */ }
if (input.isKeyPressed("jump")) { /* fires once per press, not per frame */ }
```
The third argument to `bindKey` is `lock` (default `false`). Without it,
`isKeyPressed` stays true for as long as the key is held — correct for movement,
wrong for jump or fire. A locked action stays consumed until the key is released
or you call `input.unlockKey("jump")`. Use `input.keyStatus(action)` when you
want the raw held/not-held state regardless of locking.
### A poll can miss a press entirely
`isKeyPressed` is sampled once per frame, and `keyup` decrements the key's
counter the moment it arrives — locked or not. A press that goes down and up
between two frames therefore leaves the counter back at zero and is never
seen. At 60fps that is anything under ~16ms: rare from a human finger, routine
from a synthetic event, and more likely the slower the frame rate.
For a screen where a missed press is a dead end — a splash, a "press any key",
...From melonjs's repository, MIT licence.
Related skills
-
Checked
Godot game optimisation
Profiles a Godot game and fixes common slowdowns in draw calls, physics and memory so it runs more smoothly.
7/101 credit -
Checked
Game Audio Mixing
Sets up game audio buses, volume sliders, music ducking and adaptive music for Godot, Unity or FMOD.
8/101 credit -
Checked
Game camera tuning
Builds and tunes follow, orbit and first person game cameras in Godot or Cinemachine so they stop jittering.
8/101 credit -
Checked
Game Enemy AI
Designs enemy AI with perception, pathfinding and steering so enemies chase fairly and never get stuck.
8/101 credit -
Checked
Blender asset optimisation
Cuts Blender assets down to each platform's budget with LODs, decimation and texture atlases before export.
7/101 credit -
Checked
Three.js game UI
Designs HUDs, menus, pause screens and touch controls for Three.js games that read well on any screen.
7/101 credit