tuskenraider2k
Certified Guru
- Joined
- Nov 1, 2002
- Messages
- 117
I think a panic key or key sequence would be nice as default functionallity
It is surely not cleanly implemented, but it works:
pthread_t gp2x_panic_tester_thread=0;
static void *gp2x_panic_mode_loop(void *blah)
{
while (1)
{
unsigned long nKey = gp2x_joystick_read();
if ((nKey&GP2X_L) && (nKey&GP2X_R) && (nKey&GP2X_PUSH)) {
printf("PANIC LOOP - exit\n");
exit(0);
}
Sleep(200);
}
return NULL;
}
void init()
{
pthread_create( &gp2x_panic_tester_thread, NULL, gp2x_panic_mode_loop, NULL);
}
It is surely not cleanly implemented, but it works:
pthread_t gp2x_panic_tester_thread=0;
static void *gp2x_panic_mode_loop(void *blah)
{
while (1)
{
unsigned long nKey = gp2x_joystick_read();
if ((nKey&GP2X_L) && (nKey&GP2X_R) && (nKey&GP2X_PUSH)) {
printf("PANIC LOOP - exit\n");
exit(0);
}
Sleep(200);
}
return NULL;
}
void init()
{
pthread_create( &gp2x_panic_tester_thread, NULL, gp2x_panic_mode_loop, NULL);
}