jeremyletang / rust-sfml

SFML bindings for Rust
Other
638 stars 88 forks source link

Scancodes are private and thus unusable #311

Closed andreymal closed 1 year ago

andreymal commented 1 year ago

I tried to make a typical event handling:

match event {
    sfml::window::Event::KeyPressed { scan, .. } => {
        match scan {
            sfml::ffi::window::Scancode::Escape => { /* ... */ },
            _ => { /* ... */ },
        }
    },
    _ => { /* ... */}
}

...but got an error[E0603]: module `ffi` is private

I guess someone forgot to add pub use crate::ffi::window::Scancode; in src/window/keyboard.rs

(UPD: and then pub use self::keyboard::Scancode in src/window/mod.rs)

andreymal commented 1 year ago

Oh no, scan is not even implemented for KeyReleased

crumblingstatue commented 1 year ago

Sorry, currently scancodes are not fully implemented. Pull requests are welcome!

crumblingstatue commented 1 year ago

This should be resolved by #313. Let me know if you have any problems!