Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

クローズ 初心者向け
#10,503 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
electron, javascript
領域
desktop

調査の方向性

runtime/src/js/pgadmin.js の launchPgAdminWindow から始め、入力処理を runtime/src/js/menu.js で組み立てられているズームロールと比較してください。Electron デスクトップビルドを実行し、テンキーの Ctrl と +、-、0 が既存のメインキーボードのショートカットとともに動作することを確認してください。この報告は Linux Wayland でのみテストされています。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
3.9k
フォーク
908
平均マージ
1日 6時間
マージ済み PR(30日)
38

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pgadmin-org/pgadmin4 のほかの issue

pgadmin-org/pgadmin4 の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。