Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 1.07 BOIII
- 0x59DE1C - void OSK(int localClientNum, const wchar_t *title, const wchar_t *presetMessage, unsigned int lenght, void(*completeFunction)(int localClientNum, const wchar_t *wstring, unsigned int textLenght, bool ifCanceled), int panelMode);
- size_t StringToWideCharacter(wchar_t *dest, const char *scr, size_t len)
- {
- int count = 0;
- if (len)
- {
- do
- {
- if ((*dest++ = (wchar_t)*scr++) == 0)
- break;
- count++;
- } while (--len);
- }
- return count;
- }
- size_t WideCharacterToString(char *dest, const wchar_t *scr, size_t len)
- {
- int count = 0;
- if (len)
- {
- do
- {
- if ((*dest++ = (char)*scr++) == 0)
- break;
- count++;
- } while (--len);
- }
- return count;
- }
- void KeyboardComplete(int localClientNum, const wchar_t *wText, int textLenght, bool ifCanceled)
- {
- if (!ifCanceled)
- {
- char textBuffer[0x400];
- if (WideCharacterToString(textBuffer, wText, 0x400))
- {
- Cbuf_AddText(localClientNum, textBuffer);
- // put stuff you want to exec here (I would define what you are using with a switch or if statement)
- }
- }
- }
- void DrawKeyboard(const char *title, const char *presetMessage, unsigned int len, int panelMode)
- {
- *(bool*)0xE33724 = true;
- wchar_t titleBuffer[0x400], presetMessageBuffer[0x400];
- StringToWideCharacter(titleBuffer, title, 0x400);
- StringToWideCharacter(presetMessageBuffer, presetMessage, 0x400);
- OSK(0, titleBuffer, presetMessageBuffer, len, KeyboardComplete, panelMode);
- }
- // Example:
- // Alphabet
- DrawKeyboard("ABCD...", "", 0x100, CELL_OSKDIALOG_PANELMODE_ALPHABET);
- // Numeral
- DrawKeyboard("1234...", "", 0x100, CELL_OSKDIALOG_PANELMODE_NUMERAL);
- // Look in the PS3 SDK if you want other panelMode types
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement