libSceSystemGesture: 13 exports still throw on the no-touch path; branch ready #3109

Closed
opened 2026-10-10 22:23:01 +00:00 by Silverash-i8 · 2 comments
Silverash-i8 commented 2026-10-10 22:23:01 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Silverash-i8 on 2026-10-10T22:23:01Z.


libSceSystemGesture already behaves like a device whose touch recognizers never report anything (Open returns one handle, CreateTouchRecognizer succeeds, GetTouchEventsCount is 0), but 13 of its 22 exports still throw. A title that appends a recognizer, polls its events or reads its information stops even though nothing could ever be reported.

Branch: Silverash-i8/AnyPS5-fork:feat/system-gesture-no-touch, one commit d1e20908 on main dc105f8a.

Eleven of the 13 now follow the existing no-touch behaviour, using only the error codes the file already had:

  • AppendTouchRecognizer, RemoveTouchRecognizer, ResetTouchRecognizer, ResetPrimitiveTouchRecognizer and UpdateAllTouchRecognizer succeed on the open handle (INVALID_HANDLE otherwise, INVALID_ARGUMENT for a null recognizer).
  • GetTouchEvents and GetPrimitiveTouchEvents report 0 events, and GetPrimitiveTouchEventsCount returns 0. GetPrimitiveTouchEventByIndex returns INDEX_OUT_OF_ARRAY, like the touch version already does.
  • CreateTouchRecognizer now keeps the recognizer's type and rectangle in the title's recognizer buffer, so GetTouchRecognizerInformation reports them (with updated_time 0) and UpdateTouchRecognizerRectangle changes the rectangle. The buffer's console layout is unknown, so this uses its first bytes as our own state.
  • GetTouchEventByEventID and GetPrimitiveTouchEventByPrimitiveID still throw. No event is ever reported, so a title never has an ID to pass, and I don't have a verified "not found" code.

The behaviour is in docs/dev/TechnicalDebt.md next to libSceUsbd's no-device entry. That includes the fact that the error codes are the ones the file already used, which I couldn't verify (shadPS4 only has logging stubs for this library).

Tested on Windows 11, WinLibs GCC 15.2.0 r7, Release. A new guest_system_gesture test covers each implemented call, including the handle and null-argument errors and the type and rectangle round trip, and it passes along with patched_libraries. tools/check_conventions.py --base upstream/main passes. tools/progress.py goes from 2726/3225 to 2737/3225 library functions.

AI-assisted (Claude Code); I ran everything above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5795810091 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3109). Originally posted by [Silverash-i8](https://github.com/Silverash-i8) on 2026-10-10T22:23:01Z. --- `libSceSystemGesture` already behaves like a device whose touch recognizers never report anything (`Open` returns one handle, `CreateTouchRecognizer` succeeds, `GetTouchEventsCount` is 0), but 13 of its 22 exports still throw. A title that appends a recognizer, polls its events or reads its information stops even though nothing could ever be reported. **Branch:** [`Silverash-i8/AnyPS5-fork:feat/system-gesture-no-touch`](https://github.com/Silverash-i8/AnyPS5-fork/tree/feat/system-gesture-no-touch), one commit `d1e20908` on `main` `dc105f8a`. Eleven of the 13 now follow the existing no-touch behaviour, using only the error codes the file already had: - `AppendTouchRecognizer`, `RemoveTouchRecognizer`, `ResetTouchRecognizer`, `ResetPrimitiveTouchRecognizer` and `UpdateAllTouchRecognizer` succeed on the open handle (`INVALID_HANDLE` otherwise, `INVALID_ARGUMENT` for a null recognizer). - `GetTouchEvents` and `GetPrimitiveTouchEvents` report 0 events, and `GetPrimitiveTouchEventsCount` returns 0. `GetPrimitiveTouchEventByIndex` returns `INDEX_OUT_OF_ARRAY`, like the touch version already does. - `CreateTouchRecognizer` now keeps the recognizer's type and rectangle in the title's recognizer buffer, so `GetTouchRecognizerInformation` reports them (with `updated_time` 0) and `UpdateTouchRecognizerRectangle` changes the rectangle. The buffer's console layout is unknown, so this uses its first bytes as our own state. - `GetTouchEventByEventID` and `GetPrimitiveTouchEventByPrimitiveID` still throw. No event is ever reported, so a title never has an ID to pass, and I don't have a verified "not found" code. The behaviour is in `docs/dev/TechnicalDebt.md` next to `libSceUsbd`'s no-device entry. That includes the fact that the error codes are the ones the file already used, which I couldn't verify (shadPS4 only has logging stubs for this library). **Tested** on Windows 11, WinLibs GCC 15.2.0 r7, Release. A new `guest_system_gesture` test covers each implemented call, including the handle and null-argument errors and the type and rectangle round trip, and it passes along with `patched_libraries`. `tools/check_conventions.py --base upstream/main` passes. `tools/progress.py` goes from 2726/3225 to 2737/3225 library functions. AI-assisted (Claude Code); I ran everything above on my machine.
Silverash-i8 commented 2026-10-11 00:46:26 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Silverash-i8 on 2026-10-11T00:46:26Z.


Most of this landed through #3174 (xXPBSXx's branch from #3144, carried by adriadam10), so feat/system-gesture-no-touch is superseded. The one call that branch had and main still throws on is sceSystemGestureGetTouchRecognizerInformation, so I've put just that on a fresh branch on top of current main:

feat/system-gesture-recognizer-info, commit 62648a0f

  • sceSystemGestureCreateTouchRecognizer keeps the type and rectangle at the start of the title's recognizer buffer (it's 2888 bytes and opaque to the title; the layout is ours since the console's isn't known). A null rectangle stores zeros.
  • UpdateTouchRecognizerRectangle replaces the stored rectangle.
  • GetTouchRecognizerInformation returns both, with updated_time 0 because no touch input ever updates a recognizer. Handle and null checks match the rest of the file.
  • The TechnicalDebt entry for the gesture recognizers now describes this instead of "keep no recognizer state".
  • guest_system_gesture passed a 4-byte int as the recognizer and the rectangle. Since the rectangle is now written into the recognizer, I switched those to the real SystemGestureTouchRecognizer and SystemGestureRectangle types, and added checks for create, update and read back, a null rectangle, and the invalid handle and argument cases.

Tested on Windows 11, WinLibs GCC 15.2.0 r7, Release, main 06da1176: guest_system_gesture and patched_libraries pass, and tools/check_conventions.py --base upstream/main passes.

The two ID lookups (GetPrimitiveTouchEventByPrimitiveID, GetTouchEventByEventID) still throw on both, since I couldn't find what they return when no event exists.

AI-assisted (Claude Code); I ran everything above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6103892240 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3109#issuecomment-6103892240). Originally posted by [Silverash-i8](https://github.com/Silverash-i8) on 2026-10-11T00:46:26Z. --- Most of this landed through #3174 (xXPBSXx's branch from #3144, carried by adriadam10), so `feat/system-gesture-no-touch` is superseded. The one call that branch had and `main` still throws on is `sceSystemGestureGetTouchRecognizerInformation`, so I've put just that on a fresh branch on top of current `main`: [`feat/system-gesture-recognizer-info`](https://github.com/Silverash-i8/AnyPS5-fork/tree/feat/system-gesture-recognizer-info), commit `62648a0f` - `sceSystemGestureCreateTouchRecognizer` keeps the type and rectangle at the start of the title's recognizer buffer (it's 2888 bytes and opaque to the title; the layout is ours since the console's isn't known). A null rectangle stores zeros. - `UpdateTouchRecognizerRectangle` replaces the stored rectangle. - `GetTouchRecognizerInformation` returns both, with `updated_time` 0 because no touch input ever updates a recognizer. Handle and null checks match the rest of the file. - The TechnicalDebt entry for the gesture recognizers now describes this instead of "keep no recognizer state". - `guest_system_gesture` passed a 4-byte `int` as the recognizer and the rectangle. Since the rectangle is now written into the recognizer, I switched those to the real `SystemGestureTouchRecognizer` and `SystemGestureRectangle` types, and added checks for create, update and read back, a null rectangle, and the invalid handle and argument cases. **Tested** on Windows 11, WinLibs GCC 15.2.0 r7, Release, `main` 06da1176: `guest_system_gesture` and `patched_libraries` pass, and `tools/check_conventions.py --base upstream/main` passes. The two ID lookups (`GetPrimitiveTouchEventByPrimitiveID`, `GetTouchEventByEventID`) still throw on both, since I couldn't find what they return when no event exists. AI-assisted (Claude Code); I ran everything above on my machine.
oneandonlydean commented 2026-10-11 01:08:54 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T01:08:54Z.


Closing: #3174 covers these calls. GetTouchRecognizerInformation and the two ID lookups keep throwing until their layout and not-found codes are known.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6104056804 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3109#issuecomment-6104056804). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-11T01:08:54Z. --- Closing: #3174 covers these calls. `GetTouchRecognizerInformation` and the two ID lookups keep throwing until their layout and not-found codes are known.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#3109
No description provided.