Expand description
#[system] fn player_control(ctx: &mut Context) { let input = ctx.input();
// Raw input
if input.just_key_pressed(KeyCode::Space) {
jump();
}
// Action-based (recommended)
if input.is_action_pressed("MoveForward") {
move_forward();
}
if input.just_action_pressed("Fire") {
shoot();
}}
fn main() { Kon::new() .add_plugin(DefaultPlugins) .add_system(player_control) .run(); }
Modules§
Structs§
- Input
- Input state manager
- Input
Plugin - Input Plugin - registers Input and processes input events
Enums§
- Input
Source - Defines an input source that can trigger an action
Traits§
- Context
Input Ext - Extension trait for convenient Input access from Context