From fbd23ff1cab77ccf2b4a1ec4567a7fd98d08563f Mon Sep 17 00:00:00 2001 From: Cyd Date: Mon, 13 Jul 2026 09:47:04 -0500 Subject: [PATCH] Key-command audit: the up arrow was the abort key; bombs disarmed Full input-surface audit of the PC keyboard channel. The arcade abort was the typed ampersand character (0x26), but the Win32 port feeds WM_KEYUP VIRTUAL-KEY codes into the same channel - and VK_UP is also 0x26. The hat look-up key aborted the mission: that was every mystery abort across the multiplayer test rounds. Likewise the E key (0x45, the right pedal!) dumped the event queue on every release. Disarmed: plain 0x26 and E are swallowed at the L4 layer; the abort answers only to the deliberate Alt+Q chord (translated to the legacy engine code, so APP.cpp is untouched); the debug toggles (wireframe Alt+W, predator vision Alt+V, frame dump Alt+F, perf stats, event queue on Alt+E now) arm only with RP412DEVKEYS=1. The cheat-string manager has no PC-keyboard strings and the trace-log keys are compiled out of release - both inert. Verified live: a volley of VK_UP releases mid-race leaves the mission running; Alt+Q aborts on demand. Docs and the dist README updated. Co-Authored-By: Claude Fable 5 --- MUNGA_L4/L4APP.cpp | 59 ++++++++++++++++++++++++++++++------ MUNGA_L4/L4KEYBD.h | 2 ++ docs/STEAM-3-MACHINE-TEST.md | 11 ++++--- pack-dist.ps1 | 1 + 4 files changed, 59 insertions(+), 14 deletions(-) diff --git a/MUNGA_L4/L4APP.cpp b/MUNGA_L4/L4APP.cpp index d709a9f..1476fdc 100644 --- a/MUNGA_L4/L4APP.cpp +++ b/MUNGA_L4/L4APP.cpp @@ -717,13 +717,58 @@ void { Check(this); Check(message); + + // + // The debug keys are for developers: RP412DEVKEYS=1 arms them. + // Players get exactly one chord - Alt+Q, the deliberate abort. + // + static int dev_keys = -1; + if (dev_keys < 0) + { + const char *dev_value = getenv("RP412DEVKEYS"); + dev_keys = (dev_value != NULL && atoi(dev_value) != 0) ? 1 : 0; + } + switch (message->dataContents) { + //---------------------------------------------------------------- + // Abort the mission, deliberately. The engine's legacy abort char + // is '&' (0x26) - but WM_KEYUP feeds VIRTUAL-KEY codes into this + // channel and VK_UP is also 0x26, so the plain code is swallowed + // below and the abort answers only to this chord. + //---------------------------------------------------------------- + case PCK_ALT_Q: + message->dataContents = '&'; + Application::KeyCommandMessageHandler(message); + break; + + //---------------------------------------------------------------- + // Swallowed collisions: 0x26 is VK_UP (the hat look-up key!) as + // well as a typed ampersand; 'E' (0x45 = the right-pedal key) was + // the event-queue dump. Neither may reach the engine handler. + //---------------------------------------------------------------- + case '&': + case 'E': + break; + + //------------------------------------ + // Report current event queue (moved + // off the pedal key) + //------------------------------------ + case PCK_ALT_E: + { + if (!dev_keys) break; + Check(application); + application->DumpEventQueue(); + break; + } + //-------------------------------------------- // FrameDump from Division card to Targa file //-------------------------------------------- case PCK_ALT_F: { + if (!dev_keys) break; DPLRenderer *dpl_renderer = l4_application->GetVideoRenderer(); if (dpl_renderer) { @@ -738,6 +783,7 @@ void //------------------------------------ case PCK_ALT_K: { + if (!dev_keys) break; //STUBBED: HEAP RB 1/20/07 /*DPLRenderer *dpl_renderer = l4_application->GetVideoRenderer(); if (dpl_renderer) @@ -759,21 +805,12 @@ void break; } - //------------------------------------ - // Report current event queue - //------------------------------------ - case 'E': - { - Check(application); - application->DumpEventQueue(); - break; - } - //--------------------------------------- // Report performance statistics (Alt-?) //--------------------------------------- case PCK_ALT_SLASH: { + if (!dev_keys) break; DPLRenderer *dpl_renderer = l4_application->GetVideoRenderer(); if (dpl_renderer) { @@ -787,6 +824,7 @@ void //-------------------------- case PCK_ALT_W: { + if (!dev_keys) break; DPLRenderer *dpl_renderer = l4_application->GetVideoRenderer(); if (dpl_renderer) { @@ -800,6 +838,7 @@ void //-------------------------- case PCK_ALT_V: { + if (!dev_keys) break; DPLRenderer *dpl_renderer = l4_application->GetVideoRenderer(); if (dpl_renderer) { diff --git a/MUNGA_L4/L4KEYBD.h b/MUNGA_L4/L4KEYBD.h index e87d928..55e641f 100644 --- a/MUNGA_L4/L4KEYBD.h +++ b/MUNGA_L4/L4KEYBD.h @@ -120,6 +120,8 @@ # define PCK_ALT_F (ALT_BIT | 'F') # define PCK_ALT_K (ALT_BIT | 'K') # define PCK_ALT_V (ALT_BIT | 'V') +# define PCK_ALT_E (ALT_BIT | 'E') +# define PCK_ALT_Q (ALT_BIT | 'Q') # define PCK_ALT_SLASH (ALT_BIT | VK_OEM_2) // '/?' key // diff --git a/docs/STEAM-3-MACHINE-TEST.md b/docs/STEAM-3-MACHINE-TEST.md index 69f6180..a6d3e47 100644 --- a/docs/STEAM-3-MACHINE-TEST.md +++ b/docs/STEAM-3-MACHINE-TEST.md @@ -61,10 +61,13 @@ this server-side; test machines need the client setting.) ## The abort key -The ampersand key (Shift+7) is the arcade mission-abort. It ends YOUR -mission on the spot - score banked, back to the lobby room. If the -host presses it, the race ends for everyone (members return to the -room too). Every "crash on keypress" so far has been this key. +**Alt+Q** aborts your mission deliberately - score banked, back to the +lobby room. If the host presses it, the race ends for everyone. + +(History: the legacy abort was the '&' character, and the Win32 key +channel made the UP ARROW - the hat look key! - collide with it. That +was every mystery abort in rounds five and six. Plain arrow keys are +now safe; debug keys like wireframe/frame-dump need RP412DEVKEYS=1.) ## Notes and knowns diff --git a/pack-dist.ps1 b/pack-dist.ps1 index 5a849c9..fdd5ffa 100644 --- a/pack-dist.ps1 +++ b/pack-dist.ps1 @@ -108,6 +108,7 @@ Controls (XInput controller and/or keyboard): B / R reverse thrust DPad / arrow keys joystick hat (look) Start,Back / F1,F2 config buttons + Alt+Q abort the mission (score banked) The full pod cockpit comes up in a single window: three green MFDs across the top, the 3D viewscreen centered with the orange plasma glass