nightshade 0.14.0

A cross-platform data-oriented game engine.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Convenience accessors that resolve to the primary input state.

use crate::ecs::input::resources::{Keyboard, Mouse};
use crate::ecs::world::World;

/// Returns the mouse state from the window currently receiving user
/// input.
pub fn mouse_for_active(world: &World) -> &Mouse {
    &world.resources.input.mouse
}

/// Returns the keyboard state from the window currently receiving user
/// input.
pub fn keyboard_for_active(world: &World) -> &Keyboard {
    &world.resources.input.keyboard
}