Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Desktop: Ctrl + numpad +/-/0 do not zoom (Electron zoomIn/zoomOut/resetZoom role accelerators match main keyboard only)

Open Beginner friendly
#10,503 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
electron, javascript
Domain
desktop

Research direction

Start in runtime/src/js/pgadmin.js at launchPgAdminWindow and compare its input handling with the zoom roles assembled in runtime/src/js/menu.js. Run the Electron desktop build and verify that Ctrl plus numpad +, -, and 0 work alongside the existing main-keyboard shortcuts; the report has only been tested on Linux Wayland.

Written by the indexing model from the issue text.

Description

Bug

i build pgadmin4 locally on linux, as Electron desktop, from source; it builds/installs ok

Version 9.18
Application Mode Desktop
Commit ecb6446c313b69ec1310b5816178e79040f98a92 (2026-10-02 17:41 +0100)
Python Version 3.14.7
Electron Version 44.4.5
Browser Chrome 152.0.7977.130
Operating System Fedora Linux 44 (Forty Four), Linux-7.2.8-200.fc44.x86_64-x86_64-with-glibc2.43

rpm -qa pgadmin4-electron
  pgadmin4-electron-git_master-0.20261004_135416.gitecb6446.fc44.x86_64

on exec of the Desktop runtime,

-- Ctrl + main-keyboard + (=), - and 0 zoom in, zoom out and reset as expected
-- UI View > Zoom In / Zoom Out / Actual Size work from the menu

BUT,

-- Ctrl + numpad +, Ctrl + numpad - and Ctrl + numpad 0 do nothing

checking src,

runtime/src/js/menu.js:169-171

    { role: 'resetZoom' },
    { role: 'zoomIn' },
    { role: 'zoomOut' },

builds the View menu zoom items from Electron menu roles.

electron v44.4.5 hardcodes those roles' accelerators in lib/browser/api/menu-item-roles.ts

resetzoom: accelerator: 'CommandOrControl+0'     (line 169)
zoomin:    accelerator: 'CommandOrControl+Plus'  (line 238)
zoomout:   accelerator: 'CommandOrControl+-'     (line 246)

electron v44.4.5's accelerator parser, shell/common/keyboard_util.cc, maps those only to main-keyboard keys.
numpad keys are SEPARATE key codes, reachable only through separate tokens; e.g.:

"plus"   -> ui::VKEY_OEM_PLUS   (line 97, main keyboard)
"numadd" -> ui::VKEY_ADD        (line 88)
"numsub" -> ui::VKEY_SUBTRACT   (line 93)
"num0"   -> ui::VKEY_NUMPAD0    (line 78)

since menu items hold only ONE accelerator, role items can't be edited to ALSO match a numpad key.

a workaround/fix is to handle numpad keys directly in the main window with a before-input-event handler, matched on input.code.

e.g., this works

diff --git a/runtime/src/js/pgadmin.js b/runtime/src/js/pgadmin.js
--- a/runtime/src/js/pgadmin.js
+++ b/runtime/src/js/pgadmin.js
@@ -381,6 +381,23 @@ function launchPgAdminWindow() {
   splashWindow.close();
   pgAdminMainScreen.webContents.session.clearCache();

+  // Electron's zoomIn/zoomOut/resetZoom menu roles match only the
+  // main-keyboard keys; handle the numpad keys at window level.
+  pgAdminMainScreen.webContents.on('before-input-event', (event, input) => {
+    if (input.type !== 'keyDown' || !(input.control || input.meta)) return;
+    const wc = pgAdminMainScreen.webContents;
+    if (input.code === 'NumpadAdd') {
+      wc.setZoomLevel(wc.getZoomLevel() + 0.5);
+    } else if (input.code === 'NumpadSubtract') {
+      wc.setZoomLevel(wc.getZoomLevel() - 0.5);
+    } else if (input.code === 'Numpad0') {
+      wc.setZoomLevel(0);
+    } else {
+      return;
+    }
+    event.preventDefault();
+  });
+
   setupMenu(pgAdminMainScreen, configStore, menuCallbacks);

   setupDownloader();

with that patch/build, Ctrl- +/-/0 work BOTH on main keyboard AND numpad.

i've only tested this on Linux/KDE Plasma/Wayland
NOT tested on X11, Windows or macOS.

but iiuc the role accelerators are the same on all platforms, so i'd expect the same behavior on those.

Dominant language
Python
Stars
3.9k
Forks
904
Avg merge
1d 5h
Merged PRs (30d)
28

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pgadmin-org/pgadmin4

All issues in pgadmin-org/pgadmin4

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.