or you can put your program in a loop
well thats how i do it for the psp
example :
Code: Select all
#include <oslib/oslib.h>
PSP_MODULE_INFO("OSLib Sample", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
int main() {
oslInit(0);
oslInitGfx(OSL_PF_8888, 1);
oslInitConsole();
oslReadKeys();
oslStartDrawing();
oslPrintf("Welcome to Bubzurus joystick tester\n\nPress any button to continue");
oslSyncFrame();
oslWaitKey();
while (!osl_quit)
{
oslStartDrawing();
oslReadKeys();
oslCls();
if(osl_keys->pressed.start){
oslEndGfx();
oslQuit();
}
oslPrintf_xy(10,10,"this Program will Check To See If Your joystick is Broke :D");
oslPrintf_xy(10,30,"You Can Press Start At Any Time To Exit");
oslPrintf_xy(70,100,"Your joystick's X : %d",osl_keys->analogX);
oslPrintf_xy(70,110,"Your joystick's Y : %d",osl_keys->analogY);
if (osl_keys->analogX == 0 && osl_keys->analogY == 0){
oslPrintf_xy(70,140,":D Your joystick Is Fine !!");
}else{
oslPrintf_xy(70,140,"Sorry Your joystick Is Broke");
}
oslEndDrawing();
oslSyncFrame();
}
oslEndGfx();
oslQuit();
return 0;
}
that code works just fine and its in a loop
duno if you code for the pc like that tho