Winit Input Helper

Processes and store winit events, allowing input state to be queried at any time.

How to use

The WinitInputHelper struct takes events via the update or update_from_vec methods.
The current input state can then be accessed via methods such as key_pressed, key_released, key_held, mouse, mouse_diff etc.

externcrate winit;externcrate winit_input_helper;usewinit::{EventsLoop, VirtualKeyCode};usewinit_input_helper::WinitInputHelper;fnmain(){letmut input =WinitInputHelper::new();letmut events_loop =EventsLoop::new();let _window =winit::WindowBuilder::new().build(&events_loop).unwrap();loop{// call this once per loop
input.update(&mut events_loop);// call these as many times as you wantif input.key_pressed(VirtualKeyCode::A){println!("The 'A' key was pressed on the keyboard");}}}