Merge pull request #2295 from iced-rs/ignore-private-use-chars
Ignore `text` in `KeyPressed` with private use chars
This commit is contained in:
commit
58a7007ac1
1 changed files with 6 additions and 1 deletions
|
|
@ -224,7 +224,7 @@ pub fn window_event(
|
|||
// TODO: Fix inconsistent API on Wasm
|
||||
event.text
|
||||
}
|
||||
};
|
||||
}.filter(|text| !text.as_str().chars().any(is_private_use));
|
||||
|
||||
let winit::event::KeyEvent {
|
||||
state, location, ..
|
||||
|
|
@ -839,3 +839,8 @@ pub fn icon(icon: window::Icon) -> Option<winit::window::Icon> {
|
|||
|
||||
winit::window::Icon::from_rgba(pixels, size.width, size.height).ok()
|
||||
}
|
||||
|
||||
// See: https://en.wikipedia.org/wiki/Private_Use_Areas
|
||||
fn is_private_use(c: char) -> bool {
|
||||
('\u{E000}'..='\u{F8FF}').contains(&c)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue