From 9384c38c087e61620835f3d533a422396197d567 Mon Sep 17 00:00:00 2001 From: arcattack Date: Sun, 26 Jul 2026 13:12:52 -0500 Subject: [PATCH] volume keys: -/= -> PgUp/PgDn, ending the zoom double-fire (prep for the cockpit-refit merge) The issue #26 volume poll watched VK_OEM_MINUS/VK_OEM_PLUS -- the same physical keys the authentic 1995 typed-character target-zoom hotkeys ('+'/'-') live on, so a single press zoomed AND stepped the volume (operator-reported annoyance). The incoming glass-cockpit-refit branch also binds -/= as Comm-bank buttons, which would have made it a TRIPLE dispatch on fresh installs. PgUp/PgDn produce no WM_CHAR at all, so they cannot collide with any typed hotkey in any install; they are unbound in every bindings layout including the refit's 74-key board; and they exist on tenkeyless keyboards. Numpad +/- were considered and rejected: their typed characters feed the same zoom channel that made -/= wrong. README/CONTROLS documentation follows in the merge-fixes commit (the whole controls table is being redone there for the new default board). Co-Authored-By: Claude Opus 5 (1M context) --- game/reconstructed/mech4.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/game/reconstructed/mech4.cpp b/game/reconstructed/mech4.cpp index 65a5597..0c7f560 100644 --- a/game/reconstructed/mech4.cpp +++ b/game/reconstructed/mech4.cpp @@ -2760,8 +2760,18 @@ void // task #12: Generator1-4 actions assign the selected weapon // to Generator A..D; Reconnect toggles Manual/Auto. gBTGenSelKey = gBTInput.genSel; - // issue #26: -/= step the master volume (edge-detected; - // VK_OEM_MINUS/VK_OEM_PLUS, focus-guarded like all polls). + // issue #26: master volume keys (edge-detected, focus-guarded + // like all polls). MOVED -/= -> PgDn/PgUp (2026-07-26): the + // old VK_OEM_MINUS/VK_OEM_PLUS poll shared its physical keys + // with the authentic 1995 typed-character target-zoom hotkeys + // ('+'/'-'), so one press zoomed AND stepped the volume -- a + // long-standing double-fire the operator had noticed. PgUp/ + // PgDn produce NO WM_CHAR, so they cannot collide with any + // typed hotkey, they are unbound in every bindings layout + // (including the glass-cockpit-refit keyboard board, which + // consumes -/= as Comm-bank buttons), and they exist on + // tenkeyless keyboards. Numpad +/- were rejected for the + // same reason -/= failed: their typed chars feed the zoom. { extern void BTAudioMasterVolumeStep(int direction); static int sVolDn = 0, sVolUp = 0; @@ -2770,9 +2780,9 @@ void GetWindowThreadProcessId(GetForegroundWindow(), &fgpid); int focused_vol = (fgpid == GetCurrentProcessId()); int dn = focused_vol - && (GetAsyncKeyState(VK_OEM_MINUS) & 0x8000) != 0; + && (GetAsyncKeyState(VK_NEXT) & 0x8000) != 0; int up = focused_vol - && (GetAsyncKeyState(VK_OEM_PLUS) & 0x8000) != 0; + && (GetAsyncKeyState(VK_PRIOR) & 0x8000) != 0; if (dn && !sVolDn) BTAudioMasterVolumeStep(-1); if (up && !sVolUp) BTAudioMasterVolumeStep(+1); sVolDn = dn;