feat(libSceSystemGesture): report primitive touch events from the pad reports #7574
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7574"
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?
Imported from boykopovar/AnyPS5. Originally posted by bl4nkTHEBUNKER on 2026-10-18T15:09:35Z.
What
sceSystemGestureUpdatePrimitiveTouchRecognizernow reads the pad reports the title passes in and tracks every touch as a primitive, so the primitive event queries report real events instead of reporting that no touch input exists.SceSystemGestureTouchPadData,{int32 padHandle, int32 reportNumber, const ScePadData* padDataBuffer, 8 reserved bytes}, as fpPS4 records it; itsSceSystemGestureTouchRecognizer(361 qwords) andSceSystemGestureRectangle(4 floats and 8 reserved bytes) are the layouts main already uses.SceTypes.hpp. No public source states the PS5 values.delta_timeandelapsed_timecome from the reports' owntimestamp, so a title that replays its own reports gets the same events. An ended touch stays readable as oneendevent until the next sampled report drops it.GetPrimitiveTouchEvents,GetPrimitiveTouchEventsCountandGetPrimitiveTouchEventByIndexreport the tracked events, andGetPrimitiveTouchEventByPrimitiveIDno longer throws for a tracked touch. It still throws for an id no touch has, because the console's error there is not known.Everything unverified against console behaviour is in docs/dev/debt/libSceSystemGesture.md: the unchecked
padHandle, the coordinate units, theis_updatedrule, the result for a nullpInputDataorpadDataBuffer, a too small event buffer, and the unknown id.Tested
Windows 11, GCC 16.2 (MSYS2 UCRT64),
core/libs/tests/GuestSystemGesture.cppextended and run against the library sources with-Wall -Wextra(clean, test passes). The new assertions cover: begin on a first report; active with the delta vector, delta time and elapsed time on a move;is_updated0 when a held touch does not move; one end event after the release and its drop on the next report; two touches at once; lookup by primitive id, including the throw for an unknown id; an event buffer shorter than the event count; several reports in one update; and reset and finalize clearing the events. The existing no-input assertions still hold. No title tested: no touch-driven title was run.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T15:33:56Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/SceTypes.hppcore/libs/tests/GuestSystemGesture.cppcore/libs/SceTypes.hppcore/libs/SceTypes.hppcore/libs/SceTypes.hppcore/libs/prx/libSceSystemGesture/Export.cppdocs/dev/debt/libSceSystemGesture.mdImported from boykopovar/AnyPS5. Originally posted by bl4nkTHEBUNKER on 2026-10-18T15:54:52Z.
Overlap checked, including the three shared files the bot could not compare.
#6447 is the one real overlap, on
sceSystemGestureGetPrimitiveTouchEventByPrimitiveID. It turns the throw into a blanketINDEX_OUT_OF_ARRAY; this pull request answers the export from the primitive events it tracks and keeps a throw only for an id that no tracked touch has, so the two cannot both apply as written. Neither needs the other, soDepends onstaysnone. I am happy either way: if #6447 goes first I rebase this one onto it, and the hunk disappears since this pull request rewrites the same function. Its second gesture hunk,sceSystemGestureGetTouchEventByEventID, does not overlap, because this pull request leaves that export untouched.The other three do not overlap:
core/libs/tests/GuestSystemGesture.cpptocore/libs/tests/input/GuestSystemGesture.cppwith no content change, so whichever goes second rebases over the move.NetCtlCallbackatSceTypes.hppL1275, far from theSystemGestureTouchPadDatathis pull request adds after the otherSystemGesturestructures.VideoOutBufferAttributeafterVideoOutVblankStatus, below the block this pull request touches.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T16:40:27Z.
Progress report (
e5f18ea→15af4e3)📈 System libraries: 90.26% (+0.02%, +1 implemented functions)
✅ 1 implemented
sceSystemGestureGetPrimitiveTouchEventByPrimitiveIDImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T23:49:54Z.
Checked the
PadDatafields used, the new test cases (each fails onmain, where the events were never reported), locking and the TechnicalDebt entry; the console-side unknowns are listed there. #6447 is closed, so the overlap is gone; merged.