We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I wonder if it's well supported. It only received an event when Xbox button released(RawKeyEvent and KeyboardInput). Tested on Windows 10.
Here is my example code
use winit::{ event::{DeviceEvent, Event, RawKeyEvent, WindowEvent}, event_loop::EventLoop, window::WindowBuilder, }; fn main() -> Result<(), impl std::error::Error> { let event_loop = EventLoop::new().unwrap(); let window = WindowBuilder::new() .with_title("A fantastic window!") .with_inner_size(winit::dpi::LogicalSize::new(128.0, 128.0)) .build(&event_loop) .unwrap(); event_loop.run(move |event, elwt| { // match event { Event::WindowEvent { window_id, event } => match event { WindowEvent::KeyboardInput { device_id, event, is_synthetic, } => { println!("[KEYBOARD_EVENT] {:?}", event) } WindowEvent::CloseRequested => { elwt.exit(); } _ => {} }, Event::DeviceEvent { device_id, event: device_event, } => match device_event { DeviceEvent::Button { button, state } => { println!("[BUTTON] {:?} state {:?}", button, state); } DeviceEvent::Key(RawKeyEvent { physical_key, state, }) => { println!("[PHYSICAL] key {:?} state {:?}", physical_key, state); } _ => {} }, _ => {} } }) }
The text was updated successfully, but these errors were encountered:
gamepads are not supported yet #944.
Sorry, something went wrong.
No branches or pull requests
I wonder if it's well supported. It only received an event when Xbox button released(RawKeyEvent and KeyboardInput).
Tested on Windows 10.
Here is my example code
The text was updated successfully, but these errors were encountered: