eframe web: prevent default action on command-comma (#7547)

This commit is contained in:
Emil Ernerfeldt 2025-09-17 08:12:50 +02:00 committed by GitHub
parent 603dba29e6
commit 6ac155c5cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -227,9 +227,10 @@ fn should_prevent_default_for_key(
// 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
egui::Key::Comma, // cmd-, opens options on macOS, which egui apps may wanna "steal"
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) {