From dc90cd3919e6760ab28c8b781e5c864bf836240e Mon Sep 17 00:00:00 2001 From: Tobias Assarsson Date: Sat, 15 Mar 2025 14:16:29 +0100 Subject: [PATCH] fix(core): add ctrl '+' key as zoom in (#12911) * add '+' key as zoom in * add changefile --------- Co-authored-by: Lucas Nogueira --- .changes/fix-zoom.md | 5 +++++ crates/tauri/src/webview/scripts/zoom-hotkey.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changes/fix-zoom.md diff --git a/.changes/fix-zoom.md b/.changes/fix-zoom.md new file mode 100644 index 000000000..d423bc8d6 --- /dev/null +++ b/.changes/fix-zoom.md @@ -0,0 +1,5 @@ +--- +"tauri": patch:bug +--- + +Listen for `Ctrl +` or `Cmd +` to support zoom functionality in swedish keyboard layouts. diff --git a/crates/tauri/src/webview/scripts/zoom-hotkey.js b/crates/tauri/src/webview/scripts/zoom-hotkey.js index f3ff01cdd..cabd53f48 100644 --- a/crates/tauri/src/webview/scripts/zoom-hotkey.js +++ b/crates/tauri/src/webview/scripts/zoom-hotkey.js @@ -13,7 +13,7 @@ window.addEventListener('keydown', (event) => { if (OS_NAME === 'macos' ? event.metaKey : event.ctrlKey) { if (event.key === '-') { zoomLevel -= 0.2 - } else if (event.key === '=') { + } else if (event.key === '=' || event.key === '+') { zoomLevel += 0.2 } else if (event.key === '0') { zoomLevel = 1