OldSchool Library
On-Screen Keyboard

Data Structures

struct  OSL_KEYBOARD
 Structure representing the on-screen keyboard (OSK) parameters. More...
 

Macros

#define OSL_OSK_RESULT_UNCHANGED   PSP_UTILITY_OSK_RESULT_UNCHANGED
 Indicates that the OSK result is unchanged.
 
#define OSL_OSK_RESULT_CANCELLED   PSP_UTILITY_OSK_RESULT_CANCELLED
 Indicates that the OSK operation was cancelled.
 
#define OSL_OSK_RESULT_CHANGED   PSP_UTILITY_OSK_RESULT_CHANGED
 Indicates that the OSK result has changed.
 
#define OSL_OSK_CANCEL   PSP_UTILITY_OSK_RESULT_CANCELLED
 OSK cancel result.
 
#define OSL_OSK_CHANGED   PSP_UTILITY_OSK_RESULT_CHANGED
 OSK changed result.
 
#define OSL_OSK_UNCHANGED   PSP_UTILITY_OSK_RESULT_UNCHANGED
 OSK unchanged result.
 

Functions

OSL_KEYBOARDoslInitOskEx (int nData, int language)
 Initializes the on-screen keyboard with specified parameters.
 
int oslInitOskDataEx (OSL_KEYBOARD *kbd, int idx, unsigned short *desc, unsigned short *intext, int textLimit, int linesNumber)
 Initializes specific OSK data.
 
int oslActivateOskEx (OSL_KEYBOARD *kbd, int waitcycle)
 Activates the on-screen keyboard.
 
int oslOskIsActiveEx (OSL_KEYBOARD *kbd)
 Checks if the on-screen keyboard is active.
 
void oslDeActivateOskEx (OSL_KEYBOARD *kbd)
 Deactivates the on-screen keyboard.
 
int oslOskGetResultEx (OSL_KEYBOARD *kbd, int idx)
 Gets the result of the on-screen keyboard interaction.
 
unsigned short * oslOskOutTextEx (OSL_KEYBOARD *kbd, int idx)
 Retrieves the text output from the on-screen keyboard.
 
void oslEndOskEx (OSL_KEYBOARD *kbd)
 Ends the on-screen keyboard session and releases resources.
 
void oslInitOsk (char *descStr, char *initialStr, int textLimit, int linesNumber, int language)
 Initializes the OSK with basic parameters.
 
void oslDrawOsk ()
 Draws the OSK on the screen.
 
int oslOskIsActive ()
 Checks if the OSK is currently active.
 
int oslGetOskStatus ()
 Returns the current OSK status.
 
int oslOskGetResult ()
 Returns the result of the OSK interaction.
 
void oslOskGetText (char *text)
 Retrieves the text inserted by the user in the OSK.
 
void oslOskGetTextUCS2 (unsigned short *text)
 Retrieves the text inserted by the user in the OSK (UCS2).
 
void oslEndOsk ()
 Ends the OSK session.
 

Variables

OSL_KEYBOARDosl_osk
 Global instance of the on-screen keyboard.
 

Detailed Description

Functions to display Sony's On Screen Keyboard.

Macro Definition Documentation

◆ OSL_OSK_RESULT_UNCHANGED

#define OSL_OSK_RESULT_UNCHANGED   PSP_UTILITY_OSK_RESULT_UNCHANGED

Indicates that the OSK result is unchanged.

This macro maps to PSP_UTILITY_OSK_RESULT_UNCHANGED, which is used to indicate that the user did not modify the text in the On-Screen Keyboard.

◆ OSL_OSK_RESULT_CANCELLED

#define OSL_OSK_RESULT_CANCELLED   PSP_UTILITY_OSK_RESULT_CANCELLED

Indicates that the OSK operation was cancelled.

This macro maps to PSP_UTILITY_OSK_RESULT_CANCELLED, which is used to indicate that the user cancelled the On-Screen Keyboard without making changes.

◆ OSL_OSK_RESULT_CHANGED

#define OSL_OSK_RESULT_CHANGED   PSP_UTILITY_OSK_RESULT_CHANGED

Indicates that the OSK result has changed.

This macro maps to PSP_UTILITY_OSK_RESULT_CHANGED, which is used to indicate that the user modified the text in the On-Screen Keyboard.

◆ OSL_OSK_CANCEL

#define OSL_OSK_CANCEL   PSP_UTILITY_OSK_RESULT_CANCELLED

OSK cancel result.

Deprecated
Use PSP_UTILITY_OSK_RESULT_CANCELLED instead.

Function Documentation

◆ oslInitOskEx()

OSL_KEYBOARD * oslInitOskEx ( int nData,
int language )
extern

Initializes the on-screen keyboard with specified parameters.

Parameters
nDataNumber of data entries to initialize.
languageLanguage of the on-screen keyboard.
Returns
Pointer to the initialized OSL_KEYBOARD structure.

◆ oslInitOskDataEx()

int oslInitOskDataEx ( OSL_KEYBOARD * kbd,
int idx,
unsigned short * desc,
unsigned short * intext,
int textLimit,
int linesNumber )
extern

Initializes specific OSK data.

Parameters
kbdPointer to the OSL_KEYBOARD structure.
idxIndex of the data entry.
descDescription text (UTF-16).
intextInitial text input (UTF-16).
textLimitMaximum number of characters.
linesNumberNumber of lines for input.
Returns
Status code of the initialization process.

◆ oslActivateOskEx()

int oslActivateOskEx ( OSL_KEYBOARD * kbd,
int waitcycle )
extern

Activates the on-screen keyboard.

Parameters
kbdPointer to the OSL_KEYBOARD structure.
waitcycleTime to wait before the OSK is fully activated.
Returns
Status code of the activation process.

◆ oslOskIsActiveEx()

int oslOskIsActiveEx ( OSL_KEYBOARD * kbd)
extern

Checks if the on-screen keyboard is active.

Parameters
kbdPointer to the OSL_KEYBOARD structure.
Returns
Non-zero if the OSK is active, zero otherwise.

◆ oslDeActivateOskEx()

void oslDeActivateOskEx ( OSL_KEYBOARD * kbd)
extern

Deactivates the on-screen keyboard.

Parameters
kbdPointer to the OSL_KEYBOARD structure.

◆ oslOskGetResultEx()

int oslOskGetResultEx ( OSL_KEYBOARD * kbd,
int idx )
extern

Gets the result of the on-screen keyboard interaction.

Parameters
kbdPointer to the OSL_KEYBOARD structure.
idxIndex of the data entry.
Returns
Result code indicating whether the text was changed, unchanged, or canceled.

◆ oslOskOutTextEx()

unsigned short * oslOskOutTextEx ( OSL_KEYBOARD * kbd,
int idx )
extern

Retrieves the text output from the on-screen keyboard.

Parameters
kbdPointer to the OSL_KEYBOARD structure.
idxIndex of the data entry.
Returns
Pointer to the text output (UTF-16).

◆ oslEndOskEx()

void oslEndOskEx ( OSL_KEYBOARD * kbd)
extern

Ends the on-screen keyboard session and releases resources.

Parameters
kbdPointer to the OSL_KEYBOARD structure.

◆ oslInitOsk()

void oslInitOsk ( char * descStr,
char * initialStr,
int textLimit,
int linesNumber,
int language )

Initializes the OSK with basic parameters.

Parameters
descStrText shown as a description (bottom right corner).
initialStrInitial text in the OSK.
textLimitMaximum number of characters.
linesNumberNumber of lines.
languageLanguage for the OSK.
  • 0: JAPANESE
  • 1: ENGLISH
  • 2: FRENCH
  • 3: SPANISH
  • 4: GERMAN
  • 5: ITALIAN
  • 6: DUTCH
  • 7: PORTUGUESE
  • 8: RUSSIAN
  • 9: KOREAN
  • 10: CHINESE_TRADITIONAL
  • 11: CHINESE_SIMPLIFIED
  • -1: Use the language set in the firmware.

◆ oslDrawOsk()

void oslDrawOsk ( )

Draws the OSK on the screen.

After drawing it, you should check if the user has closed it. Remember to call oslEndOsk to properly terminate the OSK.

if (oslGetOskStatus() == PSP_UTILITY_DIALOG_NONE){
//The user closed the OSK
}
}
int oslOskIsActive()
Checks if the OSK is currently active.
void oslDrawOsk()
Draws the OSK on the screen.
int oslGetOskStatus()
Returns the current OSK status.
void oslEndOsk()
Ends the OSK session.

◆ oslOskIsActive()

int oslOskIsActive ( )

Checks if the OSK is currently active.

Returns
Non-zero if the OSK is active, zero otherwise.

◆ oslGetOskStatus()

int oslGetOskStatus ( )

Returns the current OSK status.

Returns
Current status of the OSK.

◆ oslOskGetResult()

int oslOskGetResult ( )

Returns the result of the OSK interaction.

Returns
Result code (OSL_OSK_CHANGED, OSL_OSK_UNCHANGED, or OSL_OSK_CANCEL).

◆ oslOskGetText()

void oslOskGetText ( char * text)

Retrieves the text inserted by the user in the OSK.

Parameters
textPointer to the buffer where the text will be stored (UTF-8).

◆ oslOskGetTextUCS2()

void oslOskGetTextUCS2 ( unsigned short * text)

Retrieves the text inserted by the user in the OSK (UCS2).

Parameters
textPointer to the buffer where the text will be stored (UTF-16).

◆ oslEndOsk()

void oslEndOsk ( )

Ends the OSK session.

This function should be called after the OSK is closed to clean up resources.