Command Palette

Search for a command to run...

Назад к скиллам
скилл № 82750

input-systems

Use when the user asks about a game input system, action mapping, key rebinding, gamepad input, touch gestures, IME text input, haptics or input latency…

БесплатноБез исполняемых скриптов
j4flmaoот j4flmao★ 47 звёзд на GitHub

Установить input-systems в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Input Systems — Deep Engineering Guide

Purpose

Input is the player's handshake: it must be lag-free, remappable, device-agnostic and deterministic. This skill covers device abstraction, action mapping, raw sampling vs event flows, text/IME, touch/gestures, haptics and the input-to-simulation timing that separates "responsive" from "floaty".

Agent Protocol

Trigger

"input system", "action mapping", "key rebinding", "gamepad input", "touch gestures", "IME text input", "haptics", "input latency".

Input Context

  • Engine and platforms (PC, console, mobile)
  • Device set (keyboard/mouse, gamepad, touch)
  • Networked or local (determinism of input stream)

Output Artifact

Input architecture and code for sampling, mapping and dispatch. No file unless requested.

Response Format

Devices: {list}
Actions: {action -> bindings}
Timing: {sample point vs sim tick}
Code: {snippet}
Risks: {latency, lost events, rebinding conflicts}

1. The Three Layers

device world (keyboard/mouse/stick/controller/gamepad/touch)
  → InputProvider (concrete device driver)
  → InputSystem (maps physical → logical actions, accumulates)
  → Game (consumes actions; sim at fixed tick)

The action abstraction is what makes one input system serve every device + remap UIs.

2. Device Abstraction

struct InputEvent { Device device; DeviceId id; float3 raw; ButtonState state; };
Device Raw data Notes
Keyboard key codes layout-aware (AZERTY!)
Mouse dx/dy, buttons, wheel raw vs OS-corrected
Gamepad axis, buttons, triggers analog, deadzone
Touch touches[], gesture stream multitouch
VR controller linear/angular motion
Pen/touchpad extended per-OS

The abstraction must retain the raw for remap-sensitive consumers — never bake layout into the engine core (see device-abstraction.md).

3. Action Mapping (The Remap Surface)

// logical: Jump (physical: Space | GamepadA)
// triggered by any binding that matches
struct Action { vector<Binding> bindings; Activation mode; };
  • Actions express intent (Move, Attack, Talk) — the game reads actions only, never key codes.
  • Bindings: {key, gamepadButton, axis-min/max, deadzone, doubleTap, hold, drag}.
  • Conflicts: an action triggered by multiple bound devices — resolve by priority + first-arrival (never two).
  • Remap UI edits the bindings; the engine logic never changes.

4. Sampling vs Events

Style Use Tradeoff
Poll (sample) every frame / fixed-tick deterministic sims, netcode 1 sample/frame
Event (queued) fired on change UI, menus, gestures lossless, ordering
Accumulated (delta) mouse movement, scroll sums raw deltas

Gameplay = poll the action state at the fixed tick (deterministic). UI/menus = events. Mouse = accumulated delta between polls (the "eats the delta" contract).

4.1 The Fixed-Tick Braid

// sim tick consumes the latest action state — never processes events mid-tick
frame: poll → build actionSamples[tick] → sim(tick) → render

Determinism requires: input snapshot per fixed tick, ordered, deduplicated (see sampling-and-events.md).

5. Text & IME (The Hidden Beast)

  • Text input ≠ keydown: a keyboard produces characters (layout + modifiers), and CJK uses an IME composition window.
  • Engine must route through the platform IME: compositionStart/update/end + the committed string.
  • Differentiator: paste handling, dead-keys, numpad, and per-UI-context focus (chat field vs game).

Details in text-and-ime.md — a surprising chunk of "input bugs" live here.

6. Touch & Gestures

  • Touch = absolute multitouch stream (down/move/up per touch id).
  • Gestures are recognized upstream of game logic: tap, long-press, drag, pinch, double-tap, swipe — each with begin/update/end + a cancel case.
  • Never synthesize mouse from touch frames (the mouse is a different device with a cursor concept).

7. Haptics & Feel

Device Haptics
Gamepad rumble (left/right motor), pulse frequencies
PS5/VR adaptive triggers, high-fidelity haptics
Mobile vibration (primitive)
Desktop — (rare)

Haptic events are timed impulses ("hit feedback 20 ms, 60% L / 0% R"), remapped per-device, rate-limited (rumble spam ruins feel). See haptics-and-tuning.md.

8. Input-to-Sim Latency (The Feel Metric)

Stage Budget
device → provider OS-level (~1–4 ms console, up to ~poll-rate)
provider → poll < 1 ms
poll → sim tick ≤ 1 tick (16.6 ms @60)
sim → render ≤ 1 frame
full click-to-photon measure it (high-speed camera, NVIDIA Reflex Latency Analyzer); at 60 fps many games land around 50–100 ms — every extra queued frame adds ~16.7 ms

Threads/queue/timing decisions that add a tick of latency are the feel killers — measure, don't assume.

9. The Input →

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/action-mapping.md
  • references/device-abstraction.md
  • references/haptics-and-tuning.md
  • references/sampling-and-events.md
  • references/text-and-ime.md
  • references/touch-and-gestures.md

FAQ

Что делает скилл input-systems?

Use when the user asks about a game input system, action mapping, key rebinding, gamepad input, touch gestures, IME text input, haptics or input latency. Produces device-agnostic input architecture tied to the simulation tick. Not for menu accessibility audits (use design-accessibility) or Unity-specific setup (use unity).

Как установить скилл input-systems?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл input-systems запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить input-systems с