From cedc018b137fcf52a79d64dc6ae2a1eb93b9ab79 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 15 Feb 2023 08:13:06 +0100 Subject: [PATCH 1/3] eframe: Fix inputting of the letter P on web --- crates/eframe/src/web/events.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/eframe/src/web/events.rs b/crates/eframe/src/web/events.rs index 4d49196d628..49568596344 100644 --- a/crates/eframe/src/web/events.rs +++ b/crates/eframe/src/web/events.rs @@ -94,7 +94,11 @@ 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. + 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(), From 0a6f93d0a8a07aa448a8ff55cdeb70dc14cab97f Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 15 Feb 2023 08:14:00 +0100 Subject: [PATCH 2/3] Update changelog --- crates/eframe/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/eframe/CHANGELOG.md b/crates/eframe/CHANGELOG.md index 624f8e9697a..164b16d706e 100644 --- a/crates/eframe/CHANGELOG.md +++ b/crates/eframe/CHANGELOG.md @@ -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 From c9e5d01a3777aa7903088d0fe79278a75e7ee920 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 15 Feb 2023 08:16:58 +0100 Subject: [PATCH 3/3] silence clippy --- crates/eframe/src/web/events.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/eframe/src/web/events.rs b/crates/eframe/src/web/events.rs index 49568596344..d85adaa3a5e 100644 --- a/crates/eframe/src/web/events.rs +++ b/crates/eframe/src/web/events.rs @@ -94,6 +94,7 @@ 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) { + #[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 {