/bevy-skills:bevy-input-actionsfrom bevy-skills
Provides patterns for Bevy 0.20 input: rebindable actions, gamepad hot-plugging, deadzones, Steam Deck support, accessibility controllers, and deterministic FixedUpdate transfer.
Ships in bevy-skills. 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.
FixedUpdate simulation.Gameplay consumes logical actions, never raw keys or a hard-coded controller entity. Translate Bevy's frame input into an action state once, then feed presentation and fixed simulation from that state.
Bevy updates raw input in PreUpdate inside InputSystems. Run the translator after
that set so ButtonInput, Gamepad, input messages, and accumulated mouse motion
represent the current frame:
use bevy::{input::InputSystems, prelude::*};
fn install_input(app: &mut App) {
app.init_resource::<ActionBuffer>().add_systems(
PreUpdate,
translate_physical_input.after(InputSystems),
);
}
#[derive(Resource, Default)]
struct ActionBuffer;
fn translate_physical_input(mut _actions: ResMut<ActionBuffer>) {}
keyboard / mouse / touch / Gamepad entities / Steam Input
|
v
physical bindings + device calibration
|
v
active action set/context + conflict policy
|
v
frame action state + ordered transition queue
| |
Update/UI consumers fixed-tick bridge
Use stable serialized action IDs such as gameplay.jump, menu.confirm, and
camera.look. Bindings, labels, prompts, save data, and analytics refer to those IDs;
Rust enum discriminants and catalog order are not persistence contracts.
For an edge whose precise per-device-stream order matters, translate the underlying
keyboard, mouse, or gamepad messages into an ordered queue. A single just_pressed
boolean cannot represent two transitions or their order. Held state and filtered axes
may be stored as the latest values.
fn inspect_gamepads(gamepads: Query<(Entity, &Gamepad)>) {
for (entity, gamepad) in &gamepads {
let move_x = gamepad.get(GamepadAxis::LeftStickX).unwrap_or(0.0);
let jump_started = gamepad.just_pressed(GamepadButton::South);
let _sample = (entity, move_x, jump_started);
}
}
Use GamepadConnectionEvent for connection changes and GamepadEvent when relative
ordering among connection, button, and axis changes matters. Store active-player
assignment separately from bindings. An ECS Entity is a live device handle, not a
stable device identity or save-file key.
Configure per-device filtering through its GamepadSettings component. Apply an
inner deadzone, optional outer calibration, response curve, and final clamp once.
Do not apply a second hidden deadzone in gameplay code.
Raw input is frame-scoped; fixed simulation may run zero, one, or many ticks in that frame. Therefore:
just_pressed or AccumulatedMouseMotion independently in each
FixedUpdate iteration.For rollback/network simulation, convert the bridge output into an explicit command frame keyed by simulation tick and retain it for replay.
Capture through the primary window's CursorOptions: hide the cursor and request
CursorGrabMode::Locked when gameplay owns look input. On focus loss, pause or
neutralise gameplay input, release capture, synthesize required action releases, and
clear relative motion. Reacquire only from an intentional user gesture; never trap
the pointer merely because focus returned.
Keyboard state is released by Bevy on focus loss, while gamepad state is independent of window focus. Your action layer still needs one policy that prevents stuck or unexpected gameplay actions.
GamepadButton::Other(u32) / GamepadAxis::Other(u32) (were u8).On<PointerPress> with
event.pointer.position, not On<Pointer<Press>> with pointer_location.EntityCursor, DefaultCursor, CursorIconPlugin live in
bevy::picking::cursor; the custom_cursor feature belongs to bevy_picking.
CursorOptions (grab mode, visibility) is still a window-entity component:
Single<&mut CursorOptions, With<PrimaryWindow>>.chain_weak relaxed several built-in schedules; PreUpdate/InputSystems
is not one of them, and .after(InputSystems) is still a strict edge.InputFocus fields are private (set/get/clear), and
bevy_input_focus is no longer implied by the picking feature.MessageReader<GamepadConnectionEvent>,
not EventReader.| Problem | Read |
|---|---|
| Stable actions, binding grammar, contexts, rebinding and conflicts | Actions and rebinding |
| Device assignment, hot-plug, deadzones, Steam Deck and adaptive hardware | Gamepads and platforms |
| Edge queues, mouse accumulation, zero/multiple fixed ticks, rollback | Fixed-step buffering |
bevy-a11y — action accessibility and controller acceptance criteria.bevy-core-concepts — PreUpdate, Update, and FixedUpdate.bevy-testing — deterministic fixed-step input tests.bevy-migration-0-19-to-0-20 — cursor module move, flat pointer events.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub chrisgliddon/bevy-skills --plugin bevy-skills32 skills in this plugin
/bevyUse when starting any Bevy task, choosing between Update and FixedUpdate, picking Cargo feature flags, or recalling which sibling skill covers ECS, assets, rendering, UI, or migration. Routes to the right Bevy 0.20 skill and pins the engine version for downstream snippets./bevy-a11yUse when designing or auditing high-standard video-game accessibility in Bevy 0.20, integrating screen readers and focus navigation, supporting adaptive controllers and complete remapping, implementing captions or audio description, checking contrast and motion safety, or building disabled-player test evidence./bevy-animationUse when wiring `AnimationPlayer` + `AnimationGraphHandle`, building an `AnimationGraph` from glTF clips, blending state-driven animations with `AnimationTransitions::play`, isolating body parts with `AnimationMask`, firing gameplay sync via `#[derive(AnimationEvent)]` + `On<E>` observers, tweening with `AnimatableCurve` / `EaseFunction` / `CubicSegment::new_bezier_easing` from `bevy::curve`, or applying the 12 Basic Principles of Animation to 3D characters in Bevy 0.20./bevy-assetsUse when loading with `AssetServer::load` or `AssetServer::load_builder().with_settings(..)`, holding a `Handle<T>`, spawning a glTF scene with `WorldAssetRoot` (`Handle<WorldAsset>`), mutating through `Assets::get_mut` / `AssetMut`, polling `LoadState::is_loaded`, resolving an `AssetPath`, or replacing `AssetId::invalid()` with `Option<AssetId<T>>` in Bevy 0.20./bevy-audioUse when implementing audio in Bevy 0.20 with `AudioPlayer`, `PlaybackSettings`, `AudioSink` or `SpatialAudioSink`, spatial listeners, application mix groups, ambience/music transitions, asset lifetime, browser gesture restrictions, or choosing built-in audio versus `bevy_seedling 0.8`./bevy-camerasUse when spawning `Camera3d` or `Camera2d`, choosing a `Projection`, rendering to an image with the `RenderTarget` component, adding `Hdr` / `Tonemapping::Linear` / `ScreenSpaceTransmission` to a camera, wiring `FreeCamera`, `PanCamera` or the new `PanOrbitCamera` from `bevy::camera_controller`, ordering views with `Camera::order`, or setting a per-camera `AmbientLight` in Bevy 0.20.Other plugins' skills for the same job