Prevent unintended keyboard input during focus.
This commit is contained in:
parent
17b35df160
commit
6ed88f7608
1 changed files with 2 additions and 0 deletions
|
|
@ -191,6 +191,8 @@ pub fn window_event(
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// Ignore keyboard presses/releases during window focus/unfocus
|
||||||
|
WindowEvent::KeyboardInput { is_synthetic, .. } if is_synthetic => None,
|
||||||
WindowEvent::KeyboardInput { event, .. } => Some(Event::Keyboard({
|
WindowEvent::KeyboardInput { event, .. } => Some(Event::Keyboard({
|
||||||
let key = {
|
let key = {
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue