DEADSOFTWARE

Reserved key range for virtual keyboard + alternative virtkbd layout
[d2df-sdl.git] / src / game / g_netmaster.pas
index 27eefa480656fea25a50ebe20af19d9c96904193..f4ce7984547a0362e13b66e2d6a2885a67b1ce1d 100644 (file)
@@ -1,4 +1,4 @@
-(* Copyright (C)  DooM 2D:Forever Developers
+(* Copyright (C)  Doom 2D: Forever Developers
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -125,7 +125,7 @@ begin
   if not g_Net_Slist_Connect then
     Exit;
 
-  e_WriteLog('Fetching serverlist...', MSG_NOTIFY);
+  e_WriteLog('Fetching serverlist...', TMsgType.Notify);
   g_Console_Add(_lc[I_NET_MSG] + _lc[I_NET_SLIST_FETCH]);
 
   NetOut.Clear();
@@ -376,7 +376,7 @@ begin
   begin
     enet_address_set_host(@NetSlistAddr, PChar(Addr(IP[1])));
     NetSlistAddr.Port := Port;
-    e_WriteLog('Masterserver address set to ' + IP + ':' + IntToStr(Port), MSG_NOTIFY);
+    e_WriteLog('Masterserver address set to ' + IP + ':' + IntToStr(Port), TMsgType.Notify);
   end;
 end;
 
@@ -505,13 +505,15 @@ begin
 end;
 
 procedure g_Serverlist_Control(var SL: TNetServerList);
+var
+  qm: Boolean;
 begin
   if gConsoleShow or gChatShow then
     Exit;
 
-  e_PollInput();
+  qm := g_ProcessMessages(); // this updates kbd
 
-  if e_KeyPressed(IK_ESCAPE) then
+  if qm or e_KeyPressed(IK_ESCAPE) or e_KeyPressed(VK_ESCAPE) then
   begin
     SL := nil;
     gState := STATE_MENU;
@@ -522,7 +524,7 @@ begin
     Exit;
   end;
 
-  if e_KeyPressed(IK_SPACE) then
+  if e_KeyPressed(IK_SPACE) or e_KeyPressed(VK_JUMP) then
   begin
     if not slFetched then
     begin
@@ -547,7 +549,7 @@ begin
 
   if SL = nil then Exit;
 
-  if e_KeyPressed(IK_RETURN) or e_KeyPressed(IK_KPRETURN) then
+  if e_KeyPressed(IK_RETURN) or e_KeyPressed(IK_KPRETURN) or e_KeyPressed(VK_FIRE) or e_KeyPressed(VK_OPEN) then
   begin
     if not slReturnPressed then
     begin
@@ -571,7 +573,7 @@ begin
   else
     slReturnPressed := False;
 
-  if e_KeyPressed(IK_DOWN) or e_KeyPressed(IK_KPDOWN) then
+  if e_KeyPressed(IK_DOWN) or e_KeyPressed(IK_KPDOWN) or e_KeyPressed(VK_DOWN) then
   begin
     if not slDirPressed then
     begin
@@ -581,7 +583,7 @@ begin
     end;
   end;
 
-  if e_KeyPressed(IK_UP) or e_KeyPressed(IK_KPUP) then
+  if e_KeyPressed(IK_UP) or e_KeyPressed(IK_KPUP) or e_KeyPressed(VK_UP) then
   begin
     if not slDirPressed then
     begin
@@ -592,7 +594,7 @@ begin
     end;
   end;
 
-  if (not e_KeyPressed(IK_DOWN)) and (not e_KeyPressed(IK_UP)) and (not e_KeyPressed(IK_KPDOWN)) and (not e_KeyPressed(IK_KPUP)) then
+  if (not e_KeyPressed(IK_DOWN)) and (not e_KeyPressed(IK_UP)) and (not e_KeyPressed(IK_KPDOWN)) and (not e_KeyPressed(IK_KPUP)) and (not e_KeyPressed(VK_DOWN)) and (not e_KeyPressed(VK_UP)) then
     slDirPressed := False;
 end;