Files
AnyPS5/core/libs/prx/libSceKeyboard/Export.cpp
T
Adrià FranchandClaude 63501b6d73 feat(libSceKeyboard): implement the keyboard library
Keyboard input follows libSceMouse: the video out event loop forwards SDL
key and focus events, whose scancodes are USB HID usages, and the library
keeps the pressed keys, modifiers and lock LEDs in a 16-entry history for
sceKeyboardRead and a snapshot for sceKeyboardReadState.
sceKeyboardGetKey2Char translates the 101-key arrangement; the 106-key
one throws and is listed as technical debt.

KeyboardData holds 16 key codes (96 bytes), not 6.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-01 19:00:23 +02:00

35 lines
1008 B
C++

#include "prx/libSceKeyboard/include/KeyboardState.hpp"
extern "C" {
int APS5_VABI sceKeyboardInit(void) {
return Keyboard::Initialize();
}
int APS5_VABI sceKeyboardOpen(int user_id, int32_t type, int32_t index, const void* param) {
(void)param;
return Keyboard::Open(user_id, type, index);
}
int APS5_VABI sceKeyboardClose(int32_t handle) {
return Keyboard::Close(handle);
}
int APS5_VABI sceKeyboardRead(int32_t handle, KeyboardData* data, int32_t num) {
return Keyboard::Read(handle, data, num);
}
int APS5_VABI sceKeyboardReadState(int32_t handle, KeyboardData* data) {
return Keyboard::ReadState(handle, data);
}
int APS5_VABI sceKeyboardGetKey2Char(int32_t handle, int32_t arrange, uint32_t led, uint32_t modifier_key, uint16_t key_code, KeyboardCharData* char_data) {
return Keyboard::GetKey2Char(handle, arrange, led, modifier_key, key_code, char_data);
}
void KeyboardPublishInput_nid_postfix(const KeyboardInputEvent& event) {
Keyboard::Publish(event);
}
}