/jeux:input-systemsfrom jeux
Engine-neutral input architecture with Godot InputMap code: named actions, stick deadzones, buffered presses and rebinding with conflict checks. Use for controller support or a rebind menu, or a drifting stick, WASD on AZERTY, or a dropped press. Not for coyote time (`platformer`) or Unity and Unreal input assets (`unity-input-system`, `unreal-enhanced-input`).
Ships in jeux. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Gameplay reads named actions (jump, attack, move); bindings from keys, buttons and
touch to those actions are data. Rebinding, multi-device support and most input accessibility
fall out of that one indirection. This skill is the engine-neutral architecture with Godot 4.7
code. For the engine's own input assets use unity-input-system or unreal-enhanced-input;
Godot's InputMap is covered here.
Not this skill: coyote time, jump buffering and variable jump height belong to
platformer, which owns the jump controller. Hit-stop and other juice that interact with
buffers are game-feel. Writing the bindings file is save-systems. Menu focus and
navigation rules are game-ui-ux.
[input] section of
project.godot; Unity: the .inputactions file; Unreal: IA_/IMC_ assets) and grep
gameplay code for raw key reads (is_key_pressed, KEY_, Input.GetKey). Raw reads are
the first thing to replace.if Input.is_action_just_pressed("jump"): # edge: true on the press frame or tick only
try_jump()
var dir := Input.get_vector("move_left", "move_right", "move_up", "move_down")
# get_vector applies a radial deadzone, rescales past it and caps length at 1,
# so diagonals are not faster. Use get_axis for a single axis.
# WRONG: Input.is_key_pressed(KEY_SPACE): unrebindable, keyboard-only, and a held
# check, so jump re-fires every frame.
Engine equivalents: Unity Input System InputAction and action maps; Unreal Enhanced Input
Actions plus Mapping Contexts.
# Raw sticks never rest at exactly zero. Apply a RADIAL deadzone (on the vector
# length), not per-axis, so diagonals aren't clipped into the axes.
func apply_deadzone(stick: Vector2, dead := 0.2, curve := 1.0) -> Vector2:
# dead == 1 cannot be rescaled; report invalid settings before stopping movement.
if not (dead >= 0.0 and dead < 1.0 and curve > 0.0):
push_error("apply_deadzone requires 0 <= dead < 1 and curve > 0.")
return Vector2.ZERO
var mag := stick.length()
if mag <= dead:
return Vector2.ZERO # inside deadzone -> no movement
# Rescale so motion ramps from 0 at the edge of the deadzone, not from `dead`.
var scaled := minf((mag - dead) / (1.0 - dead), 1.0) # some pads report > 1 on diagonals
return stick / mag * pow(scaled, curve) # curve > 1 = finer aim near center
# WRONG: clamping each axis separately — it carves a square hole and snaps to axes.
Keep the response curve (exponent) separate from sensitivity (a gain on the result, usually a
camera turn rate) and expose both in settings. Invalid settings report an error and return zero
movement. Godot's get_vector already does this deadzone and rescale, using the average of the
four actions' deadzones (0.2 per action by default) unless you pass one.
# action_buffer.gd: remember discrete presses briefly so an early press still fires.
extends RefCounted
var window := 0.15 # seconds; 0.1-0.2 suits attacks and dodges
var _pressed_at := {} # action -> game time of its latest press
func press(action: StringName, now: float) -> void:
_pressed_at[action] = now
func consume(action: StringName, now: float) -> bool:
if not _pressed_at.has(action) or now - _pressed_at[action] > window:
return false
_pressed_at.erase(action) # one press fires one action
return true
func clear() -> void: # on death, pause, cutscene, scene change
_pressed_at.clear()
Feed it from the input read (if Input.is_action_just_pressed("attack"): buffer.press(&"attack", clock)) and call consume where the action becomes legal, such as the first frame after attack
recovery. clock is game time you advance in _physics_process, so the window freezes during
pause and hit-stop. When two buffered actions become legal on the same tick, choose by a fixed
priority, not by dictionary order. Jump buffering and coyote time use the same idea but belong to
platformer.
# Godot 4.7. Capture the next physical input, reject conflicts, then persist.
var _waiting_for: StringName = &"" # set by the "press a key for Jump" button
func _unhandled_input(event: InputEvent) -> void:
if _waiting_for != &"" and _is_bindable(event):
get_viewport().set_input_as_handled()
if not rebind(_waiting_for, event):
show_conflict_warning(event) # offer swap or cancel
_waiting_for = &""
func _is_bindable(e: InputEvent) -> bool:
if e is InputEventKey or e is InputEventJoypadButton or e is InputEventMouseButton:
return e.pressed and not e.is_echo() # ignore releases and key repeat
return e is InputEventJoypadMotion and absf(e.axis_value) > 0.5 # ignore stick noise
func rebind(action: StringName, captured: InputEvent) -> bool:
var event := _to_binding(captured)
for other in InputMap.get_actions():
if other != action and not String(other).begins_with("ui_") \
and InputMap.action_has_event(other, event):
return false # already used -> let UI warn/swap
for old in InputMap.action_get_events(action):
if old.get_class() == event.get_class(): # replace only this device kind's binding
InputMap.action_erase_event(action, old)
InputMap.action_add_event(action, event)
save_bindings() # persist (see save-systems)
return true
func _to_binding(e: InputEvent) -> InputEvent:
if e is InputEventKey: # bind the physical key, not the layout's letter
var k := InputEventKey.new()
k.physical_keycode = e.physical_keycode
return k
var b := e.duplicate() as InputEvent
b.device = -1 # all devices: a pad binding must not stick to pad 0
if b is InputEventJoypadMotion:
b.axis_value = signf(b.axis_value) # keep the direction only
return b
Keyboard bindings use physical_keycode with keycode left at 0, which makes Godot match by key
position, so WASD stays in place on AZERTY or Dvorak. Show the player's own label with
DisplayServer.keyboard_get_label_from_physical. Reset to defaults with
InputMap.load_from_project_settings(). Unity: PerformInteractiveRebinding() and
SaveBindingOverridesAsJson()/LoadBindingOverridesFromJson(). Unreal: Enhanced Input User
Settings with player-mappable keys.
# tools/audit_bindings.gd: godot --headless --path . --script res://tools/audit_bindings.gd
extends SceneTree
const KEYBOARD_ONLY := [&"toggle_console"] # actions allowed to have no gamepad binding
func _initialize() -> void:
var problems := PackedStringArray()
var actions := InputMap.get_actions().filter(func(a): return not String(a).begins_with("ui_"))
for i in actions.size():
var action: StringName = actions[i]
var events := InputMap.action_get_events(action)
if not events.any(func(e): return e is InputEventKey or e is InputEventMouseButton):
problems.append("%s: no keyboard or mouse binding" % action)
if action not in KEYBOARD_ONLY and not events.any(
func(e): return e is InputEventJoypadButton or e is InputEventJoypadMotion):
problems.append("%s: no gamepad binding" % action)
for other in actions.slice(i + 1):
for e in events:
for o in InputMap.action_get_events(other):
if e.is_match(o, true): # exact: axis direction and modifiers count
problems.append("%s and %s share %s" % [action, other, e.as_text()])
for p in problems:
printerr("BINDING: ", p)
print("Checked %d actions, %d problems" % [actions.size(), problems.size()])
quit(1 if problems.size() > 0 else 0)
It reads the project's [input] section. Exact matching matters: with the default loose match,
move_left and move_right on the two directions of one stick axis would count as a conflict.
Two actions that are never active at the same time (a menu action and a gameplay action) may
share a key; list such pairs instead of deleting the check.
.inputactions JSON or by listing mapping-context keys.godot-gdscript-headless-testing for the runner and exit codes.consume never clears it, or it fires after a
respawn because nothing calls clear().Time.get_ticks_msec). Use game time from the physics step.device = -1) unless pads are assigned on purpose.== is always false for two separate objects. Use
action_has_event or is_match.references/buffering-and-accessibility.md: read when tuning buffer windows, choosing button
glyphs per controller family (SDL3 positions, Steam Input), building touch controls, or
reviewing an accessibility checklist for controls.platformer: coyote time, jump buffering, variable jump height and jump feel.unity-input-system, unreal-enhanced-input: engine input assets and APIs.save-systems: persisting bindings and input settings.game-ui-ux: menu focus and navigation; camera-systems: look sensitivity and invert.Last verified: 2026-11-11.
Input.is_action_just_pressed is true on the frame or physics tick of the press;
InputEvent.is_match(event, exact_match = true); get_joy_info() fills raw_name,
vendor_id and product_id on Windows, Linux, macOS and iOS, and steam_input_index on
desktop only (https://github.com/godotengine/godot/blob/4.7-stable/doc/classes/Input.xml).What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub antoninmrtl/claude-kit --plugin jeux17 skills in this plugin
/audio-designEngine-neutral game audio technique: bus layout, volume sliders in decibels, loudness, ducking music under dialogue, adaptive music and SFX variation, with Godot, Unity and FMOD/Wwise mappings. Use when mixing a game, making music react to combat, fixing repetitive footsteps or beat sync, or a mix that clips or pumps. Not for the Godot audio API (`godot-audio`).
/codixelChanges how pixel art is made with AI. Instead of drawing from imagination, ask the user for a reference image, pixelate it, rig it, animate it, and check every step with the user. Use whenever the user asks for pixel art of any kind (sprites, characters, creatures, effects, scenes, props, tiles, gems)./designing-mini-gamesDesigns original, compact mini-games — rules, controls, scoring, hazards, and difficulty curves — for any input scheme, including one-button (tap / hold / release) games. Use when defining a new mini-game concept, converting creative constraints or seeds into mechanics, choosing an input scheme, checking state-variable necessity, or preventing idle, hold-only, or mashing play from becoming optimal./evaluating-gameplay-balanceEvaluates and improves gameplay balance from telemetry in any engine. Use when comparing monotonous vs exploratory play, diagnosing death/spawn/scoring/input issues, setting difficulty, timer, or pacing targets with human-limited simulated players, calibrating those players against a person's replays or run summaries across play sessions, checking games whose purchases, upgrades, or loadouts accumulate, or proposing structural balance fixes instead of numeric tuning./exploring-game-design-spaceExplores a broad game-design space by generating structurally varied concepts, attacking obvious failures, mutating promising mechanisms, and returning a small set of distinct testable hypotheses without ranking speculative fun. Use for open-ended game ideation, mechanic-space exploration, game-jam concept search, or deriving multiple mechanical directions from a seed. Do not use merely to audit one existing concept or to choose among a supplied shortlist./game-feelAdds engine-neutral juice to a working mechanic: trauma-based screen shake, hit-stop, eased tweens, squash and stretch, and knockback. Use when the game feels flat, weightless or not punchy, or hits and jumps should feel satisfying. Not for coyote time (`platformer`), input buffering (`input-systems`), camera follow (`camera-systems`) or HUD layout (`game-ui-ux`).