DEADSOFTWARE

Reserved key range for virtual keyboard + alternative virtkbd layout
[d2df-sdl.git] / src / game / g_game.pas
index 345f11232604bd161208a4f3f0d92e32b7c75982..80fb0531df35051f2b53f7eef73719392ca9460d 100644 (file)
@@ -22,7 +22,8 @@ uses
   SysUtils, Classes,
   MAPDEF,
   g_basic, g_player, e_graphics, g_res_downloader,
-  g_sound, g_gui, utils, md5, mempool, xprofiler;
+  g_sound, g_gui, utils, md5, mempool, xprofiler,
+  g_touch;
 
 type
   TGameSettings = record
@@ -351,12 +352,17 @@ function gPause (): Boolean; inline;
 implementation
 
 uses
+{$IFDEF USE_NANOGL}
+  nanoGL,
+{$ELSE}
+  GL, GLExt,
+{$ENDIF}
   e_texture, g_textures, g_main, g_window, g_menu,
   e_input, e_log, g_console, g_items, g_map, g_panel,
   g_playermodel, g_gfx, g_options, g_weapons, Math,
   g_triggers, g_monsters, e_sound, CONFIG,
   g_language, g_net,
-  ENet, e_msg, g_netmsg, g_netmaster, GL, GLExt,
+  ENet, e_msg, g_netmsg, g_netmaster,
   sfs, wadreader, g_holmes;
 
 
@@ -1590,7 +1596,10 @@ begin
         if (not g_Game_IsClient) and
         (
           (
-            (e_KeyPressed(IK_RETURN) or e_KeyPressed(IK_KPRETURN) or e_KeyPressed(IK_SPACE))
+            (
+              e_KeyPressed(IK_RETURN) or e_KeyPressed(IK_KPRETURN) or e_KeyPressed(IK_SPACE) or
+              e_KeyPressed(VK_FIRE) or e_KeyPressed(VK_OPEN)
+            )
             and (not gJustChatted) and (not gConsoleShow) and (not gChatShow)
             and (g_ActiveWindow = nil)
           )
@@ -2295,7 +2304,7 @@ begin
 
   g_ProcessMessages();
 
-  if e_KeyPressed(IK_TAB) then
+  if e_KeyPressed(IK_TAB) or e_KeyPressed(VK_STATUS) then
   begin
     if not gStatsPressed then
     begin
@@ -3002,7 +3011,6 @@ begin
    *     glBlendFunc(GL_DST_ALPHA, GL_ONE);
    *     draw all geometry up to and including walls (with alpha-testing, probably) -- this does lighting
    *)
-
   wassc := (glIsEnabled(GL_SCISSOR_TEST) <> 0);
   if wassc then glGetIntegerv(GL_SCISSOR_BOX, @scxywh[0]) else glGetIntegerv(GL_VIEWPORT, @scxywh[0]);
 
@@ -3755,6 +3763,8 @@ begin
   if gGameOn then drawProfilers();
 
   g_Holmes_DrawUI();
+
+  g_Touch_Draw;
 end;
 
 procedure g_Game_Quit();
@@ -4393,7 +4403,7 @@ begin
 
     ProcessLoading(true);
 
-    if e_KeyPressed(IK_ESCAPE) or e_KeyPressed(IK_SPACE) then
+    if e_KeyPressed(IK_ESCAPE) or e_KeyPressed(IK_SPACE) or e_KeyPressed(VK_ESCAPE) then
     begin
       State := 0;
       break;