1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 21:30:03 -04:00

Merge branch 'emilk:master' into common-panels

This commit is contained in:
Bruno Paré-Simard
2025-02-06 12:39:22 -05:00
committed by GitHub
120 changed files with 1823 additions and 788 deletions

View File

@@ -219,9 +219,16 @@ fn should_prevent_default_for_key(
// * cmd-shift-C (debug tools)
// * cmd/ctrl-c/v/x (lest we prevent copy/paste/cut events)
// Prevent ctrl-P from opening the print dialog. Users may want to use it for a command palette.
if egui_key == egui::Key::P && (modifiers.ctrl || modifiers.command || modifiers.mac_cmd) {
return true;
// Prevent cmd/ctrl plus these keys from triggering the default browser action:
let keys = [
egui::Key::O, // open
egui::Key::P, // print (cmd-P is common for command palette)
egui::Key::S, // save
];
for key in keys {
if egui_key == key && (modifiers.ctrl || modifiers.command || modifiers.mac_cmd) {
return true;
}
}
if egui_key == egui::Key::Space && !runner.text_agent.has_focus() {