fix: Simulated key presses now reach gameplay polling#1236
Conversation
Keep simulated Press inputs alive across gameplay observation frames so Update-based input polling can see edge-triggered actions such as wasPressedThisFrame. Add focused PlayMode coverage for keyboard and mouse input, and update skills/docs to guide agents toward Press for tap actions instead of rewriting gameplay code to held-state checks.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe PR centralizes observation-frame timing, adds play-mode tests verifying keyboard and mouse simulated Press/KeyDown are observable via Update polling (including gameplay jump wiring), and updates SKILL/README docs to advise using Press for edge-triggered checks and KeyDown/KeyUp for held-key scenarios with troubleshooting steps. ChangesInput Press Observability and Guidance
🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly Related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Actionable comments posted: 0 |
…ix-wasPressedThisFrame
Add gameplay-style coverage that Press and KeyDown drive Update-based wasPressedThisFrame state transitions before the tool returns. Document that KeyDown emits only one initial edge before becoming held state, so agents should verify input timing before rewriting gameplay polling to isPressed.
|
Actionable comments posted: 0 |
Summary
wasPressedThisFrameinUpdate().Pressand reservesKeyDown/KeyUpfor intentional holds.User Impact
simulate-keyboard --action Press --key Spacecould report success while a game that usedKeyboard.current.spaceKey.wasPressedThisFramemissed the jump/start action.Changes
wasPressedThisFramepolling fromMonoBehaviour.Update().Verification
Packages/src/Cli~/dist/darwin-arm64/uloop compile --project-path <PROJECT_ROOT>Packages/src/Cli~/dist/darwin-arm64/uloop run-tests --test-mode PlayMode --filter-type regex --filter-value "^io\.github\.hatayama\.UnityCliLoop\.Tests\.PlayMode\.SimulateKeyboardTests\." --project-path <PROJECT_ROOT>Packages/src/Cli~/dist/darwin-arm64/uloop run-tests --test-mode PlayMode --filter-type regex --filter-value "^io\.github\.hatayama\.UnityCliLoop\.Tests\.PlayMode\.SimulateMouseInputTests\." --project-path <PROJECT_ROOT>git diff --check~/.codex/skills/codex-review/scripts/codex-review v3-beta