feat(libSceConvertKeycode): implement sceConvertKeycodeGetCharacterFromKeyboardData #10437
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10437"
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 InfinitySpeed on 2026-10-24T00:19:40Z.
What
Implement
sceConvertKeycodeGetCharacterFromKeyboardDatainlibSceConvertKeycode:keyDataandcharacter, returningkErrInvalidAddressif null.keyboardTyperange (1..39), returningkErrInvalidKeyboardType.keyData->lengthandKEYBOARD_MAX_KEYCODES.ConvertCharacter(keycode, state, keyboardType).libSceConvertKeycodeto 4/4 (100.0%) completion.GuestConvertKeycodetest suite covering invalid pointers, out-of-bounds indices, invalid keyboard types, and character resolution.Tested
GuestConvertKeycodetest covers invalid address rejection, out-of-bounds index, keyboard layout validation, and successful UTF-16 character translation (both unshifted and shifted).python tools/check_conventions.py --base origin/mainpasses.python tools/progress.py --module libSceConvertKeycodereports 4/4 functions (100.0% complete).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 MarcZX10 on 2026-10-24T00:22:12Z.
Review: CHANGES_REQUESTED
The implementation uses the existing
ConvertCharacterpath and bounds the array index by bothKeyboardData::lengthandKEYBOARD_MAX_KEYCODES, which is the right shape for avoiding an out-of-bounds read. I found two items to resolve before this is ready:conventionscheck fails on this exact head becauseWhat,Tested, andChecklistare missing. Please copy.github/pull_request_template.mdinto the body, preserve every line, and complete the required fields (includingDepends on,Unblocks,GPUs tested, andAI-assisted).keyData/output, negative index, index at/abovelength, and alengthlarger than the fixed 16-entry array). The existingsceConvertKeycodeGetCharacterbehavior provides the conversion path, but does not test this entry point's data and index validation.I checked the exact diff and the existing
KeyboardDatadefinition:lengthis signed andkey_codehas 16 entries, so both bounds are relevant. I did not find a public primary source establishing additional console-specific error semantics, and I am not claiming hardware verification. The hosted conventions failure is directly reproducible from the reported check log; product tests have not run for this change.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T00:24:06Z.
Review: DISMISSED
Thanks for completing the required PR template; the conventions check now passes on head
9870149ee560936b299da388e7453099c2f73d95.The implementation change is otherwise unchanged, and I still do not see regression tests for the new export. The PR now reports “Tested on Windows 11 host” but does not identify a test command or test cases; the hosted checks shown for this head are conventions and labels only. Please add focused coverage for a normal conversion and the validation paths introduced here: null
keyData, null output, negative index, index equal tolength, index at the 16-entry array bound, and a declared length greater than 16. This makes the pointer/index behavior reviewable and checks that the sharedConvertCharacterhelper receives the selected keycode.I did not run a local product test: CMake configuration stops because SDL2 development package configuration is missing. The exact current diff and the existing signed-length/16-element
KeyboardDatadefinition were reviewed.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-26T17:17:14Z.
Review: CHANGES_REQUESTED
Thanks for the tests. Items before this can merge:
core/libs/prx/libSceConvertKeycode/Export.cpp:2442-2444: the result for an index outsidekeyData->length/KEYBOARD_MAX_KEYCODESiskErrInvalidAddress, but none of the references (shadPS4, fpPS4 only list the name; KytyPS5 and prosper don't implement it) give the real error code or validation order. Please cite where it comes from, or throw for that case and record it indocs/dev/debt/libSceConvertKeycode.md.Export.cpp:2441: the newkeyboardType >= 31throw is not covered by the test, and the debt file only namesGetVirtualKeycodeandGetCharacter; addsceConvertKeycodeGetCharacterFromKeyboardDatathere.mainincore/libs/tests/GuestConvertKeycode.cpp(adjacent test additions); please rebase.