not-fl3 / macroquad

Cross-platform game engine in Rust.
Apache License 2.0
3.39k stars 327 forks source link

Keypresses don't work on wayland #848

Open treeshateorcs opened 1 month ago

treeshateorcs commented 1 month ago
use macroquad::prelude::*;

fn window_conf() -> Conf {
  use macroquad::miniquad;

  Conf {
    window_title: "window".to_owned(),
    fullscreen: false,
    platform: miniquad::conf::Platform {
      linux_backend: miniquad::conf::LinuxBackend::WaylandOnly,
      ..Default::default()
    },
    ..Default::default()
  }
}

#[macroquad::main(window_conf)]
async fn main() {
  loop {
    if is_key_down(KeyCode::Escape) {
      return;
    }
    if is_key_pressed(KeyCode::Escape) {
      return;
    }
    if is_key_released(KeyCode::Escape) {
      return;
    }
    next_frame().await;
  }
}

none of those functions work. i'm using sway (wlroots)

treeshateorcs commented 1 month ago

same code works fine in i3

treeshateorcs commented 2 weeks ago

version 0.3.20 works

p.s. wait, no, sorry it doesn't work. i forgot that i was testing in xwayland