eframe: Fix inputting of the letter P on web (#2740)

* eframe: Fix inputting of the letter P on web

* Update changelog

* silence clippy
This commit is contained in:
Emil Ernerfeldt 2023-02-15 08:24:52 +01:00 committed by GitHub
parent 38849fe381
commit e2778d9d6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -5,6 +5,7 @@ NOTE: [`egui-winit`](../egui-winit/CHANGELOG.md), [`egui_glium`](../egui_glium/C
## Unreleased ## Unreleased
* Fix typing the letter 'P' on web ([#2740](https://github.com/emilk/egui/pull/2740)).
## 0.21.2 - 2023-02-12 ## 0.21.2 - 2023-02-12

View file

@ -94,7 +94,12 @@ pub fn install_document_events(runner_container: &mut AppRunnerContainer) -> Res
// egui wants to use tab to move to the next text field. // egui wants to use tab to move to the next text field.
true true
} else if egui_key == Some(Key::P) { } else if egui_key == Some(Key::P) {
true // Prevent ctrl-P opening the print dialog. Users may want to use it for a command palette. #[allow(clippy::needless_bool)]
if modifiers.ctrl || modifiers.command || modifiers.mac_cmd {
true // Prevent ctrl-P opening the print dialog. Users may want to use it for a command palette.
} else {
false // let normal P:s through
}
} else if egui_wants_keyboard { } else if egui_wants_keyboard {
matches!( matches!(
event.key().as_str(), event.key().as_str(),