Kurinji Input Map

Input map plugin for bevy

(Note* Previously called bevy_prototype_input_map)

kurinji

Decouples gameplay code from device specific input api. Converts user inputs from different input hardware into game specific actions, eg. keyboard "Space" or joystick "A" can be mapped to "Jump" Action.

Usage

Add to Cargo.toml dependencies [dependencies] kurinji = "*"

```rust fn main() { App::build() .addplugin(KurinjiPlugin::default()) .addstartupsystem(setup.system()) .addsystem(system.system()) .run(); }

fn setup( mut kurinji: ResMut, ) { // with data // refer "example/config/gamepad.ron" let bindingron = fs::readtostring("example/config/gamepad.ron").unwrap() kurinji.setbindingswithron(&binding_ron);

// or

// via code
kurinji
.bind_keyboard_pressed(KeyCode::Return, "SHOOT")
.bind_mouse_motion(Axis::YNegative, "AIM_UP")
.set_dead_zone("AIM_UP", 0.1)

}

// system fn system(kurinji: Res) { if inputmap.isaction_active("SHOOT") { println!("Bang..."); } ```

*Check out examples

Example

Use commands

Via Code

cargo run --example keyboardmousewith_code

cargo run --example gamepadwithcode

Via JSON/RON

cargo run --example keyboardmousewith_json

cargo run --example gamepadwithron

For Action Events Usage

cargo run --example withactionevents

Features

Note* Latest commit on master branch might be unstable. Use the release tags if you are looking for stable commits or grab crate from https://crates.io/crates/kurinji

Bug Report

https://github.com/PradeepKumarRajamanickam/kurinji/issues

Release Notes

v1.0.5 (22 dec, 2020)

v1.0.4 (3 dec, 2020)

v1.0.3 (26 Nov, 2020)

v1.0.0/1/2 (21 Nov, 2020)

v0.1.5 (18 Nov, 2020)

v0.1.4 (03 Oct, 2020)

v0.1.3 (18 Sept, 2020)

v0.1.2 (14 Sept, 2020)

v0.1.1 (7 Sept, 2020)

v0.1.0 (7 Sept, 2020)

Author

Pradeep Kumar Rajamanickam

Acknowledgments

Inspired by - Godot Input Mapper [https://godotengine.org/article/handling-axis-godot] - Unreal Action/Axis Mapping [https://docs.unrealengine.com/en-US/Gameplay/Input/index.html]