DEADSOFTWARE

added bind command + autoexec.cfg + dfconfig.cfg
[d2df-sdl.git] / src / game / g_window.pas
index 8336ea9b82cb39b11cd0b5b95c8e992e8cc3b0dd..a5dd79cfb415955850270e0e2bdf8bc1f2820ff0 100644 (file)
@@ -314,8 +314,6 @@ begin
     SDL_WINDOWEVENT_MINIMIZED:
     begin
       e_UnpressAllKeys();
-      if (gPlayer1 <> nil) then gPlayer1.releaseAllWeaponSwitchKeys();
-      if (gPlayer2 <> nil) then gPlayer2.releaseAllWeaponSwitchKeys();
       if not wMinimized then
       begin
         e_ResizeWindow(0, 0);
@@ -404,8 +402,6 @@ begin
     begin
       wDeactivate := true;
       e_UnpressAllKeys();
-      if (gPlayer1 <> nil) then gPlayer1.releaseAllWeaponSwitchKeys();
-      if (gPlayer2 <> nil) then gPlayer2.releaseAllWeaponSwitchKeys();
       //e_WriteLog('window lost focus!', MSG_NOTIFY);
     end;
   end;
@@ -509,7 +505,11 @@ begin
           exit;
         end;
         {$ENDIF}
-        e_KeyUpDown(key, down);
+        if ev.key._repeat = 0 then
+        begin
+          e_KeyUpDown(key, down);
+          g_Console_ProcessBind(key, down)
+        end;
         if down then KeyPress(key);
       end;