Skip to main content
The On-Screen Keyboard (OSK) API provides text input functionality through the PS3’s virtual keyboard interface.

Core Functions

oskLoadAsync

Open the on-screen keyboard.
s32 oskLoadAsync(sys_mem_container_t container, const oskParam *param, const oskInputFieldInfo *inputInfo);
container
sys_mem_container_t
Memory container ID. Typical size is 4 MB.
param
const oskParam*
Pointer to OSK parameters structure defining keyboard appearance and behavior.
inputInfo
const oskInputFieldInfo*
Pointer to input field information structure.
return
s32
Returns 0 on success, nonzero on error.

oskUnloadAsync

Close the on-screen keyboard.
s32 oskUnloadAsync(oskCallbackReturnParam *param);
param
oskCallbackReturnParam*
Pointer to structure receiving the keyboard results.
return
s32
Returns 0 on success, nonzero on error.

oskGetInputText

Get the current input text from the keyboard.
s32 oskGetInputText(oskCallbackReturnParam *info);
info
oskCallbackReturnParam*
Pointer to structure receiving the input text and status.
return
s32
Returns 0 on success, nonzero on error.

oskAbort

Abort the currently opened keyboard.
s32 oskAbort();
return
s32
Returns 0 on success, nonzero on error.

Configuration Functions

oskSetInitialInputDevice

Set the initial input device for the keyboard.
s32 oskSetInitialInputDevice(oskInputDevice input);
input
oskInputDevice
Initial input device:
  • OSK_DEVICE_PAD - PS3 controller
  • OSK_DEVICE_KB - USB keyboard
return
s32
Returns 0 on success, nonzero on error.

oskSetInitialKeyLayout

Set the initial keyboard layout.
s32 oskSetInitialKeyLayout(oskKeyLayout layout);
layout
oskKeyLayout
Initial keyboard layout:
  • OSK_INITIAL_SYSTEM_PANEL - System default panel
  • OSK_INITIAL_10KEY_PANEL - 10-key keypad panel
  • OSK_INITIAL_FULLKEY_PANEL - Full keyboard panel
return
s32
Returns 0 on success, nonzero on error.

oskSetLayoutMode

Set the layout mode for keyboard positioning.
s32 oskSetLayoutMode(s32 mode);
mode
s32
Layout mode flags (OR’ed combination):Horizontal Alignment:
  • OSK_LAYOUTMODE_HORIZONTAL_ALIGN_LEFT (0x00000800)
  • OSK_LAYOUTMODE_HORIZONTAL_ALIGN_CENTER (0x00000400)
  • OSK_LAYOUTMODE_HORIZONTAL_ALIGN_RIGHT (0x00000200)
Vertical Alignment:
  • OSK_LAYOUTMODE_VERTICAL_ALIGN_TOP (0x00004000)
  • OSK_LAYOUTMODE_VERTICAL_ALIGN_CENTER (0x00002000)
  • OSK_LAYOUTMODE_VERTICAL_ALIGN_BOTTOM (0x00001000)
return
s32
Returns 0 on success, nonzero on error.

oskSetKeyLayoutOption

Set keyboard key layout options.
s32 oskSetKeyLayoutOption(u32 flags);
flags
u32
Key layout flags:
  • OSK_10KEY_PANEL (1) - 10-key keypad
  • OSK_FULLKEY_PANEL (2) - Full keyboard
return
s32
Returns 0 on success, nonzero on error.

oskSetDeviceMask

Set allowed input devices.
s32 oskSetDeviceMask(u32 mask);
mask
u32
Device mask:
  • 0 - All devices allowed
  • OSK_DEVICE_MASK_PAD (0xff) - Only controller allowed
return
s32
Returns 0 on success, nonzero on error.

oskDisableDimmer

Disable the background dimmer filter.
s32 oskDisableDimmer();
return
s32
Returns 0 on success, nonzero on error.

oskSetSeparateWindowOption

Set options for separate window mode.
s32 oskSetSeparateWindowOption(oskSeparateWindowOption *option);
option
oskSeparateWindowOption*
Pointer to separate window options structure.
return
s32
Returns 0 on success, nonzero on error.

oskAddSupportLanguage

Add a supported language to the keyboard.
s32 oskAddSupportLanguage(u32 lang);
lang
u32
Language panel type (see Panel Types below).
return
s32
Returns 0 on success, nonzero on error.

oskGetSize

Get the size of the keyboard panel.
s32 oskGetSize(u16 *width, u16 *height, oskType type);
width
u16*
Pointer to store panel width in pixels.
height
u16*
Pointer to store panel height in pixels.
type
oskType
OSK type to query size for.
return
s32
Returns 0 on success, nonzero on error.

Data Structures

oskParam

Keyboard parameters structure.
typedef struct _osk_param {
    u32 allowedPanels;
    u32 firstViewPanel;
    oskPoint controlPoint;
    s32 prohibitFlags;
} oskParam;
allowedPanels
u32
OR’ed combination of allowed panel types.
firstViewPanel
u32
Initial panel type to display.
controlPoint
oskPoint
Panel origin control point.
prohibitFlags
s32
Prohibited input flags:
  • OSK_PROHIBIT_SPACE (0x00000001) - Prohibit space
  • OSK_PROHIBIT_RETURN (0x00000002) - Prohibit return/enter
  • OSK_PROHIBIT_INPUT_ANALOG (0x00000008) - Prohibit analog input

oskInputFieldInfo

Input field information.
typedef struct _osk_input_field_info {
    u16 *message;
    u16 *startText;
    s32 maxLength;
} oskInputFieldInfo;
message
u16*
Buffer for message text (UTF-16).
startText
u16*
Initial text to display (UTF-16).
maxLength
s32
Maximum number of characters allowed.

oskCallbackReturnParam

Return parameters from keyboard.
typedef struct _osk_cb_return_param {
    oskInputFieldResult res;
    s32 len;
    u16 *str;
} oskCallbackReturnParam;
res
oskInputFieldResult
Result status:
  • OSK_OK - Input success
  • OSK_CANCELED - Input canceled
  • OSK_ABORT - Input aborted
  • OSK_NO_TEXT - No text entered
len
s32
Number of characters entered.
str
u16*
Array of characters entered (UTF-16).

oskSeparateWindowOption

Separate window options.
typedef struct _osk_separate_window_option {
    oskContinuousMode continuous;
    s32 mask;
    s32 inputWidth;
    f32 inputFieldTransparency;
    oskLayoutInfo *inputFieldLayoutInfo;
    oskLayoutInfo *inputPanelLayoutInfo;
    u32 reserved;
} oskSeparateWindowOption;
continuous
oskContinuousMode
Continuous mode:
  • OSK_CONTINUOUS_MODE_NONE - No continuous mode
  • OSK_CONTINUOUS_MODE_REMAIN_OPEN - Keep panel open
  • OSK_CONTINUOUS_MODE_HIDE - Hide panel by default
  • OSK_CONTINUOUS_MODE_SHOW - Show panel by default
mask
s32
Device mask (0 or OSK_DEVICE_MASK_PAD).
inputWidth
s32
Input field width.
inputFieldTransparency
f32
Input field transparency (0.0 - 1.0).

oskPoint

Point structure for positioning.
typedef struct _osk_pnt {
    f32 x;
    f32 y;
} oskPoint;

oskLayoutInfo

Layout information.
typedef struct _osk_layout_info {
    s32 layoutMode;
    oskPoint position;
} oskLayoutInfo;

Panel Types

Keyboard Types

typedef enum {
    OSK_SINGLELINE,
    OSK_MULTILINE,
    OSK_FULLKB_SINGLELINE,
    OSK_FULLKB_MULTILINE,
    OSK_SEPARATE_SINGLELINE_WINDOWED,
    OSK_SEPARATE_MULTILINE_WINDOWED,
    OSK_SEPARATE_INPUT_PANEL_WINDOWED,
    OSK_SEPARATE_FULLKB_INPUT_PANEL_WINDOWED,
    OSK_SEPARATE_CANDIDATE_WINDOWED
} oskType;

Example Usage

#include <sysutil/osk.h>
#include <sysutil/sysutil.h>
#include <stdio.h>
#include <string.h>
#include <wchar.h>

#define INPUT_MAX_LENGTH 128

static u16 inputBuffer[INPUT_MAX_LENGTH + 1];
static u16 messageBuffer[INPUT_MAX_LENGTH + 1];
static u16 initialText[INPUT_MAX_LENGTH + 1];

void sysutil_callback(u64 status, u64 param, void *usrdata) {
    switch(status) {
        case SYSUTIL_OSK_LOADED:
            printf("OSK loaded\n");
            break;
        case SYSUTIL_OSK_DONE:
            printf("OSK input done\n");
            break;
        case SYSUTIL_OSK_UNLOADED:
            printf("OSK unloaded\n");
            break;
    }
}

int main() {
    sys_mem_container_t container;
    oskParam param;
    oskInputFieldInfo inputInfo;
    oskCallbackReturnParam result;
    
    // Register system callback
    sysUtilRegisterCallback(SYSUTIL_EVENT_SLOT0, sysutil_callback, NULL);
    
    // Set up initial text
    memset(initialText, 0, sizeof(initialText));
    wcscpy((wchar_t*)initialText, L"Enter your name");
    
    // Set up input field info
    inputInfo.message = messageBuffer;
    inputInfo.startText = initialText;
    inputInfo.maxLength = INPUT_MAX_LENGTH;
    
    // Set up OSK parameters
    param.allowedPanels = OSK_PANEL_TYPE_ALPHABET;
    param.firstViewPanel = OSK_PANEL_TYPE_ALPHABET;
    param.controlPoint.x = 0.0f;
    param.controlPoint.y = 0.0f;
    param.prohibitFlags = 0;
    
    // Load the keyboard
    oskLoadAsync(container, &param, &inputInfo);
    
    // Main loop - wait for keyboard events
    int running = 1;
    while(running) {
        sysUtilCheckCallback();
        
        // Check if keyboard is done
        if(oskGetInputText(&result) == 0) {
            if(result.res == OSK_OK) {
                // User entered text
                wprintf(L"User entered: %ls\n", result.str);
                running = 0;
            } else if(result.res == OSK_CANCELED) {
                printf("User canceled input\n");
                running = 0;
            }
        }
    }
    
    // Cleanup
    oskUnloadAsync(&result);
    sysUtilUnregisterCallback(SYSUTIL_EVENT_SLOT0);
    
    return 0;
}

Build docs developers (and LLMs) love