vtj-input-system

vtj-input-system is a skill for Claude Code, Codex from hexianWeb/Third-Person-MC. It costs 36 tokens per session (2,341 once invoked), scanned A, original, MIT.

An input-handling system for mouse, keyboard, and touch controls in a Three.js scene. It also supports locking the mouse pointer for first-person controls.

In plain words
What is it for?
Use it to build clicking, dragging, hovering, keyboard controls, camera movement, ray-based picking, and first-person mouse controls.
Why use it?
It keeps input handling in one place and provides consistent mouse coordinates for selecting objects. Events let other parts of the app respond without directly reading browser events.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/hexianweb/third-person-mc/vtj-input-system
Any agent
npx skills add hexianWeb/Third-Person-MC --skill vtj-input-system
Clone the repo
git clone --depth 1 https://github.com/hexianWeb/Third-Person-MC

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for vtj-input-system

README.md
[![agentmods](https://agentmods.dev/badge/skills/hexianweb/third-person-mc/vtj-input-system.svg)](https://agentmods.dev/skills/hexianweb/third-person-mc/vtj-input-system)
Your own site
<a href="https://agentmods.dev/skills/hexianweb/third-person-mc/vtj-input-system"><img src="https://agentmods.dev/badge/skills/hexianweb/third-person-mc/vtj-input-system.svg" alt="Measured on agentmods" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,341 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00036 $0.02341
Opus 5 $0.00018 $0.01171
Sonnet 5 $0.00007 $0.00468
Haiku 4.5 $0.00004 $0.00234

Measured 5d ago against content hash c00923eacaf0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

vtj-input-system scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agent/skills/vtj-input-system/SKILL.md · 310 lines

How it starts

The opening of the file, as written. The whole thing — 310 lines — stays where its author put it; the contents beside it link to each section on GitHub.

vite-threejs Input System

Overview

本项目使用 三层输入系统

  • IMouse:鼠标/触摸位置追踪,提供多种坐标格式
  • InputManager:键盘和鼠标按钮状态,通过 mitt 发送事件
  • PointerLockManager:FPS 风格鼠标锁定

核心原则:永远使用 iMouse.normalizedMouse 进行射线拾取,永远通过 mitt 事件消费输入。

When to Use

  • 实现鼠标交互(点击、拖拽、悬停)
  • 添加键盘控制
  • 进行射线拾取(Raycasting)
  • 处理相机控制输入

输入架构

Window Events (keydown/mousemove/etc)
         │
         ▼
┌────────────────────────────────────────────────────────────┐
│                      Input Layer                            │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐      │
│  │   IMouse     │  │ InputManager │  │ PointerLock  │      │
│  │ (positions)  │  │ (key states) │  │ (FPS mouse)  │      │
│  └──────┬───────┘  └──────┬───────┘  └──────┬───────┘      │
└─────────┼─────────────────┼─────────────────┼──────────────┘
          │                 │                 │
          ▼                 ▼                 ▼
┌────────────────────────────────────────────────────────────┐
│                    mitt Event Bus                           │
│         input:update, input:jump, input:mouse_move          │
└────────────────────────────────────────────────────────────┘
          │
          ▼
┌────────────────────────────────────────────────────────────┐
│                   Consumer Layer                            │
│   Player, CameraRig, BlockInteraction, BlockRaycaster       │
└────────────────────────────────────────────────────────────┘

IMouse:位置追踪

访问方式

// 通过 Experience 单例访问
this.iMouse = this.experience.iMouse

可用属性

属性 类型 说明
normalizedMouse Vector2 NDC 坐标 [-1, 1],用于射线拾取
mouse Vector2 左下角原点坐标
mouseDOM Vector2 DOM 坐标 (clientX, clientY)
mouseScreen Vector2 屏幕中心相对坐标
mouseDOMDelta Vector2 帧间位移
isMouseMoving boolean 鼠标是否移动中

射线拾取(MANDATORY PATTERN)

// ✅ ALWAYS: 使用 iMouse.normalizedMouse
const ndc = this.iMouse.normalizedMouse
this.raycaster.setFromCamera(ndc, this.camera)
const intersects = this.raycaster.intersectObjects(this.scene.children)

// ❌ NEVER: 手动计算 NDC
const x = (event.clientX / window.innerWidth) * 2 - 1   // 禁止!
const y = -(event.clientY / window.innerHeight) * 2 + 1 // 禁止!

Read the full file on GitHub · 310 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 310 lines · 36 tokens per session scan A c00923eacaf0

Subscribe to this mod's changes

vtj-input-system is a skill published in the GitHub repository hexianWeb/Third-Person-MC (189 stars, last pushed 1mo ago), licensed MIT. It adds 36 tokens to every session and 2,341 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

game-3d-assets

3D asset engineer that finds, downloads, and integrates GLB/GLTF models into Three.js browser games. Use when a 3D game needs real models instead of primitive BoxGeometry/SphereGeometry shapes.

corosolto/client · 49 tokens

threejs-3d-generator

Generate, texture, rig, animate, stylize, convert, and download 3D assets for Three.js games using the Tripo API. Use for text-to-3D, image-to-3D, 2D concept to 3D conversion, game-ready GLB/FBX assets, characters, creatures, buildings, props, weapons, terrain pieces, auto-rigging, animation retargeting, model…

corosolto/client · 150 tokens

threejs-game-director

Primary entrypoint for complete Three.js browser game creation and premium iteration. Use by default for build-a-game, upgrade, polish, premium, AAA, high-fidelity, showcase, from-scratch, endless runner, arcade, action, or release-ready requests. Orchestrates sibling skills for gameplay, AAA graphics, UI…

corosolto/client · 135 tokens

gauntlet-fps

Roda o Gauntlet Loop do CS BRASIL / CORO SOLTO — o ciclo crítico-adversarial → builders em paralelo → captura medida → verificação A/B → caçador de regressões que melhora gráficos, mapas, armas, UI e jogabilidade do jogo FPS em Three.js. Use SEMPRE que o pedido for melhorar, avaliar, revisar ou "deixar melhor"…

corosolto/client · 188 tokens

threejs-gltf-loading

Load glTF/GLB models in three.js with GLTFLoader and play their skinned animations with AnimationMixer, including DRACO/Meshopt-compressed meshes and KTX2 textures. Use when importing 3D models into three.js — when the user mentions glTF, GLB, GLTFLoader, AnimationMixer, animation clips, DRACOLoader, or "load a 3D…

corosolto/client · 117 tokens

threejs-aaa-graphics-builder

Upgrade Three.js games from basic/prototype visuals to premium AAA-inspired browser graphics. Combines art-direction critique, procedural model building, technical art, mandatory external asset sourcing decisions, threejs-3d-generator assets, threejs-image-generator concept/texture workflows, scene visual polish…

corosolto/client · 140 tokens