 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
reefbarman
Joined: 08 Jan 2007 Posts: 87 Location: Australia
|
Posted: Wed Jan 10, 2007 2:54 pm Post subject: Getting the Sony On SCreen Keyboard To Work |
|
|
Hi, everyone
i would really love to see sony's on screen keyboard work in homebrew & my program but i dont really have a clue how to set it all up,
i have these in so far
Code:
#include <psputility_osk.h>
SceUtilityOskParams * myKeyboard;
SceUtilityOskData * myKeyboardData;
SceOskState keyboardState;
now my problem is how do i use all this
i want a function called keyboard() that displays this keyboard, makes it work and then stores the entered text in a char * array, then shuts the keyboard down allowing my program to return to it previous place
thanks in advance also if anyone know what any of the variable in the structs related to this do please post them thanks again |
|
| Back to top |
|
 |
Bytrix
Joined: 14 Sep 2005 Posts: 72 Location: England
|
Posted: Wed Jan 10, 2007 7:29 pm Post subject: |
|
|
| I was wondering how to use this too, I ended up writing my own. |
|
| Back to top |
|
 |
adrahil
Joined: 16 Mar 2006 Posts: 277
|
Posted: Wed Jan 10, 2007 11:07 pm Post subject: |
|
|
| Search the forums.... there is some post related... |
|
| Back to top |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Wed Jan 10, 2007 11:35 pm Post subject: |
|
|
| McZonk's sample that he posted is pretty self explanatory. |
|
| Back to top |
|
 |
reefbarman
Joined: 08 Jan 2007 Posts: 87 Location: Australia
|
Posted: Thu Jan 11, 2007 12:05 am Post subject: |
|
|
| i read the example but the link are all broken so i cant get any of the code so a refresher here would be good or if i was reading the topic can some one post a link thanks, but still if anyone has a clue and could do a mock up function for me that would be great |
|
| Back to top |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
|
| Back to top |
|
 |
reefbarman
Joined: 08 Jan 2007 Posts: 87 Location: Australia
|
Posted: Thu Jan 11, 2007 1:14 am Post subject: |
|
|
| cheers thanks alot |
|
| Back to top |
|
 |
reefbarman
Joined: 08 Jan 2007 Posts: 87 Location: Australia
|
Posted: Thu Jan 11, 2007 12:55 pm Post subject: |
|
|
| okay im compiled the mczonk sample copied it to my psp and no that im running it all i get is a grey screen and a crash whats going on there?? |
|
| Back to top |
|
 |
blondin

Joined: 07 Mar 2006 Posts: 18 Location: France (Grenoble)
|
Posted: Fri Jan 12, 2007 7:27 am Post subject: Work only with 1.50 |
|
|
This exemple work fine with firmware 1.50 but there is a solution to make it usable on a 2.71, 3.02 or 3.03OE ???
THX |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Fri Jan 12, 2007 2:49 pm Post subject: |
|
|
| The reason it doesn't work on the SE/OE firmwares in 1.5 mode (where you get the gray screen and crash) is cause the 1.5 vsh modules are not available which the OSK requires. As for why it doesn't work on 3.03oe it does with abit of prodding :P You need to build it as a PRX (for 3.02/3.03 at least) and you should remove the use of the osk lib which comes with the sample and use the one which comes with the sdk. Then it all works fine (sort of, the language it appears in is not my specified language so there is possibly some weirdness with the language settings). |
|
| Back to top |
|
 |
Bytrix
Joined: 14 Sep 2005 Posts: 72 Location: England
|
Posted: Fri Jan 12, 2007 7:19 pm Post subject: |
|
|
| Thanks for that TyRaNiD, I too had been wondering how to get this to work in OE. Trying to add as many of these features as I can to my games to make them look a little bit more professional. |
|
| Back to top |
|
 |
reefbarman
Joined: 08 Jan 2007 Posts: 87 Location: Australia
|
Posted: Fri Jan 12, 2007 11:54 pm Post subject: |
|
|
| is anyone able to compile a prx for me and give me instructions on how to add it into my code, its probably not too hard to do my self but i have never tried it before and dont know where to find good tutorials on how to do it so if someone is kind enough, cause while i have been developing my own keyboard system which is kinda cool it still has a lot of work and i would like to release a beta of my app asap, so using the sony one will be my temporary fix. |
|
| Back to top |
|
 |
blondin

Joined: 07 Mar 2006 Posts: 18 Location: France (Grenoble)
|
Posted: Mon Jan 15, 2007 9:47 am Post subject: |
|
|
Thx TyRaNid but I can't load the osk... the sceUtilityOskInitStart return NULL all the time :(
Can you post a little example of your prx please ;) ... thx again for your help |
|
| Back to top |
|
 |
blondin

Joined: 07 Mar 2006 Posts: 18 Location: France (Grenoble)
|
Posted: Wed Jan 17, 2007 9:26 am Post subject: |
|
|
| It's ok I made it, i will post an exemple asap.... |
|
| Back to top |
|
 |
reefbarman
Joined: 08 Jan 2007 Posts: 87 Location: Australia
|
Posted: Wed Jan 17, 2007 10:05 am Post subject: |
|
|
| excellent |
|
| Back to top |
|
 |
blondin

Joined: 07 Mar 2006 Posts: 18 Location: France (Grenoble)
|
Posted: Fri Jan 19, 2007 5:44 am Post subject: OSK for 303OE |
|
|
Ok guys, let's go :
1. Create new main.c in a new directory paste this code :
| Code: |
#include <pspkernel.h>
#include <pspdisplay.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <pspmoduleinfo.h>
#include <psputility.h>
#include <pspgu.h>
#include <pspgum.h>
#include <psputility_osk.h>
/* Define the module info section */
PSP_MODULE_INFO("MsgDialog Sample", 0, 1, 0);
#define printf pspDebugScreenPrintf
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common)
{
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp)
{
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void)
{
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if (thid >= 0)
sceKernelStartThread(thid, 0, 0);
return thid;
}
/* Graphics stuff, based on cube sample */
static unsigned int __attribute__((aligned(16))) list[262144];
struct Vertex
{
float u, v;
unsigned int color;
float x,y,z;
};
struct Vertex __attribute__((aligned(16))) vertices[12*3] =
{
{0, 0, 0xff7f0000,-1,-1, 1}, // 0
{1, 0, 0xff7f0000,-1, 1, 1}, // 4
{1, 1, 0xff7f0000, 1, 1, 1}, // 5
{0, 0, 0xff7f0000,-1,-1, 1}, // 0
{1, 1, 0xff7f0000, 1, 1, 1}, // 5
{0, 1, 0xff7f0000, 1,-1, 1}, // 1
{0, 0, 0xff7f0000,-1,-1,-1}, // 3
{1, 0, 0xff7f0000, 1,-1,-1}, // 2
{1, 1, 0xff7f0000, 1, 1,-1}, // 6
{0, 0, 0xff7f0000,-1,-1,-1}, // 3
{1, 1, 0xff7f0000, 1, 1,-1}, // 6
{0, 1, 0xff7f0000,-1, 1,-1}, // 7
{0, 0, 0xff007f00, 1,-1,-1}, // 0
{1, 0, 0xff007f00, 1,-1, 1}, // 3
{1, 1, 0xff007f00, 1, 1, 1}, // 7
{0, 0, 0xff007f00, 1,-1,-1}, // 0
{1, 1, 0xff007f00, 1, 1, 1}, // 7
{0, 1, 0xff007f00, 1, 1,-1}, // 4
{0, 0, 0xff007f00,-1,-1,-1}, // 0
{1, 0, 0xff007f00,-1, 1,-1}, // 3
{1, 1, 0xff007f00,-1, 1, 1}, // 7
{0, 0, 0xff007f00,-1,-1,-1}, // 0
{1, 1, 0xff007f00,-1, 1, 1}, // 7
{0, 1, 0xff007f00,-1,-1, 1}, // 4
{0, 0, 0xff00007f,-1, 1,-1}, // 0
{1, 0, 0xff00007f, 1, 1,-1}, // 1
{1, 1, 0xff00007f, 1, 1, 1}, // 2
{0, 0, 0xff00007f,-1, 1,-1}, // 0
{1, 1, 0xff00007f, 1, 1, 1}, // 2
{0, 1, 0xff00007f,-1, 1, 1}, // 3
{0, 0, 0xff00007f,-1,-1,-1}, // 4
{1, 0, 0xff00007f,-1,-1, 1}, // 7
{1, 1, 0xff00007f, 1,-1, 1}, // 6
{0, 0, 0xff00007f,-1,-1,-1}, // 4
{1, 1, 0xff00007f, 1,-1, 1}, // 6
{0, 1, 0xff00007f, 1,-1,-1}, // 5
};
#define BUF_WIDTH (512)
#define SCR_WIDTH (480)
#define SCR_HEIGHT (272)
#define PIXEL_SIZE (4) /* change this if you change to another screenmode */
#define FRAME_SIZE (BUF_WIDTH * SCR_HEIGHT * PIXEL_SIZE)
#define ZBUF_SIZE (BUF_WIDTH SCR_HEIGHT * 2) /* zbuffer seems to be 16-bit? */
static void SetupGu()
{
sceGuInit();
sceGuStart(GU_DIRECT,list);
sceGuDrawBuffer(GU_PSM_8888,(void*)0,BUF_WIDTH);
sceGuDispBuffer(SCR_WIDTH,SCR_HEIGHT,(void*)0x88000,BUF_WIDTH);
sceGuDepthBuffer((void*)0x110000,BUF_WIDTH);
sceGuOffset(2048 - (SCR_WIDTH/2),2048 - (SCR_HEIGHT/2));
sceGuViewport(2048,2048,SCR_WIDTH,SCR_HEIGHT);
sceGuDepthRange(0xc350,0x2710);
sceGuScissor(0,0,SCR_WIDTH,SCR_HEIGHT);
sceGuEnable(GU_SCISSOR_TEST);
sceGuDepthFunc(GU_GEQUAL);
sceGuEnable(GU_DEPTH_TEST);
sceGuFrontFace(GU_CW);
sceGuShadeModel(GU_SMOOTH);
sceGuEnable(GU_CULL_FACE);
sceGuEnable(GU_CLIP_PLANES);
sceGuFinish();
sceGuSync(0,0);
sceDisplayWaitVblankStart();
sceGuDisplay(GU_TRUE);
}
static void DrawStuff(void)
{
static int val = 0;
sceGuStart(GU_DIRECT,list);
// clear screen
sceGuClearColor(0xff554433);
sceGuClearDepth(0);
sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
// setup matrices for cube
sceGumMatrixMode(GU_PROJECTION);
sceGumLoadIdentity();
sceGumPerspective(75.0f,16.0f/9.0f,0.5f,1000.0f);
sceGumMatrixMode(GU_VIEW);
sceGumLoadIdentity();
sceGumMatrixMode(GU_MODEL);
sceGumLoadIdentity();
{
ScePspFVector3 pos = { 0, 0, -2.5f };
ScePspFVector3 rot = { val * 0.79f * (M_PI/180.0f), val * 0.98f * (M_PI/180.0f), val * 1.32f * (M_PI/180.0f) };
sceGumRotateXYZ(&rot);
sceGumTranslate(&pos);
}
// draw cube
sceGuAmbientColor(0xffffffff);
sceGumDrawArray(GU_TRIANGLES,GU_TEXTURE_32BITF|GU_COLOR_8888|GU_VERTEX_32BITF|GU_TRANSFORM_3D,12*3,0,vertices);
sceGuFinish();
sceGuSync(0,0);
val ++;
}
int keyboard(char *input){
int done=0;
// INIT OSK
unsigned short intext[128] = { 0 }; // text already in the edit box on start
unsigned short outtext[128] = { 0 }; // text after input
unsigned short desc[128] = { 'E', 'n', 't', 'e', 'r', ' ', 'T', 'e', 'x', 't', 0 }; // description
SceUtilityOskData data;
memset(&data, 0, sizeof(data));
data.language = 2; // english
data.lines = 1; // just one line
data.unk_24 = 1; // set to 1
data.desc = desc;
data.intext = intext;
data.outtextlength = 128; // sizeof(outtext) / sizeof(unsigned short)
data.outtextlimit = 50; // just allow 50 chars
data.outtext = (unsigned short*)outtext;
SceUtilityOskParams osk;
memset(&osk, 0, sizeof(osk));
osk.size = sizeof(osk);
osk.language = 2;
osk.buttonswap = 1; //X button: 1
osk.unk_12 = 17;
osk.unk_16 = 19; //tester a 1 pour les chiffres
osk.unk_20 = 18;
osk.unk_24 = 16;
osk.unk_48 = 1;
osk.data = &data;
int rc = sceUtilityOskInitStart(&osk);
if(rc) {
return 0;
}
while(!done) {
DrawStuff();
switch(sceUtilityOskGetStatus()) {
case PSP_OSK_INIT :
break;
case PSP_OSK_VISIBLE :
sceUtilityOskUpdate(2); // 2 is taken from ps2dev.org recommendation
break;
case PSP_OSK_QUIT :
sceUtilityOskShutdownStart();
break;
case PSP_OSK_FINISHED :
done = 1;
break;
case PSP_OSK_NONE :
default :
break;
}
int i,j=0;
for(i = 0; data.outtext[i]; i++) {
if (data.outtext[i]!='\0' && data.outtext[i]!='\n' && data.outtext[i]!='\r'){
input[j] = data.outtext[i];
j++;
}
}
/**/
sceDisplayWaitVblankStart();
sceGuSwapBuffers();
}
return 1;
}
/* main routine */
int main(int argc, char *argv[])
{
char input[128]="";
SetupCallbacks();
SetupGu();
keyboard(input);
pspDebugScreenInit();
pspDebugScreenClear();
printf("osk return:\n\n%s\n", input);
sceKernelDelayThread(10000000);
sceKernelExitGame();
return 0;
}
|
2. create your Makefile like that:
| Code: |
TARGET = OSK_SAMPLE
OBJS = main.o
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
BUILD_PRX = 1
LIBDIR =
LDFLAGS =
LIBS= -lpsputility -lpspgum -lpspgu -lm
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = OSK_SAMPLE
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
release: all
mksfo OSK_SAMPLE PARAM.SFO
pack-pbp EBOOT.PBP PARAM.SFO NULL NULL NULL NULL NULL OSK_SAMPLE.prx NULL
cp EBOOT.PBP ./303
|
3. You have to create "303" directory before compiling
4. When all done type "make release" and paste "303" directory in your "GAME303" or "GAME".... as you want |
|
| Back to top |
|
 |
AnalCobra
Joined: 03 Mar 2007 Posts: 1
|
Posted: Sat Mar 03, 2007 9:01 pm Post subject: |
|
|
hey guys,
when i try to make the stuff posted above by blondin then i get following error :
| Code: |
$ make release
make: *** /usr/local/pspdev/psp/sdk: Is a directory. Stop.
|
Does somebody know how to get rid of this error?
EDIT:
Did nobody hear something about this error, yet? |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Mon Oct 22, 2007 4:37 am Post subject: |
|
|
I've modified blondin's code from above for the latest SDK. This works peachy on my 3.71 M33-2 Slim.
main.c
| Code: | #include <pspkernel.h>
#include <pspdisplay.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <pspmoduleinfo.h>
#include <psputility.h>
#include <pspgu.h>
#include <pspgum.h>
#include <psputility_osk.h>
/* Define the module info section */
PSP_MODULE_INFO("MsgDialog Sample", 0, 1, 0);
#define printf pspDebugScreenPrintf
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common)
{
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp)
{
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void)
{
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if (thid >= 0)
sceKernelStartThread(thid, 0, 0);
return thid;
}
/* Graphics stuff, based on cube sample */
static unsigned int __attribute__((aligned(16))) list[262144];
struct Vertex
{
float u, v;
unsigned int color;
float x,y,z;
};
struct Vertex __attribute__((aligned(16))) vertices[12*3] =
{
{0, 0, 0xff7f0000,-1,-1, 1}, // 0
{1, 0, 0xff7f0000,-1, 1, 1}, // 4
{1, 1, 0xff7f0000, 1, 1, 1}, // 5
{0, 0, 0xff7f0000,-1,-1, 1}, // 0
{1, 1, 0xff7f0000, 1, 1, 1}, // 5
{0, 1, 0xff7f0000, 1,-1, 1}, // 1
{0, 0, 0xff7f0000,-1,-1,-1}, // 3
{1, 0, 0xff7f0000, 1,-1,-1}, // 2
{1, 1, 0xff7f0000, 1, 1,-1}, // 6
{0, 0, 0xff7f0000,-1,-1,-1}, // 3
{1, 1, 0xff7f0000, 1, 1,-1}, // 6
{0, 1, 0xff7f0000,-1, 1,-1}, // 7
{0, 0, 0xff007f00, 1,-1,-1}, // 0
{1, 0, 0xff007f00, 1,-1, 1}, // 3
{1, 1, 0xff007f00, 1, 1, 1}, // 7
{0, 0, 0xff007f00, 1,-1,-1}, // 0
{1, 1, 0xff007f00, 1, 1, 1}, // 7
{0, 1, 0xff007f00, 1, 1,-1}, // 4
{0, 0, 0xff007f00,-1,-1,-1}, // 0
{1, 0, 0xff007f00,-1, 1,-1}, // 3
{1, 1, 0xff007f00,-1, 1, 1}, // 7
{0, 0, 0xff007f00,-1,-1,-1}, // 0
{1, 1, 0xff007f00,-1, 1, 1}, // 7
{0, 1, 0xff007f00,-1,-1, 1}, // 4
{0, 0, 0xff00007f,-1, 1,-1}, // 0
{1, 0, 0xff00007f, 1, 1,-1}, // 1
{1, 1, 0xff00007f, 1, 1, 1}, // 2
{0, 0, 0xff00007f,-1, 1,-1}, // 0
{1, 1, 0xff00007f, 1, 1, 1}, // 2
{0, 1, 0xff00007f,-1, 1, 1}, // 3
{0, 0, 0xff00007f,-1,-1,-1}, // 4
{1, 0, 0xff00007f,-1,-1, 1}, // 7
{1, 1, 0xff00007f, 1,-1, 1}, // 6
{0, 0, 0xff00007f,-1,-1,-1}, // 4
{1, 1, 0xff00007f, 1,-1, 1}, // 6
{0, 1, 0xff00007f, 1,-1,-1}, // 5
};
#define BUF_WIDTH (512)
#define SCR_WIDTH (480)
#define SCR_HEIGHT (272)
#define PIXEL_SIZE (4) /* change this if you change to another screenmode */
#define FRAME_SIZE (BUF_WIDTH * SCR_HEIGHT * PIXEL_SIZE)
#define ZBUF_SIZE (BUF_WIDTH SCR_HEIGHT * 2) /* zbuffer seems to be 16-bit? */
static void SetupGu()
{
sceGuInit();
sceGuStart(GU_DIRECT,list);
sceGuDrawBuffer(GU_PSM_8888,(void*)0,BUF_WIDTH);
sceGuDispBuffer(SCR_WIDTH,SCR_HEIGHT,(void*)0x88000,BUF_WIDTH);
sceGuDepthBuffer((void*)0x110000,BUF_WIDTH);
sceGuOffset(2048 - (SCR_WIDTH/2),2048 - (SCR_HEIGHT/2));
sceGuViewport(2048,2048,SCR_WIDTH,SCR_HEIGHT);
sceGuDepthRange(0xc350,0x2710);
sceGuScissor(0,0,SCR_WIDTH,SCR_HEIGHT);
sceGuEnable(GU_SCISSOR_TEST);
sceGuDepthFunc(GU_GEQUAL);
sceGuEnable(GU_DEPTH_TEST);
sceGuFrontFace(GU_CW);
sceGuShadeModel(GU_SMOOTH);
sceGuEnable(GU_CULL_FACE);
sceGuEnable(GU_CLIP_PLANES);
sceGuFinish();
sceGuSync(0,0);
sceDisplayWaitVblankStart();
sceGuDisplay(GU_TRUE);
}
static void DrawStuff(void)
{
static int val = 0;
sceGuStart(GU_DIRECT,list);
// clear screen
sceGuClearColor(0xff554433);
sceGuClearDepth(0);
sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
// setup matrices for cube
sceGumMatrixMode(GU_PROJECTION);
sceGumLoadIdentity();
sceGumPerspective(75.0f,16.0f/9.0f,0.5f,1000.0f);
sceGumMatrixMode(GU_VIEW);
sceGumLoadIdentity();
sceGumMatrixMode(GU_MODEL);
sceGumLoadIdentity();
{
ScePspFVector3 pos = { 0, 0, -2.5f };
ScePspFVector3 rot = { val * 0.79f * (M_PI/180.0f), val * 0.98f * (M_PI/180.0f), val * 1.32f * (M_PI/180.0f) };
sceGumRotateXYZ(&rot);
sceGumTranslate(&pos);
}
// draw cube
sceGuAmbientColor(0xffffffff);
sceGumDrawArray(GU_TRIANGLES,GU_TEXTURE_32BITF|GU_COLOR_8888|GU_VERTEX_32BITF|GU_TRANSFORM_3D,12*3,0,vertices);
sceGuFinish();
sceGuSync(0,0);
val ++;
}
int keyboard(char *input){
int done=0;
// INIT OSK
unsigned short intext[128] = { 0 }; // text already in the edit box on start
unsigned short outtext[128] = { 0 }; // text after input
unsigned short desc[128] = { 'E', 'n', 't', 'e', 'r', ' ', 'T', 'e', 'x', 't', 0 }; // description
SceUtilityOskData data;
memset(&data, 0, sizeof(data));
data.language = 2; // key glyphs: 0-1=hiragana, 2+=western
data.lines = 1; // just one line
data.unk_24 = 1; // set to 1
data.desc = desc;
data.intext = intext;
data.outtextlength = 128; // sizeof(outtext) / sizeof(unsigned short)
data.outtextlimit = 50; // just allow 50 chars
data.outtext = (unsigned short*)outtext;
SceUtilityOskParams osk;
memset(&osk, 0, sizeof(osk));
osk.base.size = sizeof(osk);
// dialog language: 0=Japanese, 1=English, 2=French, 3=Spanish, 4=German,
// 5=Italian, 6=Dutch, 7=Portuguese, 8=Russian, 9=Korean, 10-11=Chinese, 12+=default
osk.base.language = 1;
osk.base.buttonSwap = 1; // X button: 1
osk.base.graphicsThread = 17; // gfx thread pri
osk.base.unknown = 19; // unknown thread pri (?)
osk.base.fontThread = 18;
osk.base.soundThread = 16;
osk.unk_48 = 1;
osk.data = &data;
int rc = sceUtilityOskInitStart(&osk);
if(rc) {
return 0;
}
while(!done) {
DrawStuff();
switch(sceUtilityOskGetStatus()) {
case PSP_UTILITY_DIALOG_INIT :
break;
case PSP_UTILITY_DIALOG_VISIBLE :
sceUtilityOskUpdate(2); // 2 is taken from ps2dev.org recommendation
break;
case PSP_UTILITY_DIALOG_QUIT :
sceUtilityOskShutdownStart();
break;
case PSP_UTILITY_DIALOG_FINISHED :
done = 1;
break;
case PSP_UTILITY_DIALOG_NONE :
default :
break;
}
int i,j=0;
for(i = 0; data.outtext[i]; i++) {
if (data.outtext[i]!='\0' && data.outtext[i]!='\n' && data.outtext[i]!='\r'){
input[j] = data.outtext[i];
j++;
}
}
/**/
sceDisplayWaitVblankStart();
sceGuSwapBuffers();
}
return 1;
}
/* main routine */
int main(int argc, char *argv[])
{
char input[128]="";
SetupCallbacks();
SetupGu();
keyboard(input);
pspDebugScreenInit();
pspDebugScreenClear();
printf("osk return:\n\n%s\n", input);
sceKernelDelayThread(10000000);
sceKernelExitGame();
return 0;
}
|
Note the comments on the two language fields. I figured those out by changing the values and observing the results. |
|
| Back to top |
|
 |
capz
Joined: 20 May 2008 Posts: 6
|
Posted: Tue May 20, 2008 4:21 am Post subject: |
|
|
| AnalCobra wrote: | hey guys,
when i try to make the stuff posted above by blondin then i get following error :
| Code: |
$ make release
make: *** /usr/local/pspdev/psp/sdk: Is a directory. Stop.
|
Does somebody know how to get rid of this error?
EDIT:
Did nobody hear something about this error, yet? |
Am also having that exact same error, could somebody with more experience look at this? i only started this week :P |
|
| Back to top |
|
 |
Question_dev
Joined: 24 Aug 2007 Posts: 88
|
Posted: Tue May 20, 2008 6:03 am Post subject: |
|
|
Search for libosk, a easy-to-use osk lib. Just use the sample as basic. Easy to understand, only 4 lines of code and u got an advanced keyboard with text stored in char, etc. .
Cu |
|
| Back to top |
|
 |
capz
Joined: 20 May 2008 Posts: 6
|
Posted: Tue May 27, 2008 8:13 am Post subject: |
|
|
| Question_dev wrote: | Search for libosk, a easy-to-use osk lib. Just use the sample as basic. Easy to understand, only 4 lines of code and u got an advanced keyboard with text stored in char, etc. .
Cu | hi, i did a little searching for that lib, but i found nothing. Nothing in google (that i could read at least), this forum, or the svn. would you/anyone be so kind to give me some directions? |
|
| Back to top |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Tue May 27, 2008 8:40 am Post subject: |
|
|
I commited an updated osk header file and a sample recently.
Update your SDK. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|