+ }
+ oldkeydest = keydest;
+ // top of screen is toggleconsole and K_ESCAPE
+ switch(keydest)
+ {
+ case key_console:
+#ifdef __IPHONEOS__
+ VID_TouchscreenArea( 0, 0, 0, 64, 64, NULL , NULL, &buttons[13], (keynum_t)'`');
+ VID_TouchscreenArea( 0, 64, 0, 64, 64, "gfx/touch_menu.tga" , NULL, &buttons[14], K_ESCAPE);
+ if (!VID_ShowingKeyboard())
+ {
+ // user entered a command, close the console now
+ Con_ToggleConsole_f();
+ }
+#endif
+ VID_TouchscreenArea( 0, 0, 0, 0, 0, NULL , NULL, &buttons[15], (keynum_t)0);
+ VID_TouchscreenArea( 0, 0, 0, 0, 0, NULL , move, &buttons[0], K_MOUSE4);
+ VID_TouchscreenArea( 0, 0, 0, 0, 0, NULL , aim, &buttons[1], K_MOUSE5);
+ VID_TouchscreenArea( 0, 0, 0, 0, 0, NULL , click,&buttons[2], K_MOUSE1);
+ VID_TouchscreenArea( 0, 0, 0, 0, 0, NULL , NULL, &buttons[3], K_SPACE);
+ VID_TouchscreenArea( 0, 0, 0, 0, 0, NULL , NULL, &buttons[4], K_MOUSE2);
+ break;
+ case key_game:
+#ifdef __IPHONEOS__
+ VID_TouchscreenArea( 0, 0, 0, 64, 64, NULL , NULL, &buttons[13], (keynum_t)'`');
+ VID_TouchscreenArea( 0, 64, 0, 64, 64, "gfx/touch_menu.tga" , NULL, &buttons[14], K_ESCAPE);
+#endif
+ VID_TouchscreenArea( 2, 0,-128, 128, 128, "gfx/touch_movebutton.tga" , move, &buttons[0], K_MOUSE4);
+ VID_TouchscreenArea( 3,-128,-128, 128, 128, "gfx/touch_aimbutton.tga" , aim, &buttons[1], K_MOUSE5);
+ VID_TouchscreenArea( 2, 0,-160, 64, 32, "gfx/touch_jumpbutton.tga" , NULL, &buttons[3], K_SPACE);
+ VID_TouchscreenArea( 3,-128,-160, 64, 32, "gfx/touch_attackbutton.tga" , NULL, &buttons[2], K_MOUSE1);
+ VID_TouchscreenArea( 3, -64,-160, 64, 32, "gfx/touch_attack2button.tga", NULL, &buttons[4], K_MOUSE2);
+ buttons[15] = false;
+ break;
+ default:
+#ifdef __IPHONEOS__
+ VID_TouchscreenArea( 0, 0, 0, 64, 64, NULL , NULL, &buttons[13], (keynum_t)'`');
+ VID_TouchscreenArea( 0, 64, 0, 64, 64, "gfx/touch_menu.tga" , NULL, &buttons[14], K_ESCAPE);
+ // in menus, an icon in the corner activates keyboard
+ VID_TouchscreenArea( 2, 0, -32, 32, 32, "gfx/touch_keyboard.tga" , NULL, &buttons[15], (keynum_t)0);
+ if (buttons[15])
+ VID_ShowKeyboard(true);
+ VID_TouchscreenArea( 0, 0, 0, 0, 0, NULL , move, &buttons[0], K_MOUSE4);
+ VID_TouchscreenArea( 0, 0, 0, 0, 0, NULL , aim, &buttons[1], K_MOUSE5);
+ VID_TouchscreenArea(16, -320,-480,640, 960, NULL , click,&buttons[2], K_MOUSE1);
+ VID_TouchscreenArea( 0, 0, 0, 0, 0, NULL , NULL, &buttons[3], K_SPACE);
+ VID_TouchscreenArea( 0, 0, 0, 0, 0, NULL , NULL, &buttons[4], K_MOUSE2);
+ if (buttons[2])