window: tolerate remapped gamepads #1227
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1227
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1227/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@TheCruZ on GitHub · 2026-10-08 19:04 UTC · original
pr/gamepad-remap→main· +8 −1 · 1 files · 1 commits · closed without mergingSummary
Fixes the emulator aborting while playing Grand Theft Auto V (PPSA04263) when SDL reports that a connected gamepad was remapped.
Problem
SDL_EVENT_GAMEPAD_REMAPPEDreachesGameEventControllerwithremappedset, and the handler started withEXIT_NOT_IMPLEMENTED(f.remapped), so the event terminated the emulator.Change
The remap event no longer aborts. A new mapping only changes how SDL translates the device's raw inputs; the buttons and axes the emulator reads stay logical. SDL does not send button-up or neutral-axis events for the old mapping, so when the remapped gamepad is the active controller its input state is reset (
Controller::ResetInputState()) and no button or axis stays stuck.Testing
kyty_emulatorbuilds (window.cpprebuilt with the reset).AI usage
AI (Claude Opus 5.5) was used to investigate the issue and to implement the change. I reviewed the code, understand it, tested it as described above, and wrote this description myself, in general fully tested the game while doing few missions and playing in-game with my GTA V fork, i will be bringing PRs here after test them enough.
@coderabbitai[bot] on GitHub · 2026-10-08 19:09 UTC · original · edited 2026-10-08 19:17 UTC
📝 Walkthrough
Walkthrough
GameEventController now returns early when it receives a remapping event. Controller button and axis events continue through the existing handling paths.
Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Bug fix
Merge Risk: 🔵 Low · up to
3370aRemapping a controller while a control is held can leave that input stuck until another update changes it. The impact is localized to the affected controller, and clearing its cached state on remap is a bounded fix.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@ -291,0 +294,4 @@Controller::ResetInputState();}return;}@coderabbitai[bot] on GitHub · 2026-10-08 19:09 UTC · original · edited 2026-10-08 19:17 UTC
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 10134
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 5549
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 7775
🌐 Web query:
SDL3 commit fa2c02bb6e21974a89ea9824bc53c9932abe5f9c SDL_EVENT_GAMEPAD_REMAPPED source💡 Result:
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 6467
🌐 Web query:
SDL 3.4.16 SDL_gamepad.c SDL_EVENT_GAMEPAD_REMAPPED does remapping send button release axis neutral state💡 Result:
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 4532
Reset the active controller state on remap.
SDL 3.4.16 does not synthesize button-up or neutral-axis events when it queues
SDL_EVENT_GAMEPAD_REMAPPED. The early return can therefore leave the active controller's cached input stuck. Reset only the remapped active controller.🐛 Suggested fix
✅ Confirmed as addressed by @TheCruZ
@coderabbitai[bot] on GitHub · 2026-10-08 19:09 UTC · original · reviewed
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
f2a5facc-5d2c-45a4-b37c-52e5561936a2📥 Commits
Reviewing files that changed from the base of the PR and between
2f4b8a335dand 3370a9f0572890be5ee5a82a43239b2cdd7dffef.📒 Files selected for processing (1)
src/graphics/presentation/window/window.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 0 remain after this review.
@ -291,0 +294,4 @@Controller::ResetInputState();}return;}@TheCruZ on GitHub · 2026-10-08 19:17 UTC · original
Fixed in
3269ab49: the active controller's input state is reset when it is remapped.Pull request closed