feat(libSceKeyboard): implement the keyboard library #225
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/225"
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 adriadam10 on 2026-10-01T17:00:43Z.
What
Implements all six
libSceKeyboardexports, following the structure oflibSceMouse.KeyboardInputinlibSceVideoOutforwards SDL key and window focus events from the existing event loop, the same wayMouseInputdoes. SDL2 scancodes are USB HID usages, so they are passed as is; key repeats are ignored. Lock LEDs come from the SDL modifier state.0xE0–0xE7) and the LEDs. Every change is queued in a 16-entry history forsceKeyboardRead;sceKeyboardReadStatereturns the current state. Losing focus releases all keys; closing the window reports a disconnect, as with the mouse.sceKeyboardGetKey2Chartranslates the 101-key (US) arrangement: letters with Shift/Caps Lock, digits and symbols with Shift, keypad digits with Num Lock, Enter/Backspace/Tab/Space as\n \b \t ' '. Keys without a character returnprocessed = false. The 106-key (Japanese) arrangement throws and is listed inTechnicalDebt.md.0x80DA0001–0x80DA0005as in shadPS4; the open/close/read rules mirrorlibSceMouse.KEYBOARD_MAX_KEYCODESinSceTypes.hppgoes from 6 to 16: KytyPS5 and SharpProspero both defineSceKeyboardDatawith 16 key codes (96 bytes); with 6 the struct is 76 bytes. Layout is pinned withstatic_asserts.Tested
Linux (CachyOS, GCC): new
keyboard_inputtest (core/libs/prx/libSceKeyboard/tests/Keyboard.cpp) passes. It drivesKeyboardInputwith synthetic SDL events (window filter, repeats, modifiers, LEDs, focus loss, disconnect, 16-key limit, history overflow) and checks the character table. It fails on each of three injected bugs (one table entry changed, keys kept on focus loss, no 16-key limit). Full suite: 90/90 pass. Windows only through CI. No title tested: no keyboard title available.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-01T17:01:10Z.
Progress report (
bc51b33→63501b6)📈 System libraries: 76.7% (+0.2%, +6 implemented functions)
✅ 6 implemented
sceKeyboardClosesceKeyboardGetKey2CharsceKeyboardInitsceKeyboardOpensceKeyboardReadsceKeyboardReadState