You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, been trying to make a simple application but mouse event don't seem to have any callback whatsoever, CursorPos and MouseButton at least.
Here's my code in the while loop in match event:
WindowEvent::Key(key, scancode, action, modifiers) => {if action == Action::Press{if key == Key::Escape{
window.native_window.set_should_close(true);}if key == Key::E{println!("E key is being pressed");}}}WindowEvent::CursorPos(x_pos, y_pos) => {println!("Mouse Movement Event!");println!("x pos: {}", x_pos);if x_pos >= 800.0{println!("Mouse is at the right part of the window.")}}WindowEvent::MouseButton(button, action, modifiers) => {println!("Mouse Button Event!");if action == Action::Press{if button == MouseButtonLeft{println!("Left Mouse Click!");}}}
KeyPress works without any problems, prints out the text, but no matter what I do with the mouse, nothing is getting printed out, co cursor position, no button presses.
Details:
Garuda Linux, Gnome 41, X11, linux-zen 5.15.11
Rust 2021 Edition
Dependencies:
gl - 0.14.0
glfw - 0.43.0
gl_generator - 0.14.0 (generating v4.6 bindings and set this version as windowHint as well)
khronos_api - 3.1.0
Thanks!
The text was updated successfully, but these errors were encountered:
Hello, been trying to make a simple application but mouse event don't seem to have any callback whatsoever, CursorPos and MouseButton at least.
Here's my code in the while loop in match event:
KeyPress works without any problems, prints out the text, but no matter what I do with the mouse, nothing is getting printed out, co cursor position, no button presses.
Details:
Thanks!
The text was updated successfully, but these errors were encountered: