Skip to content

Commit

Permalink
eframe: Fix inputting of the letter P on web (#2740)
Browse files Browse the repository at this point in the history
* eframe: Fix inputting of the letter P on web

* Update changelog

* silence clippy
  • Loading branch information
emilk authored Feb 15, 2023
1 parent 38849fe commit e2778d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions crates/eframe/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ NOTE: [`egui-winit`](../egui-winit/CHANGELOG.md), [`egui_glium`](../egui_glium/C


## Unreleased
* Fix typing the letter 'P' on web ([#2740](https://github.com/emilk/egui/pull/2740)).


## 0.21.2 - 2023-02-12
Expand Down
7 changes: 6 additions & 1 deletion crates/eframe/src/web/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
true
} 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 {
matches!(
event.key().as_str(),
Expand Down

0 comments on commit e2778d9

Please sign in to comment.