vtj-input-system

Manage mouse, keyboard, and touch inputs for raycasting and camera control in 3D web apps.

175|39|Updated Dec 13, 2025
One-click install
npx skills add https://github.com/hexianWeb/Third-Person-MC --skill vtj-input-system
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vtj-input-system
Source: https://github.com/hexianWeb/Third-Person-MC/tree/main/.cursor/skills/vtj-input-system
Command: npx skills add https://github.com/hexianWeb/Third-Person-MC --skill vtj-input-system

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a cohesive input system for web-based 3D applications, unifying mouse, keyboard, and touch interactions to enable predictable raycasting, camera control, and object interactions.

Core Features & Use Cases

  • Unified input layers: IMouse tracks normalized and DOM coordinates, InputManager broadcasts key/button states, and PointerLockManager enables FPS-style lock.
  • Event-driven controls: Uses mitt to emit and consume input events, simplifying integration with Players, Cameras, and interactables.
  • Use Case: In a Three.js scene, implement raycasting from the center screen for picking and enable camera orbit or character control with consistent input across devices.

Quick Start

Start by wiring the three-layer input system (IMouse, InputManager, and PointerLockManager) into your Experience, then subscribe to input events to drive movement and interactions.

Frequently Asked Questions about vtj-input-system

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I unify mouse, keyboard, and touch controls for 3D web apps?

A unified input system for 3D web apps manages mouse, keyboard, and touch controls by tracking normalized coordinates and broadcasting key states. This ensures consistent raycasting and camera control across desktop and mobile devices.

What is the best way to implement raycasting for object selection in Three.js?

Implementing raycasting for object selection in Three.js is best achieved through an event-driven input system. Using an event bus to emit input events simplifies integration with interactables and enables reliable object picking.

Does this input system support FPS-style pointer lock on both desktop and mobile?

Yes, this input system supports FPS-style pointer lock across desktop and mobile contexts. A dedicated PointerLockManager component enables the lock, while unified input layers ensure consistent camera control on touch devices.

How do I manage input events for camera control in a 3D scene?

Managing input events for camera control in a 3D scene involves using a mitt event bus to emit and consume input interactions. This event-driven approach simplifies wiring input layers to cameras and players for orbit or character control.

Why do I need a structured input system for interactive 3D controls?

A structured input system for interactive 3D controls is needed to achieve predictable mouse, keyboard, and touch interactions. Without it, managing raw DOM coordinates and device-specific inputs for raycasting and camera control becomes inconsistent.