From 9e13ea9c400ce5d0cc650c212cbe686069b741f3 Mon Sep 17 00:00:00 2001 From: Twest2 Date: Tue, 7 Jul 2026 12:45:49 -0500 Subject: [PATCH] Fix zoom-in accelerators --- app/main.js | 8 +++++--- tests/unit/shortcut-utils.test.js | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/main.js b/app/main.js index 0a5001f..ad7e567 100644 --- a/app/main.js +++ b/app/main.js @@ -409,13 +409,15 @@ function createWindow() { function registerHotkeys() { globalShortcut.unregisterAll(); const zoomBindings = [ - ['CommandOrControl+=', 'in'], + ['CommandOrControl+Plus', 'in'], ['CommandOrControl+Shift+=', 'in'], - ['CommandOrControl+Add', 'in'], + ['CommandOrControl+=', 'in'], + ['CommandOrControl+numadd', 'in'], ['CommandOrControl+-', 'out'], ['CommandOrControl+Minus', 'out'], - ['CommandOrControl+Subtract', 'out'], + ['CommandOrControl+numsub', 'out'], ['CommandOrControl+0', 'fit'], + ['CommandOrControl+num0', 'fit'], ]; for (const [accel, kind] of zoomBindings) { try { diff --git a/tests/unit/shortcut-utils.test.js b/tests/unit/shortcut-utils.test.js index db8823c..cf196b2 100644 --- a/tests/unit/shortcut-utils.test.js +++ b/tests/unit/shortcut-utils.test.js @@ -11,6 +11,7 @@ const { test('zoom shortcut helper recognizes zoom in, out, and fit across event shapes', () => { assert.equal(zoomShortcutFromKeyboardEvent({ ctrlKey: true, key: '=', code: 'Equal' }), 'in'); assert.equal(zoomShortcutFromKeyboardEvent({ ctrlKey: true, key: '+', code: 'NumpadAdd' }), 'in'); + assert.equal(zoomShortcutFromKeyboardEvent({ ctrlKey: true, key: 'Plus', code: 'Equal' }), 'in'); assert.equal(zoomShortcutFromKeyboardEvent({ ctrlKey: true, key: '-', code: 'Minus' }), 'out'); assert.equal(zoomShortcutFromKeyboardEvent({ metaKey: true, key: '0', code: 'Digit0' }), 'fit'); assert.equal(zoomShortcutFromKeyboardEvent({ ctrlKey: true, key: '=', code: 'Equal', shiftKey: true }), 'in'); @@ -18,6 +19,8 @@ test('zoom shortcut helper recognizes zoom in, out, and fit across event shapes' test('zoom shortcut helper recognizes Electron before-input-event payloads', () => { assert.equal(zoomShortcutFromInputEvent({ control: true, key: '=', code: 'Equal' }), 'in'); + assert.equal(zoomShortcutFromInputEvent({ control: true, key: '=', code: 'Equal', shift: true }), 'in'); + assert.equal(zoomShortcutFromInputEvent({ control: true, key: 'Plus', code: 'Equal', shift: true }), 'in'); assert.equal(zoomShortcutFromInputEvent({ control: true, key: '-', code: 'Minus' }), 'out'); assert.equal(zoomShortcutFromInputEvent({ meta: true, key: '0', code: 'Digit0' }), 'fit'); });