Web input touch

From MRCalderon3D/everything-game-dev-code · View interactive version

Web input touch is an AI agent skill from the GitHub repository MRCalderon3D/everything-game-dev-code. Abstract input into named actions across keyboard, mouse, touch, and gamepad, including mobile on-screen controls.

How to use this skill

Skill file

Web Input and Touch

Purpose

Abstract input into named actions across keyboard, mouse, touch, and gamepad, including mobile on-screen controls.

Use When

Inputs

Process

  1. define named actions and bind devices to them in one input module; gameplay code queries actions, never raw events
  2. track per-action edge state (just pressed, held, just released) sampled once per frame, so simulation steps see stable input
  3. use pointer events for mouse and touch together, set touch-action none on the game surface, and prevent default scrolling, zooming, and context menus over it
  4. poll connected gamepads every frame (the gamepad interface is poll-based), map buttons and axes to the same named actions, and apply axis dead zones
  5. design on-screen touch controls as a separate layer bound to actions: thumb-sized targets, anchored to safe areas, multi-touch aware, and only shown when touch is the active modality

Outputs

Quality Bar

Common Failure Modes

Related Agents

Related Commands

Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.