neuton 0.2.0

A Game Engine for Rust on top of SDL2
Documentation
1
2
3
4
5
use sdl2::{event::Event, keyboard::Keycode};

pub fn keyboard_pressed(event: &Event, key: Keycode) -> bool {
    matches!(event, Event::KeyDown { keycode: Some(k), .. } if *k == key)
}