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
The keymod field of Event::KeyDown is always 0 (checked with keymod.bits()) regardless of CTRL/SHIFT/ALT state.
This was working for me recently, but after running rustup update and cargo update today I cannot get it to work again.
rustup update
cargo update
My OS is Windows 10.
> rustc --version rustc 1.15.0-nightly (71c06a56a 2016-12-18)
I have tried:
[dependencies.sdl2] version = "=0.27.0"
and
[dependencies.sdl2] version = "=0.27.1"
Some example code which demostrates this issue:
src/main.rs
extern crate sdl2; use sdl2::event::Event; fn main() { let sdl2_context = sdl2::init().expect("failed to initialize sdl2"); let video = sdl2_context.video().expect("failed to get sdl2 video context"); let mut event_pump = sdl2_context.event_pump().expect("failed to get sdl2 event pump"); let window = video.window("Keymod Test", 640, 480) .position_centered() .opengl() .build() .expect("failed to create window"); let mut renderer = window.renderer() .present_vsync() .build() .expect("failed to create renderer"); 'event: loop { for event in event_pump.poll_iter() { match event { Event::Quit { .. } => break 'event, Event::KeyDown { keycode, keymod, .. } => { println!("keycode: {:?}, keymod: {}", keycode, keymod.bits()); } _ => {} } } renderer.clear(); renderer.present(); } }
Cargo.toml
[package] name = "keymod_test" version = "0.1.0" [dependencies] sdl2="0.27"
Just hold CTRL/SHIFT/ALT and spam other keyboard keys. keymod is always 0.
The text was updated successfully, but these errors were encountered:
Related to #579 and #575
Let me patch this real quick it should be fine by the end of the day
Sorry, something went wrong.
Up in sdl2 0.27.2
Fantastic, thank you!
No branches or pull requests
The keymod field of Event::KeyDown is always 0 (checked with keymod.bits()) regardless of CTRL/SHIFT/ALT state.
This was working for me recently, but after running
rustup update
andcargo update
today I cannot get it to work again.My OS is Windows 10.
I have tried:
and
Some example code which demostrates this issue:
src/main.rs
Cargo.toml
Just hold CTRL/SHIFT/ALT and spam other keyboard keys. keymod is always 0.
The text was updated successfully, but these errors were encountered: