[Testing] Validate SDL-event → SFML-enum input parity (asserted "Full", never tested) #389

Open
opened 2026-07-16 16:47:42 +00:00 by john · 0 comments
Owner

Part of #387. CLAUDE.md's Web Build Constraints table marks Input " Full — SDL events translated to SFML enums", but nothing validates that translation table. An unmapped key or modifier would silently do nothing on web while working on desktop.

Scope

  1. Enumerate the SDL-event → SFML-enum translation in the SDL2 backend (src/platform/SDL2Types.h / event pump) and cross-check it against the desktop sf::Keyboard/sf::Mouse enums the game code consumes.
  2. Add a regression test asserting full coverage: every mcrfpy.Key / mcrfpy.MouseButton value the Python API exposes has a defined SDL source mapping (and vice versa — no SDL event that lands as an invalid/zero enum).
  3. Cover modifiers (shift/ctrl/alt), mouse buttons, and any key the demos/snippets actually use.
  4. Where a mapping is genuinely absent (no SDL equivalent), document it in the parity matrix rather than leaving it implicit.

Notes

  • The enum-translation table is a pure data structure — much of this is testable headlessly against the mapping itself, without a live browser.
  • Any gap found becomes a granular follow-up (system:input).
Part of #387. CLAUDE.md's Web Build Constraints table marks Input "✅ Full — SDL events translated to SFML enums", but nothing validates that translation table. An unmapped key or modifier would silently do nothing on web while working on desktop. ## Scope 1. Enumerate the SDL-event → SFML-enum translation in the SDL2 backend (`src/platform/SDL2Types.h` / event pump) and cross-check it against the desktop `sf::Keyboard`/`sf::Mouse` enums the game code consumes. 2. Add a regression test asserting full coverage: every `mcrfpy.Key` / `mcrfpy.MouseButton` value the Python API exposes has a defined SDL source mapping (and vice versa — no SDL event that lands as an invalid/zero enum). 3. Cover modifiers (shift/ctrl/alt), mouse buttons, and any key the demos/snippets actually use. 4. Where a mapping is genuinely absent (no SDL equivalent), document it in the parity matrix rather than leaving it implicit. ## Notes - The enum-translation table is a pure data structure — much of this is testable headlessly against the mapping itself, without a live browser. - Any gap found becomes a granular follow-up (`system:input`).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
john/McRogueFace#389
No description provided.