bevy-input

Provide a structured reference for keyboard, mouse, touch, and gamepad input in Bevy.

125|10|Updated Nov 22, 2022
One-click install
npx skills add https://github.com/nolantait/bevy-starter --skill bevy-input
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bevy-input
Source: https://github.com/nolantait/bevy-starter/tree/main/.agents/skills/bevy-input
Command: npx skills add https://github.com/nolantait/bevy-starter --skill bevy-input

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Bevy projects often struggle to unify input handling across keyboard, mouse, touch, and gamepad, mixing events and resources and managing physical vs logical keys. This Skill provides a concise guide to bevy_input usage to streamline cross-device input in Bevy 0.19.

Core Features & Use Cases

  • Demonstrates how to access input via both events (MessageReader) and resources (ButtonInput<...>) to query state.
  • Covers keyboard, mouse, touch, and gamepad input, plus modifiers and enhanced input patterns.
  • Suitable for implementing reliable player controls, camera input, and UI navigation across devices.

Quick Start

Import the bevy_input crate and start querying ButtonInput and related resources in your Bevy app to handle cross-device input immediately.

Frequently Asked Questions about bevy-input

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

FAQPage Schema
How do I handle keyboard and gamepad input in Bevy?

Detect pressed, just_pressed, and just_released input states in Bevy by querying ButtonInput resources and EventReaders to unify keyboard, mouse, touch, and gamepad input handling.

What is the difference between event-based and resource-based input handling in Bevy?

Event-based input in Bevy processes discrete occurrences via MessageReader, whereas resource-based input queries continuous button states using ButtonInput resources for state detection.

How do I query just_pressed and just_released states for cross-device input in Bevy?

Query just_pressed and just_released states in Bevy by accessing ButtonInput resources for keyboard, mouse, touch, and gamepad devices to manage cross-device input modalities.

Does bevy_input support touch and gamepad input for player controls?

Bevy_input supports touch and gamepad input alongside keyboard and mouse, providing structured state queries and event patterns for implementing reliable player controls across devices.

How do I manage key modifiers in Bevy input handling?

Manage key modifiers in Bevy by querying ButtonInput resources to check for simultaneous key presses, enabling enhanced input flows for complex game controls.