scachi
Member
- Joined
- Dec 28, 2005
- Messages
- 451
Thx for testing and reporting + link.kayuz said:THANKS!!! GUY THANKS!!
i will try it immediately!!!!
thanks you!
ps: can you host this test on another file sharing site? i have problems with uploaded
EIDT2: i tested it, so i found a lot of problems:
first: when you tap on the onscreen keyboard you don't see what you are writing;
second: it don't display the images, but i think you can't do anything, is the browser directely
third: can you use too the caanoo controls like the ABYX bottons or the analogic stick? will be more easy to manage the web pages: for help i think in caanoo browser from rikku2000 will be some trick to enamble them http://dl.openhandhelds.org/cgi-bin/caanoo.cgi?0,0,0,0,112,509
SDL_Joystick *joy;
/* Virtual Keyboard Init */
int virtual_keyboard_open; // If its 1 then open the Virtual Keyboard
int virtual_keyboard_shift = 0; // If its 1 then use the SHIFT keys
int virtual_keyboard_init;
int virtual_keyboard_x = 51;
int virtual_keyboard_y = 147;
const SDLKey virtual_keyboard_array1[] = {
SDLK_q, SDLK_w, SDLK_e, SDLK_r, SDLK_t, SDLK_y, SDLK_u, SDLK_i, SDLK_o, SDLK_p,
SDLK_a, SDLK_s, SDLK_d, SDLK_f, SDLK_g, SDLK_h, SDLK_j, SDLK_k, SDLK_l, SDLK_COMMA,
SDLK_z, SDLK_x, SDLK_c, SDLK_v, SDLK_b, SDLK_n, SDLK_m, SDLK_PERIOD, SDLK_BACKSPACE, SDLK_RETURN
};
const SDLKey virtual_keyboard_array2[] = {
SDLK_1, SDLK_2, SDLK_3, SDLK_4, SDLK_5, SDLK_6, SDLK_7, SDLK_8, SDLK_9, SDLK_0,
SDLK_HASH, SDLK_SEMICOLON, SDLK_PLUS, SDLK_ASTERISK, SDLK_DOLLAR, SDLK_CARET, SDLK_EQUALS, SDLK_QUOTEDBL, SDLK_BACKSLASH, SDLK_AMPERSAND,
SDLK_QUOTEDBL, SDLK_EXCLAIM, SDLK_QUESTION, SDLK_SLASH, SDLK_MINUS, SDLK_UNDERSCORE, SDLK_COLON, SDLK_AT, SDLK_BACKSPACE, SDLK_RETURN
};
void push_key( SDLKey key ) {
SDL_Event e;
memset(&e.key.keysym, 0, sizeof(e.key.keysym));
e.key.keysym.sym = key;
e.key.keysym.unicode = key;
e.key.state = SDL_RELEASED;
e.type = SDL_KEYDOWN;
SDL_PushEvent(&e);
e.type = SDL_KEYUP;
SDL_PushEvent(&e);
}
int o_x, o_y; // Virtual Mouse
joy = SDL_JoystickOpen(0);
case SDL_JOYAXISMOTION:
if (virtual_keyboard_open == 0)
if (SDL_JoystickGetAxis(joy, 1) < -16384) {
push_key(SDLK_UP);
} else if (SDL_JoystickGetAxis(joy, 0) < -16384) {
push_key(SDLK_LEFT);
} else if (SDL_JoystickGetAxis(joy, 1) > 16384) {
push_key(SDLK_DOWN);
} else if (SDL_JoystickGetAxis(joy, 0) > 16384) {
push_key(SDLK_RIGHT);
}
break;
case SDL_JOYBUTTONDOWN:
if(SDL_JoystickGetButton(joy, 0)) {
push_key(SDLK_RETURN);
} else if(SDL_JoystickGetButton(joy, 1)) {
} else if(SDL_JoystickGetButton(joy, 2)) {
} else if(SDL_JoystickGetButton(joy, 3)) {
push_key(SDLK_t);
} else if(SDL_JoystickGetButton(joy, 4)) {
} else if(SDL_JoystickGetButton(joy, 5)) {
} else if(SDL_JoystickGetButton(joy, 6)) {
if (virtual_keyboard_open == 0)
push_key(SDLK_ESCAPE);
} else if(SDL_JoystickGetButton(joy, 7)) {
} else if(SDL_JoystickGetButton(joy, 8)) {
if (virtual_keyboard_open == 0) {
virtual_keyboard_open = 1;
virtual_keyboard_shift = 0;
} else if (virtual_keyboard_open == 1)
virtual_keyboard_open = 0;
} else if(SDL_JoystickGetButton(joy, 9)) {
if (virtual_keyboard_open == 1)
if (virtual_keyboard_shift == 0)
virtual_keyboard_shift = 1;
else if (virtual_keyboard_shift == 1)
virtual_keyboard_shift = 0;
} else if(SDL_JoystickGetButton(joy, 10)) {
}
break;
case SDL_JOYBUTTONUP:
break;
case SDL_MOUSEBUTTONDOWN:
if (virtual_keyboard_open == 0) {
} else if (virtual_keyboard_open == 1) {
for(virtual_keyboard_init = 0; virtual_keyboard_init < 29; virtual_keyboard_init++) {
if (virtual_keyboard_shift == 0) {
if (o_x + (10) > virtual_keyboard_x && o_x < virtual_keyboard_x + (10) && o_y + (16) > virtual_keyboard_y && o_y < virtual_keyboard_y + (16))
push_key(virtual_keyboard_array1[virtual_keyboard_init]);
} else if (virtual_keyboard_shift == 1) {
if (o_x + (10) > virtual_keyboard_x && o_x < virtual_keyboard_x + (10) && o_y + (16) > virtual_keyboard_y && o_y < virtual_keyboard_y + (16))
push_key(virtual_keyboard_array2[virtual_keyboard_init]);
}
virtual_keyboard_x += 24;
if (virtual_keyboard_x == 291) {
virtual_keyboard_y += 37;
virtual_keyboard_x = 51;
}
}
}
break;
case SDL_MOUSEBUTTONUP:
if (virtual_keyboard_open == 0) {
} else if (virtual_keyboard_open == 1) { // Set Virtual Keyboard default
virtual_keyboard_x = 51; virtual_keyboard_y = 147;
}
break;
case SDL_MOUSEMOTION:
if (virtual_keyboard_open == 0) {
} else if (virtual_keyboard_open == 1) {
o_x = event.motion.x;
o_y = event.motion.y;
}
break;