Skip to content

Add portable keyboard, gamepad and wheel input hooks - #142

Closed
Roxas2712 wants to merge 16 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/portable-input-hooks
Closed

Roxas2712 wants to merge 16 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/portable-input-hooks

Conversation

@Roxas2712

@Roxas2712 Roxas2712 commented Oct 23, 2026 •

Copy link
Copy Markdown

Gen2Recomped currently never dispatches input.key, input.gamepad or input.wheel, so portable overlays must replace engine methods to capture these events. Add the native Gen1Recomp hook contracts at the six existing Game callbacks, together with capability and unified callback catalog entries for API 2/3.

Depends on #102 and its public-API prerequisites. Merge those first and rebase before merging. The input work is one commit; implementation-only diff. It does not depend on the rendering or shader PRs.

Wrappers receive the original Game/joystick handles, key/button press and release payloads, axis values, or the vertical wheel delta. Omitting next suppresses the normal callback, including hotkeys/capture, held-state changes, axis transitions and wheel zoom. Native bodies are preserved verbatim in private helpers. When no chain is installed, dispatch skips the bus, payload and continuation allocation. As in Gen1, rewriting continuation arguments affects downstream wrappers while native processing retains the original event.

Includes a generic overlay example, release-ownership documentation, ROM-free tests and a dedicated cross-engine workflow pinned to clean Gen1Recomp 79ea62f45fb2ea8f65d081a109431e4eb1bbdb36. The reference engine is never patched.

Validation:

  • 456 focused checks: real held input, swallowed/forwarded releases, zero/fractional deltas, capture ordering, hotkeys, axis pseudo-buttons, touch bookkeeping, free-camera behavior, priorities, errors and cleanup across all 15 Gen2Recomped host versions.
  • The exact same example entry chunk passes through both native loaders/Game implementations on Red, Gold, FireRed and Emerald, in native API 2, unified API 2 and API 3. Feature and combined integration: 48 isolated runs and 168 matching input-state observations.
  • Combined previous-PR integration: 132/132 engine suites, SDK 3/3, and B30 pass.
  • Fresh dependency baseline: 76/86 engine suites; feature: 78/88. The exact same 10 failing suites and 17 failed assertions remain; no new failures. SDK 3/3 and B30 pass on both. The existing baseline-fix PRs are included in the green integration above.
  • Unified callback suite: 1,516/1,516 checks; capability suite: 331/331. Formatting, workflow lint and diff checks pass.

Integration preserves the newer pointer/render catalog entries when resolving the two catalog-line overlaps. ROM-dependent tiers were skipped because no imported data is present. This is a headless contract/routing test, with no hardware gamepad or OS event-delivery claim.

Hosted workflows currently require maintainer approval (action_required): API 3 contracts, ci, portable input hook contract. No hosted pass is claimed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant