Action Maps
A dynamic action mapping system for Bevy.
Why Action Maps?
Action maps provides an interface similar to Unity's InputSystem and Godot's Input Map. With Action Maps, you can assign functionality to any available Bevy input item without having to work directly with they inputs themselves.
At the moment, this only applies to button type inputs. Axis type inputs are planned to be implemented in the future.
Defining Actions
Under the hood, actions only use a String to keep track of their identity. Defining actions is as easy as inserting the name of the action and the input for the action into the control scheme.
Handling input
Action maps are wrappers around the existing Bevy Input<T>, so the interface
for using them is exactly the same.
use *;
A Different Way
Action maps methods all accept any item which implements Into<Action>.
Universal Input
Action maps provides another layer to help you define keybindings:
UniversalInput. UniversalInput is a simple wrapper over every button-type
input device available in Bevy. Action maps methods can take any of these input
types and use them just the same.
Using ScanCodes
Action maps provides a helper function action_maps::get_scan_code to
assist in using ScanCodes in Bevy. This function is extremely rudimentary and
likely prone to missing keys (not to mention completely lacking support for
Linux). Hopefully, it will be made unnecessary with
this PR and Bevy 0.13.
let qwerty_w_scancode = get_scan_code;
Examples
See examples/keyboard_and_mouse.rs for a complete mockup of how action maps
work in practice.