emoon / rust_minifb

Cross platfrom window and framebuffer crate for Rust
MIT License
1.04k stars 99 forks source link

[Left/RightShift + <key>] not picked up by get_keys on wayland #349

Open bhavyakukkar opened 7 months ago

bhavyakukkar commented 7 months ago

When pressing the Left/Right-Shift key first, followed by any other key, the set of keys down returned by get_keys only contains the Left/Right-Shift key on the wayland build.

This is a program to demonstrate the issue:

use minifb::{Key, Window, WindowOptions, KeyRepeat};

fn main() {
    let mut buffer: Vec<u32> = vec![0; 200*200];
    let mut window = Window::new("", 200, 200, WindowOptions::default()).unwrap();

    window.limit_update_rate(Some(std::time::Duration::from_micros(16600)));

    loop {
        if window.is_open() {
            let keys = window.get_keys();
            if keys.len() == 2 {
                panic!("Received these two keys: {:?}", keys);
            }

            window
                .update_with_buffer(&buffer, 200, 200)
                .unwrap();
        }
    }
}

This program,

I have tested:

Additionally,

emoon commented 7 months ago

Thanks for the report