Trigger config: root-cause the dead cockpit clicks (missing BT_PLATFORM=glass)

The user held the MFD PROGRAM button and nothing happened (weapons kept
firing).  Diagnosis, verified end-to-end:

- The cockpit mouse handler DID register the click ([cockpit] CLICK addr=0x8
  press) and 0x8 IS a streamed PROGRAM element (EVENT msg 0x9 -> weapon,
  Mfd1 quad page mask).
- But every launch ran the DEV platform profile (no BT_PLATFORM) ->
  L4CONTROLS=KEYBOARD -> no PadRIO instance -> PadRIO::SetScreenButton
  no-ops (activeInstance NULL) -> the press never entered the RIO queue ->
  ConfigureMappables (id 9) never dispatched -> the mode never flipped ->
  fire keys kept firing.  The config machinery itself was never broken.
- With BT_PLATFORM=glass (the GLASS profile: L4CONTROLS=PAD -> PadRIO), the
  full chain now proves out headlessly:
    [btntest] PRESS 0x8 -> [cfgmap] ENTER session on ERMLaser_1
      mode 0x450421 -> 0x448421 (NonMapping 0x10000 -> Mapping 0x8000)
    [btntest] RELEASE 0x8 -> [cfgmap] EXIT (mode restored)

Landed:
- mechweap.cpp: [cfgmap] BT_FIRE_LOG diagnostics in the real
  ConfigureMappables/ChooseButton handlers (they were silent -- the G-key
  harness had logs but the authentic button path had none).
- L4PADRIO.cpp: BT_BTNTEST="addr,pressPoll,releasePoll" scripted screen-
  button harness through the REAL click seam (EmitButton -> RIO queue ->
  manager drain -> buttonGroup mapping) for headless verification.
- play_solo.bat: prefer the glass build when present AND set
  BT_PLATFORM=glass so PadRIO exists and cockpit clicks work.

Side finding (the user's keymap "flip-flop"): CONTROLS.MAP (btinput, DEV/pod
profile) and bindings.txt (PadRIO, GLASS profile) are two parallel binding
engines; which one runs depends on the platform profile, so the felt keymap
changes with the boot flavor.  Unification pending (user decision).

Awaiting live verification of the full hold-PROGRAM + tap-fire regroup flow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-21 09:31:52 -05:00
co-authored by Claude Opus 4.8
parent 89b4f53046
commit 4215b98655
3 changed files with 63 additions and 2 deletions
+36
View File
@@ -352,6 +352,42 @@ void
void
PadRIO::Poll()
{
//
// BT_BTNTEST="addr,pressPoll,releasePoll" (dev): scripted screen-button
// press through the REAL click seam (EmitButton -> RIO queue -> manager
// drain -> buttonGroup mapping) -- verifies the cockpit-click chain
// headlessly. Example: BT_BTNTEST=8,600,1200 holds button 0x8 (an MFD1
// PROGRAM element) from poll 600 to poll 1200.
//
{
static int s_btnAddr = -2, s_btnOn = 0, s_btnOff = 0, s_poll = 0, s_state = 0;
if (s_btnAddr == -2)
{
s_btnAddr = -1;
const char *e = getenv("BT_BTNTEST");
if (e != NULL)
sscanf(e, "%i,%i,%i", &s_btnAddr, &s_btnOn, &s_btnOff);
}
if (s_btnAddr >= 0)
{
++s_poll;
if (s_state == 0 && s_poll >= s_btnOn)
{
s_state = 1;
EmitButton(s_btnAddr, 1);
DEBUG_STREAM << "[btntest] PRESS 0x" << std::hex << s_btnAddr
<< std::dec << " at poll " << s_poll << "\n" << std::flush;
}
else if (s_state == 1 && s_poll >= s_btnOff)
{
s_state = 2;
EmitButton(s_btnAddr, 0);
DEBUG_STREAM << "[btntest] RELEASE 0x" << std::hex << s_btnAddr
<< std::dec << " at poll " << s_poll << "\n" << std::flush;
}
}
}
unsigned long now = timeGetTime();
float dt = (lastPollMilliseconds == 0)
? 0.0f