Fix/trigger effect state #1132
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!1132
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1132/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?
@Jetsku on GitHub · 2026-10-07 07:29 UTC · original
Jetsku:fix/trigger-effect-state→main· +249 −21 · 4 files · 7 commits · merged 2026-10-08 12:00 UTCPad: report the adaptive trigger effect state (scePadGetTriggerEffectState)
What
scePadGetTriggerEffectStatealways returned 0 for both triggers. Games that set an adaptive-trigger effect and thenwait for its state before acting on L2/R2 never saw the state change:
could fire by itself from an untouched trigger.
How
The reported state now follows from the game's last trigger effect per trigger (Kyty already keeps it for the
DualSense output) and the trigger's travel (0..255 over the effect's ten positions):
using the values 1..7 that duaLib (WujekFoliarz/duaLib) reads from a DualSense input report. SDL does not expose that
report, so this is an approximation based on the effect and the travel. It also works with other pads and the
keyboard, where a digital L2/R2 counts as full travel. The trigger intensity setting only changes the output, not the
reported state.
Feedback (modes 1, 4, 5) and vibration (modes 3, 6) states require some travel (>= 8 of 255), so an effect starting at
position 0 does not report "pushing" or "firing" on an untouched trigger.
Commits:
Testing
controller_settings(tests/ControllerSettingsTests.cpp) covers feedback, weapon and vibration statesacross the trigger travel, a trigger without an effect, a masked update keeping the other trigger's effect, and the
intensity setting leaving the reported state unchanged.
AI use
This change was developed with an AI coding assistant (Claude Code). Scope of the AI involvement:
direction (I reported the in-game problems and decided what should change).
Testing. I was able to play astrobot correctly and many others through my fork and there haven't been any reports as regressions from others.
I acknowledge that the project asks for pull-request descriptions to come from the human contributor rather than an AI
agent; this description was drafted with AI help and then reviewed and edited by me, and I take responsibility for the
code and its correctness.
@coderabbitai[bot] on GitHub · 2026-10-07 07:32 UTC · original · edited 2026-10-07 12:59 UTC
📝 Walkthrough
Walkthrough
The controller calculates each trigger’s effect state from its command, input position, and previous state. It updates these states when trigger axes change, input resets, the active controller changes, or an effect is set.
PadGetTriggerEffectStatevalidates the handle and output pointer before returning both states. The export now uses the controller implementation. Tests cover validation, effect modes, thresholds, resets, and controller switching.Suggested reviewers:
cosmo,mehmetcambazPriority: ➖ Normal
Change: Bug fix
Merge Risk: 🔵 Low · up to
912efSome games may see an active trigger effect while the trigger is at rest or barely pressed. Correct the threshold and its tests before merging.
🚥 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.@Copilot on GitHub · 2026-10-07 07:32 UTC · original
On
src/libs/libPad.cppline 39 (outdated):The supplied handle is still ignored, so this now returns success and handle 1's live trigger state even for an invalid handle. Other pad queries reject handles other than 1, and the referenced duaLib implementation also returns
SCE_PAD_ERROR_INVALID_HANDLE; validate the handle before reading the controller state.@copilot-pull-request-reviewer[bot] on GitHub · 2026-10-07 07:32 UTC · original · reviewed
Copilot review overview
🟡 Changes recommended
Invalid handles expose the active controller state, and several new effect-mode branches lack coverage.
Review effort: Balanced
· 1 
Findings: 1
Open (2)
What changed in this PR
Implements adaptive-trigger state reporting based on configured effects and trigger travel.
Changes:
src/libs/controller.cppsrc/libs/controller.hsrc/libs/libPad.cpptests/ControllerSettingsTests.cpp💡 Add a
code-reviewagent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.@Copilot on GitHub · 2026-10-07 07:32 UTC · original
On
src/libs/controller.cppline 376 (outdated):The new multi-position and slope feedback branches are not exercised by the added tests, which only send feedback mode 1. Please add boundary cases for the current-position lookup and slope start threshold so these distinct calculations are covered.
This issue also appears on line 378 of the same file.
@Jetsku on GitHub · 2026-10-07 07:50 UTC · original
On
src/libs/libPad.cppline 39 (outdated):Fixed in
23405a5@Jetsku on GitHub · 2026-10-07 07:50 UTC · original
On
src/libs/controller.cppline 376 (outdated):Fixed in
23405a5@Nmzik on GitHub · 2026-10-07 12:52 UTC · original
@Jetsku Thank you! Please re-test
@ -333,0 +379,4 @@return command.data[0] != 0 && command.data[1 + pos] != 0? TRIGGER_STATE_VIBRATION_ACTIVE: TRIGGER_STATE_VIBRATION_STANDBY;default: return TRIGGER_STATE_OFF;@coderabbitai[bot] on GitHub · 2026-10-07 12:59 UTC · original
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 9734
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 21825
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 21829
Enforce the 8/255 floor in reported trigger states.
For modes 1, 3, 4, 5, and 6,
TriggerEffectStatecan return an active state at travel values 0–7.PadGetTriggerEffectStateexposes that result, contrary to E1’s minimum. Gate these active branches onvalue >= 8and update the low-travel tests to expect standby.📝 Committable suggestion
@coderabbitai[bot] on GitHub · 2026-10-07 12:59 UTC · original · reviewed
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
3e3966b4-722e-4540-b7a4-62d6a75035c9📥 Commits
Reviewing files that changed from the base of the PR and between
e53936070band912ef339af.📒 Files selected for processing (3)
src/libs/controller.cppsrc/libs/controller.htests/ControllerSettingsTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.