Files
AnyPS5/docs/dev/debt/libSceIme.md
T

4.2 KiB

libSceIme technical debt

Silent stubs

  • sceImeOpen (libSceIme) shows no panel: the text is typed on the host keyboard, which ImeTextInput forwards from the game window (SDL text input, Backspace, Delete, Left, Right, Home, End, Enter and Escape), and the controller cannot type. While a panel is open, key presses do not reach the keyboard-to-pad bindings of PadInput, as the console's panel takes the controller; key releases still do. Minecraft Preview (PPSA19639, #1277) opens it when entering a world

Unknown function info

  • sceImeGetPanelPositionAndForm (libSceIme) - the output is taken to be the PositionAndForm that sceImeDialogGetPanelPositionAndForm fills. While a panel is open it reports the type, position and alignments passed to sceImeOpen and the size sceImeGetPanelSize gives; the console's values for a panel moved by its own position adjustment are unknown. That a closed panel is reported before a null output is assumed by analogy with sceImeSetCaret, not confirmed on a PS5 title
  • sceImeOpen, sceImeUpdate, sceImeSetText, sceImeSetCaret, sceImeClose (libSceIme) - the event ids (Open 0, UpdateText 1, UpdateCaret 2, PressClose 4, PressEnter 5), the caret directions (left 1, right 2), the error codes and the text event payload follow the PS4 reimplementation in shadPS4; none is measured on a PS5. Events are queued and delivered by sceImeUpdate only when it is passed the handler given to sceImeOpen, with that call's arg. A text event points str at a copy of the text kept in work, and inputTextBuffer holds the same text; both are terminated, caret_index is the caret after the edit and the one edit area has the edit position and the change in UTF-16 units (0 for Enter and Close). An edit sends one UpdateText; a caret move sends one UpdateCaret per UTF-16 unit, as shadPS4 does. Enter inserts a line break with the multiline option and sends PressEnter otherwise; Escape sends PressClose. Typed text is cut to maxTextLength without splitting a surrogate pair, line breaks are dropped without the multiline option, and the BasicLatin, URL, mail and number types do not filter characters. sceImeOpen checks, in shadPS4's order, the user, type, enter label, input method, option bits (the sceImeGetPanelSize mask), maxTextLength (1 to 2048), the text buffer, the position (below 1920x1080, or 3840x2160 with the over-2K option), the alignments, the extended priority and reserved bytes, work (non-null, 4-byte aligned), the handler, the reserved bytes and the initial text (no unpaired surrogate, no line break without the multiline option); shadPS4's SDK-dependent option, language and extended-option masks and its work-overlap check are not applied, and only the text copy is written to work. A text filter or an external keyboard filter throws, as their contract is unknown. sceImeSetText keeps the caret unless the text became shorter, sceImeSetCaret rejects an index past the text with 0x80bc0030, and neither sends an event. sceImeSetTextGeometry accepts any geometry while a panel is open, since no panel is drawn

Functional

  • sceImeKeyboardGetInfo (libSceIme) returns 0x80bc0023 (no resource id) for every id while a keyboard is open, since the IME keyboard never reports a connected device. sceImeKeyboardSetMode validates the mode bits but the mode has no effect, as no IME keyboard events are delivered.
  • sceImeKeyboardGetResourceId (libSceIme) reports that no USB keyboard is connected (0x80bc0004, as shadPS4 does) because IME keyboard events are not delivered to the handler, although libSceKeyboard exposes the host keyboard