Ignore text in KeyPressed with private use chars
Apparently, macOS likes to use these for simple keys.
This commit is contained in:
parent
f67db901ff
commit
a9733e9906
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 {
|
||||
c >= '\u{E000}' && c <= '\u{F8FF}'
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue