Add per-backend input debug visualization + round-trip view

Makes it possible to isolate an input->tool problem from a tool->game one in the
Controllers panel (under Debug details):
- which backend fed each slot is already shown via the per-pad source tag
  ("XInput #0" / "Steam Input") in the Incoming section;
- a new "Round-trip" table shows, per slot, the state we forwarded (the active
  backend's pad) next to what the game actually read back, highlighting matches.

For the round-trip, the XInput hook now echoes the state it returns to the game into
the status (protocol v9->v10: per-slot read_state in HookStatus).

Verified: hook_selftest (x64 + x86) asserts the hook records the game-read state;
full build x64 + x86 clean; ctest x64 9/9, x86 3/3.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 05:15:07 +02:00
parent 056a478e19
commit 327ba1f394
8 changed files with 57 additions and 10 deletions

View File

@@ -90,6 +90,10 @@ DWORD query_state(DWORD user_index, XINPUT_STATE* state, bool keep_guide)
result.Gamepad.wButtons &= ~kGuideButton;
}
*state = result;
if (g_ipc != nullptr)
{
g_ipc->note_read_state(user_index, pad); // round-trip: what the game just read
}
return ERROR_SUCCESS;
}