{"id":26943526,"url":"https://github.com/bevious/bevy_actify","last_synced_at":"2025-04-02T17:15:44.504Z","repository":{"id":284309269,"uuid":"954516476","full_name":"bevious/bevy_actify","owner":"bevious","description":"An input action plugin for Bevy","archived":false,"fork":false,"pushed_at":"2025-04-02T06:11:55.000Z","size":68,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T07:23:31.850Z","etag":null,"topics":["bevy","bevy-plugin","input","input-handling"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/bevy_actify","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bevious.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE-2.0","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-25T07:50:13.000Z","updated_at":"2025-04-02T06:21:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5c9e85a-003f-43aa-b685-85df502254c8","html_url":"https://github.com/bevious/bevy_actify","commit_stats":null,"previous_names":["bevious/bevy_actify"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bevious%2Fbevy_actify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bevious%2Fbevy_actify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bevious%2Fbevy_actify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bevious%2Fbevy_actify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bevious","download_url":"https://codeload.github.com/bevious/bevy_actify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246771982,"owners_count":20831135,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bevy","bevy-plugin","input","input-handling"],"created_at":"2025-04-02T17:15:43.945Z","updated_at":"2025-04-02T17:15:44.487Z","avatar_url":"https://github.com/bevious.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/bevious/bevy_actify/blob/main/logo.png?raw=true\" width=\"250\" /\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  An input action plugin for \u003ca href=\"https://bevyengine.org/\"\u003e\u003cstrong\u003eBevy\u003c/strong\u003e\u003c/a\u003e\u003cbr /\u003e\n\u003c/p\u003e\n\u003chr /\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://crates.io/crates/bevy_actify\"\u003e\n    \u003cimg alt=\"crates.io\" src=\"https://img.shields.io/crates/v/bevy_actify\" /\u003e\n  \u003c/a\u003e\n  \u003cimg alt=\"License: MIT OR Apache-2.0\" src=\"https://img.shields.io/badge/license-MIT%2FApache--2.0-blue\" /\u003e\n  \u003cimg alt=\"Bevy version: 0.15\" src=\"https://img.shields.io/badge/Bevy-0.15-pink\" /\u003e\n  \u003ca href=\"https://github.com/bevious/bevy_actify/actions/workflows/cargo.yml\"\u003e\n    \u003cimg alt=\"Action: Test\" src=\"https://github.com/bevious/bevy_actify/actions/workflows/cargo.yml/badge.svg\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nA tiny abstraction layer for input handling in [Bevy](https://bevyengine.org/) that decouples\ninput sources from game logic through clean action-based interfaces.\n\n## Problem\n\nRaw input handling leads to:\n\n- Tight coupling between devices and game logic\n- Code duplication across input methods\n- Messy state management\n\n## How to use\n\n### Basics\n\n#### InputActionDrain\n\n`InputActionDrain` is a system parameter, that is the *vassel* into which the systems *pour* input action state.\n\nFor example a system would read keyboard input and *pour* the state into the appropriate\n`InputActionDrain`.\n\n#### InputActionState\n\n`InputActionState` is a system parameter, that is the source of current input action state. The gameplay system\n(i.e. movement, jump) would read the input action state from this.\n\n#### InputActionReader\n\n`InputActionReader` is a system parameter, that provides an event based interface, similar to `EventReader` (actually it\nuses an event reader under the hood). The read values are of type `InputActionStatus`—an `InputActionStatus` can be one of:\n- `Started` when the input action has just started to be active,\n- `Updated` when the input action has already been active, but the value has changed,\n- `Stopped` when the input action had been active, but now is not.\n\n### Run conditions\n\nThis library provides several input action based system run conditions. Those are:\n- `input_action_active`: The system will run each frame the input action is active\n- `input_action_started`: Similar to `ButtonInput`'s `just_pressed`—will make your system run at the frame on which the action has started\n- `input_action_updated`: The system will run if the state of an input action has changed (i.e. an axis changed direction)\n- `input_action_stopped`: The system will run once the input action gets stopped (i.e. a button has been released)\n\n### Example\n\n```rust\nuse bevy::{prelude::*, input::InputSystem};\nuse bevy_actify::prelude::*;\n\n// 1. Define your action\n#[derive(InputAction, Clone, PartialEq)]\nstruct Jump(f32); // f32 for analog sensetivity\n\n// 2. Map inputs to actions\nfn keyboard_input(keyboard: Res\u003cButtonInput\u003cKeyCode\u003e\u003e, mut action: InputActionDrain\u003cJump\u003e) {\n    if keyboard.pressed(KeyCode::Space) {\n        action.pour(Jump(1f32));\n    }\n}\n\n// 3. Use in game systems\nfn character_jump(action: InputActionState\u003cJump\u003e) {\n    if let Some(state) = action.state() {\n        let jump_power = state.0;\n        // Apply force...\n    }\n}\n\n// 4. Register the input action and systems\nfn main() {\n  App::new()\n    .add_plugins(DefaultPlugins)\n    .add_input_action::\u003cJump\u003e()\n    .add_systems(PreUpdate, keyboard_input.after(InputSystem).before(InputActionSystem)) // properly order your systems to avoid 1 frame delay!\n    .add_systems(Update, character_jump)\n    .run();\n}\n```\n\n## How to contribute\n\nFork repository, make changes, and send us a pull request.\n\nWe will review your changes and apply them to the main\nbranch shortly, provided they don't violate our quality standards.\n\n## License\n\nThis project is dual-licensed under:\n\n- [MIT License](LICENSE-MIT)\n- [Apache 2.0 License](LICENSE-APACHE-2.0)\n\nYou may choose either license at your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbevious%2Fbevy_actify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbevious%2Fbevy_actify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbevious%2Fbevy_actify/lists"}