buttons

A simple Rust crate for managing and querying input state.

Build Status Crates.io Docs.rs

Usage

With winit

(Enabling the winit-support feature.)

```rust let mut keyboard = buttons::winitsupport::keyboard(); let mut mouse = buttons::winitsupport::mouse();

{
    let mut keyboard_input = keyboard.begin_frame_input();
    let mut mouse_input = mouse.begin_frame_input();

    events_loop.poll_events(|event| {
        if let Event::WindowEvent { event, .. } = event {
            keyboard_input.handle_event(&event);
            mouse_input.handle_event(&event);
        }
    });
}

if keyboard.pressed(VirtualKeyCode::Escape) || mouse.released(MouseButton::Right) {
    ...
}

```