Repository navigation
feat(libSceSystemGesture): report primitive touch events from the pad reports - #7574
Conversation
… reports sceSystemGestureUpdatePrimitiveTouchRecognizer reads the pad reports the title passes in and tracks every touch as a primitive, so the primitive event queries report begin, active and end events with their pressed and current positions, delta vector, delta time and elapsed time instead of reporting that no touch input exists. sceSystemGestureGetPrimitiveTouchEventByPrimitiveID no longer throws for a tracked touch.
|
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.
|
|
Overlap checked, including the three shared files the bot could not compare. #6447 is the one real overlap, on The other three do not overlap:
|
|
Checked the |
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)