Crates.io | bevy_global_input |
lib.rs | bevy_global_input |
version | 0.4.0 |
source | src |
created_at | 2022-11-23 22:04:44.613279 |
updated_at | 2023-07-16 10:01:25.452914 |
description | Global mouse + keyboard input for bevy - doesn't require a focused window. |
homepage | |
repository | https://github.com/laundmo/bevy_global_input |
max_upload_size | |
id | 721895 |
size | 115,631 |
Global Mouse and Keyboard events for bevy.
log out global mouse position every half second.
use std::time::Duration;
use bevy::{prelude::*, time::common_conditions::on_timer};
use bevy_global_input::{GlobalInputPlugins, GlobalMousePos};
fn main() {
App::new()
.add_plugins(MinimalPlugins)
.add_plugins(GlobalInputPlugins)
.add_systems(
Update,
mouse_pos.run_if(on_timer(Duration::from_secs_f32(0.5))),
);
// .run();
}
fn mouse_pos(pos: Res<GlobalMousePos>) {
dbg!(pos);
}
Find more in Examples
bevy | bevy_global_input |
---|---|
0.11 | 0.4.0 |
0.10 | 0.3.0 |
0.9 | 0.2.0 |
0.9 | 0.1.0 |