feat(libSceImeDialog): type with the controller on an on-screen keyboard #11207
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11207"
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 EagleBearerYS on 2026-10-25T21:50:42Z.
What
sceImeDialognow shows a keyboard the controller types on. Until now the dialog drew nothing, and only the host keyboard could type, so a player with only a controller couldn't get past a name or text prompt. The keyboard follows shadPS4's pad keyboard (30f4170896) for its pages, labels and bindings. Each part is its own commit:libSceImeDialog/src/PadKeyboard.cpp):supported_languages, the enter key's label followsenter_label, and the starting page follows the extendedpriority.disable_devicecontroller turns shortcuts and navigation off.libSceIme): a sink for the captured pad and a provider for the keyboard's view. Both are cleared when the dialog ends.libSceImeDialog/Export.cpp): pad edits go through the same path as host typing. R2 or Done accepts and Circle cancels. As before, the host keyboard can type and Enter accepts, and the text is written to the title's buffer once, on accept.libSceVideoOut,libScePad):0x80000000(Intercepted) bit set, as shadPS4's pad library does while its IME holds the pad.libSceAgcDriver):RecordRects, and its palette grows from 3 to 7 colours.KeyboardOverlay.cpplays the keyboard out in the bottom half of the frame, at about 3 screen pixels per glyph pixel at 1080p. It uses a hand-made 5×9 font that covers printable ASCII, every character on the pages and the key symbols. Anything else, such as CJK, falls back to a box.VulkanDevice::presentdraws the keyboard over each flipped frame, before the performance overlay.VideoOutDriver::presentLoophands it the dialog's state before each flip.docs/dev/debt/libSceImeDialog.md) records the open questions:Merge order with #10507: this PR goes first, as orezraey proposed (comment). The two conflict in
VulkanDevice.cpp, in 5 hunks, 2 of them #10487's own. orezraey mergesmaininto #10507 after this, keeping the keyboard path next to the overlay compositing. If #10043 merges after this, the keyboard's starting layout also needs|| upscaled.Octopath Traveler 0 (PPSA28495) at its favourite-food prompt, on Windows: the keyboard as it opens, the text typed, and the title's box after R2.
Tested
main+ #10487, 10 times, with no failures.ime_dialog_pad_keyboard,guest_ime_pad_route,agc_keyboard_overlay,guest_ime_dialog,pad_sdl,guest_padand the fouragc_performance_overlaytests.anyps5-input.ini.anyps5-input.iniline replaces only its own action's bindings. So each Left press also cycled the case.ime_dialog_pad_keyboard's case tests expect.APS5_PAD_INPUT_FILEsamples, since the pad reads give the Intercepted sample then;Mouse wheel and mouse button bindings do reach it.
ime_dialog_pad_keyboardcovers the model;guest_ime_pad_routecovers the routing;agc_keyboard_overlaycovers the layout of every page at 1280×720 and 1920×1080, glyph coverage, the CJK and emoji fallback, the caret, and palette contrast in sRGB and PQ.guest_ime_dialog: typing, R2, Circle, Abort, Term, ForceClose, a button held at open, the length cap,disable_deviceand priority;pad_sdl: the Intercepted sample, the sink, and buttons held after close;agc_performance_overlay: the keyboard in SDR and HDR10, under the performance overlay, and after the presentation pass.check_test_registration.pyand passes its own tests. Each code commit's test fails with that commit's code reverted.main+ #10487. The new and changed tests passed 10 times in a row.main+ #10487 (2a5b1f2688) against 042dc0ade7 on the same machine: Khronos layer 1.3.275 withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, sync validation on (VK_KHRONOS_VALIDATION_VALIDATE_SYNC=true) andANYPS5_REQUIRE_VULKAN=1, each test alone underctest -V.ANYPS5_NO_SHADER_CACHEwasn't set; the run on GitHub's runner below sets it.VK_LOADER_DEBUG=layerput the loader's "Insert instance layer" line in every log of a test that creates an instance.agc_performance_overlay,agc_driver_presentation_passandagc_resident_present: 0 VUIDs on both sides.video_out_hdr_present, under Xvfb:VUID-VkDeviceCreateInfo-pNext-pNext×3 on both sides. It comes from the layer's age: the device's create chain has a structure newer than 1.3.275.video_out_flip_testsmodes, run directly under Xvfb with the same layer settings: 23 of 23 pass on both sides, and the only VUID is the same pNext one, on both.sceImeDialogTerm.ReadStateafter the hand-off returned it beside the Intercepted bit, andReadreturned the queued samples from before the capture unmasked. The sample that starts the capture now clears both.guest_pad's new case publishes Cross and then an intercepted sample before any read, and requiresReadStateto return exactly0x80000000. A second pass requires every sampleReadreturns to be0x80000000too.pad_sdlnow leaves an A press and release unread before the hand-off, and checks every queued sample instead of only the last.guest_padandpad_sdlfail on both runners. With the fix, the pad, IME, keyboard and performance overlay tests pass 10 runs in a row. Linux: 10 run, 10 pass, 0 skip, 0 fail. Windows: 10 run, 8 pass, 2 skip, 0 fail;agc_performance_overlayandagc_performance_overlay_device_selectionskip, since that runner has no Vulkan device.APS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.main+ #10487 (2a5b1f2688) against 533ecba824, both built and run on the same runner, on lavapipe (llvmpipe, Mesa 25.2.8, LLVM 20.1.2) with vulkan-validationlayers 1.3.275. Both arms setVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1andANYPS5_REQUIRE_VULKAN=1, and run the tests underctest -VwithVK_LOADER_DEBUG=layer.agc_resident_present,agc_driver_presentation_pass,agc_performance_overlayandagc_performance_overlay_device_selection: 4 times inmain's one run, 12 in this branch's three. Neither log has the "was not found but was requested by env var VK_INSTANCE_LAYERS" warning.VUID-,SYNC-HAZARDorUNASSIGNED-message on either side.main's tree ran the 10 of these tests it has;agc_keyboard_overlay,guest_ime_pad_routeandime_dialog_pad_keyboardare new here. The other tests create no Vulkan instance, andvideo_out_hdr_presentskips on the runner, which has no display.main14c99b52ac; nothing conflicted. The keyboard, IME, pad and overlay tests pass 10 runs in a row. Linux: 10 run, 10 pass, 0 skip, 0 fail. Windows: 10 run, 8 pass, 2 skip, 0 fail; the two skipped (agc_performance_overlayandagc_performance_overlay_device_selection) need a Vulkan device, which the Windows runner lacks. Suites: libc and libkernel pass on Linux (145 and 210) and on Windows (172 and 230). The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.main190386eb70(run). zaidhawk's #9919 addskLatchExpiryLimittoPadState.cppnext to this PR'skInterceptedButton; the merge keeps both, and nothing else conflicted. This PR's changed lines are the same. The pad, IME dialog and overlay tests, 10 of them, pass 10 runs in a row. Linux: 10 run, 10 pass, 0 skip, 0 fail. Windows: 10 run, 8 pass, 2 skip, 0 fail;agc_performance_overlayandagc_performance_overlay_device_selectionskip there. Suites: libc and libkernel pass on Linux (145 and 210) and on Windows (173 and 231). The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.SAVEDATA0PlayerProfile0and continues to the tutorial. The R2 shortcut was not tried there. The IME pad-keyboard, pad-route, dialog and overlay tests pass on that machine.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)maininto it)mainthe dialog draws nothing and only takes host keyboard text. With this change the run moved past the prompt.Related: #6404, for Plants vs. Zombies: Replanted (PPSA29802). A player reported being stuck at its name prompt without a keyboard; not tested here.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T22:02:18Z.
Review: DISMISSED
The controller handoff still leaks pre-dialog input to the title. I compiled the exact PR
PadState.cppand header with only a stub forsceKernelGetProcessTime, then reproduced both public read paths:Pad::ReadState(0)returns0x80004000(Intercepted plus Cross), because it ORspressedSinceReadinto the already-intercepted result.Pad::Read(..., 64, 0)returnscount=2, with0x00004000as the first sample and0x80000000as the last. It drains the pre-capture queue without masking its entries.This contradicts the PR's stated behavior that every pad read while the keyboard is open contains only the Intercepted bit.
PadSdl.cppcurrently checks onlyqueued[count - 1], so it misses the earlier queued button. Please suppress/clear pending press latches and pre-capture queued samples at handoff, and add regressions that assert every result from bothReadStateandReadis neutral while captured.Please also finish the required report details:
CONTRIBUTING.mdrequires theUnblocksentry to link the Game bring-up discussion. The matching discussion is #11114; add it to the checklist.VulkanDevice.cppconflict, but the checklist lists only #10487 underDepends on. Please list #10507 there too, or update the stated merge order.VUID-messages but does not state whether the comparison usedVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1, andANYPS5_REQUIRE_VULKAN=1, or confirm neither log contains the missing-layer warning. Please add those exact run details and the main/change comparison, or run the prescribed check if it was not done.I fetched exact head
042dc0ade7dcaac81d57d3b79d7cc3c941305494.python3 tools/check_conventions.py --base upstream/main --head upstream/pr/11207andgit diff --check upstream/main...upstream/pr/11207pass. The PR author's validation/test results are reported in the description; I have not independently run the full Vulkan suite.