]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Minigames: capture and ignore key release events; it prevents triggering -* aliases...
authorterencehill <piuntn@gmail.com>
Mon, 28 Dec 2020 00:10:34 +0000 (01:10 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 28 Dec 2020 20:12:23 +0000 (21:12 +0100)
qcsrc/common/minigames/cl_minigames_hud.qc
qcsrc/common/minigames/minigame/bd.qc
qcsrc/common/minigames/minigame/c4.qc
qcsrc/common/minigames/minigame/nmm.qc
qcsrc/common/minigames/minigame/pong.qc
qcsrc/common/minigames/minigame/pp.qc
qcsrc/common/minigames/minigame/ps.qc
qcsrc/common/minigames/minigame/ttt.qc

index 49a73dcc44dce7229e128f4e4df96706439013fe..ebb0decec0a34dc3dcb00eaa8fa7436acacd3a6c 100644 (file)
@@ -671,50 +671,61 @@ float HUD_Minigame_InputEvent(float bInputType, float nPrimary, float nSecondary
                        return true;
        }
 
-       if ( key_pressed )
+       if ( nPrimary == K_MOUSE1 && HUD_MinigameMenu_activeitem &&
+               HUD_mouse_over(HUD_PANEL(MINIGAMEMENU)) )
        {
-               if ( nPrimary == K_MOUSE1 && HUD_MinigameMenu_activeitem &&
-                       HUD_mouse_over(HUD_PANEL(MINIGAMEMENU)) )
-               {
-                       HUD_MinigameMenu_Click(HUD_MinigameMenu_activeitem);
+               if (!key_pressed)
                        return true;
-               }
-               if ( nPrimary == K_UPARROW || nPrimary == K_KP_UPARROW )
-               {
-                       if ( HUD_MinigameMenu_activeitem && HUD_MinigameMenu_activeitem.list_prev )
-                               HUD_MinigameMenu_activeitem = HUD_MinigameMenu_activeitem.list_prev;
-                       else
-                               HUD_MinigameMenu_activeitem = HUD_MinigameMenu_last_entry;
+               HUD_MinigameMenu_Click(HUD_MinigameMenu_activeitem);
+               return true;
+       }
+       if ( nPrimary == K_UPARROW || nPrimary == K_KP_UPARROW )
+       {
+               if (!key_pressed)
                        return true;
-               }
-               else if ( nPrimary == K_DOWNARROW || nPrimary == K_KP_DOWNARROW )
-               {
-                       if ( HUD_MinigameMenu_activeitem && HUD_MinigameMenu_activeitem.list_next )
-                               HUD_MinigameMenu_activeitem = HUD_MinigameMenu_activeitem.list_next;
-                       else
-                               HUD_MinigameMenu_activeitem = HUD_MinigameMenu_entries;
+               if ( HUD_MinigameMenu_activeitem && HUD_MinigameMenu_activeitem.list_prev )
+                       HUD_MinigameMenu_activeitem = HUD_MinigameMenu_activeitem.list_prev;
+               else
+                       HUD_MinigameMenu_activeitem = HUD_MinigameMenu_last_entry;
+               return true;
+       }
+       else if ( nPrimary == K_DOWNARROW || nPrimary == K_KP_DOWNARROW )
+       {
+               if (!key_pressed)
                        return true;
-               }
-               else if ( nPrimary == K_HOME || nPrimary == K_KP_HOME )
-               {
+               if ( HUD_MinigameMenu_activeitem && HUD_MinigameMenu_activeitem.list_next )
+                       HUD_MinigameMenu_activeitem = HUD_MinigameMenu_activeitem.list_next;
+               else
                        HUD_MinigameMenu_activeitem = HUD_MinigameMenu_entries;
+               return true;
+       }
+       else if ( nPrimary == K_HOME || nPrimary == K_KP_HOME )
+       {
+               if (!key_pressed)
                        return true;
-               }
-               else if ( nPrimary == K_END || nPrimary == K_KP_END )
-               {
-                       HUD_MinigameMenu_activeitem = HUD_MinigameMenu_entries;
+               HUD_MinigameMenu_activeitem = HUD_MinigameMenu_entries;
+               return true;
+       }
+       else if ( nPrimary == K_END || nPrimary == K_KP_END )
+       {
+               if (!key_pressed)
                        return true;
-               }
-               else if ( nPrimary == K_KP_ENTER || nPrimary == K_ENTER || nPrimary == K_SPACE )
-               {
-                       HUD_MinigameMenu_Click(HUD_MinigameMenu_activeitem);
+               HUD_MinigameMenu_activeitem = HUD_MinigameMenu_entries;
+               return true;
+       }
+       else if ( nPrimary == K_KP_ENTER || nPrimary == K_ENTER || nPrimary == K_SPACE )
+       {
+               if (!key_pressed)
                        return true;
-               }
-               else if ( nPrimary == K_ESCAPE )
-               {
-                       HUD_MinigameMenu_Close(NULL, NULL, NULL);
+               HUD_MinigameMenu_Click(HUD_MinigameMenu_activeitem);
+               return true;
+       }
+       else if ( nPrimary == K_ESCAPE )
+       {
+               if (!key_pressed)
                        return true;
-               }
+               HUD_MinigameMenu_Close(NULL, NULL, NULL);
+               return true;
        }
 
        return false;
index 2aea16c54206be9cf423c0bfe922bf969c5625f0..253dd612e396fa3a0762afe65e82b28881d51e26 100644 (file)
@@ -1211,31 +1211,6 @@ void bd_set_curr_pos(string s)
        bd_curr_pos = s;
 }
 
-bool bd_normal_move(entity minigame, int themove)
-{
-       switch ( themove )
-       {
-               case K_RIGHTARROW:
-               case K_KP_RIGHTARROW:
-                       bd_make_move(minigame, "r");
-                       return true;
-               case K_LEFTARROW:
-               case K_KP_LEFTARROW:
-                       bd_make_move(minigame, "l");
-                       return true;
-               case K_UPARROW:
-               case K_KP_UPARROW:
-                       bd_make_move(minigame, "u");
-                       return true;
-               case K_DOWNARROW:
-               case K_KP_DOWNARROW:
-                       bd_make_move(minigame, "d");
-                       return true;
-       }
-
-       return false;
-}
-
 bool bd_change_dozer_angle(entity minigame)
 {
        entity dozer = bd_find_piece(minigame, bd_curr_pos, false);
@@ -1256,54 +1231,6 @@ bool bd_change_dozer_angle(entity minigame)
        return true;
 }
 
-bool bd_editor_move(entity minigame, int themove)
-{
-       switch ( themove )
-       {
-               case K_RIGHTARROW:
-               case K_KP_RIGHTARROW:
-                       if ( ! bd_curr_pos )
-                               bd_set_curr_pos("a3");
-                       else
-                               bd_set_curr_pos(minigame_relative_tile(bd_curr_pos,1,0,BD_NUM_CNT,BD_LET_CNT));
-                       return true;
-               case K_LEFTARROW:
-               case K_KP_LEFTARROW:
-                       if ( ! bd_curr_pos )
-                               bd_set_curr_pos("c3");
-                       else
-                               bd_set_curr_pos(minigame_relative_tile(bd_curr_pos,-1,0,BD_NUM_CNT,BD_LET_CNT));
-                       return true;
-               case K_UPARROW:
-               case K_KP_UPARROW:
-                       if ( ! bd_curr_pos )
-                               bd_set_curr_pos("a1");
-                       else
-                               bd_set_curr_pos(minigame_relative_tile(bd_curr_pos,0,1,BD_NUM_CNT,BD_LET_CNT));
-                       return true;
-               case K_DOWNARROW:
-               case K_KP_DOWNARROW:
-                       if ( ! bd_curr_pos )
-                               bd_set_curr_pos("a3");
-                       else
-                               bd_set_curr_pos(minigame_relative_tile(bd_curr_pos,0,-1,BD_NUM_CNT,BD_LET_CNT));
-                       return true;
-               case K_ENTER:
-               case K_KP_ENTER:
-                       bd_editor_make_move(minigame, "");
-                       return true;
-               case K_SPACE:
-                       if(bd_change_dozer_angle(minigame))
-                               return true;
-                       bd_curr_tile += 1;
-                       if(bd_curr_tile > BD_TILE_LAST)
-                               bd_curr_tile = 1;
-                       return true;
-       }
-
-       return false;
-}
-
 // Required function, handle client events
 int bd_client_event(entity minigame, string event, ...)
 {
@@ -1322,17 +1249,95 @@ int bd_client_event(entity minigame, string event, ...)
                        return false;
                }
                case "key_pressed":
+               case "key_released":
                {
                        if(minigame.minigame_flags & BD_TURN_MOVE)
                        {
-                               if(bd_normal_move(minigame, ...(0,int)))
-                                       return true;
+                               switch ( ...(0,int) )
+                               {
+                                       case K_RIGHTARROW:
+                                       case K_KP_RIGHTARROW:
+                                               if (event == "key_released")
+                                                       return true;
+                                               bd_make_move(minigame, "r");
+                                               return true;
+                                       case K_LEFTARROW:
+                                       case K_KP_LEFTARROW:
+                                               if (event == "key_released")
+                                                       return true;
+                                               bd_make_move(minigame, "l");
+                                               return true;
+                                       case K_UPARROW:
+                                       case K_KP_UPARROW:
+                                               if (event == "key_released")
+                                                       return true;
+                                               bd_make_move(minigame, "u");
+                                               return true;
+                                       case K_DOWNARROW:
+                                       case K_KP_DOWNARROW:
+                                               if (event == "key_released")
+                                                       return true;
+                                               bd_make_move(minigame, "d");
+                                               return true;
+                               }
                        }
 
                        if(minigame.minigame_flags & BD_TURN_EDIT)
                        {
-                               if(bd_editor_move(minigame, ...(0,int)))
-                                       return true;
+                               switch ( ...(0,int) )
+                               {
+                                       case K_RIGHTARROW:
+                                       case K_KP_RIGHTARROW:
+                                               if (event == "key_released")
+                                                       return true;
+                                               if ( ! bd_curr_pos )
+                                                       bd_set_curr_pos("a3");
+                                               else
+                                                       bd_set_curr_pos(minigame_relative_tile(bd_curr_pos,1,0,BD_NUM_CNT,BD_LET_CNT));
+                                               return true;
+                                       case K_LEFTARROW:
+                                       case K_KP_LEFTARROW:
+                                               if (event == "key_released")
+                                                       return true;
+                                               if ( ! bd_curr_pos )
+                                                       bd_set_curr_pos("c3");
+                                               else
+                                                       bd_set_curr_pos(minigame_relative_tile(bd_curr_pos,-1,0,BD_NUM_CNT,BD_LET_CNT));
+                                               return true;
+                                       case K_UPARROW:
+                                       case K_KP_UPARROW:
+                                               if (event == "key_released")
+                                                       return true;
+                                               if ( ! bd_curr_pos )
+                                                       bd_set_curr_pos("a1");
+                                               else
+                                                       bd_set_curr_pos(minigame_relative_tile(bd_curr_pos,0,1,BD_NUM_CNT,BD_LET_CNT));
+                                               return true;
+                                       case K_DOWNARROW:
+                                       case K_KP_DOWNARROW:
+                                               if (event == "key_released")
+                                                       return true;
+                                               if ( ! bd_curr_pos )
+                                                       bd_set_curr_pos("a3");
+                                               else
+                                                       bd_set_curr_pos(minigame_relative_tile(bd_curr_pos,0,-1,BD_NUM_CNT,BD_LET_CNT));
+                                               return true;
+                                       case K_ENTER:
+                                       case K_KP_ENTER:
+                                               if (event == "key_released")
+                                                       return true;
+                                               bd_editor_make_move(minigame, "");
+                                               return true;
+                                       case K_SPACE:
+                                               if (event == "key_released")
+                                                       return true;
+                                               if(bd_change_dozer_angle(minigame))
+                                                       return true;
+                                               bd_curr_tile += 1;
+                                               if(bd_curr_tile > BD_TILE_LAST)
+                                                       bd_curr_tile = 1;
+                                               return true;
+                               }
                        }
 
                        return false;
index 5aeb7dfb2e4cf13f02de9b5b2e0c6796f78d343a..1f7f87c83ffd044408851aa4d996631bf5680393 100644 (file)
@@ -422,6 +422,7 @@ int c4_client_event(entity minigame, string event, ...)
                        return false;
                }
                case "key_pressed":
+               case "key_released":
                {
                        if((minigame.minigame_flags & C4_TURN_TEAM) == minigame_self.team)
                        {
@@ -429,6 +430,8 @@ int c4_client_event(entity minigame, string event, ...)
                                {
                                        case K_RIGHTARROW:
                                        case K_KP_RIGHTARROW:
+                                               if (event == "key_released")
+                                                       return true;
                                                if ( ! c4_curr_pos )
                                                        c4_set_curr_pos(c4_get_lowest_tile(minigame, "a3"));
                                                else
@@ -436,6 +439,8 @@ int c4_client_event(entity minigame, string event, ...)
                                                return true;
                                        case K_LEFTARROW:
                                        case K_KP_LEFTARROW:
+                                               if (event == "key_released")
+                                                       return true;
                                                if ( ! c4_curr_pos )
                                                        c4_set_curr_pos(c4_get_lowest_tile(minigame, "c3"));
                                                else
@@ -443,6 +448,8 @@ int c4_client_event(entity minigame, string event, ...)
                                                return true;
                                        /*case K_UPARROW:
                                        case K_KP_UPARROW:
+                                               if (event == "key_released")
+                                                       return true;
                                                if ( ! c4_curr_pos )
                                                        c4_set_curr_pos("a1");
                                                else
@@ -450,6 +457,8 @@ int c4_client_event(entity minigame, string event, ...)
                                                return true;
                                        case K_DOWNARROW:
                                        case K_KP_DOWNARROW:
+                                               if (event == "key_released")
+                                                       return true;
                                                if ( ! c4_curr_pos )
                                                        c4_set_curr_pos("a3");
                                                else
@@ -458,6 +467,8 @@ int c4_client_event(entity minigame, string event, ...)
                                        case K_ENTER:
                                        case K_KP_ENTER:
                                        case K_SPACE:
+                                               if (event == "key_released")
+                                                       return true;
                                                c4_make_move(minigame);
                                                return true;
                                }
index 5b0d39455da220b88d2f1055f9d48ce4a939a2ae..bc049ca8e148d9c28800a251feddd30c6244dad2 100644 (file)
@@ -632,12 +632,14 @@ int nmm_client_event(entity minigame, string event, ...)
                nmm_kill_tiles(minigame);
                strfree(minigame.message);
        }
-       else if ( event == "key_pressed" && (minigame.minigame_flags&NMM_TURN_TEAM) == minigame_self.team )
+       else if ( (event == "key_pressed" || event == "key_released") && (minigame.minigame_flags&NMM_TURN_TEAM) == minigame_self.team )
        {
                switch ( ...(0,int) )
                {
                        case K_RIGHTARROW:
                        case K_KP_RIGHTARROW:
+                               if (event == "key_released")
+                                       return true;
                                if ( ! nmm_currtile )
                                        nmm_currtile = nmm_find_tile(active_minigame,"a7");
                                else
@@ -653,6 +655,8 @@ int nmm_client_event(entity minigame, string event, ...)
                                return 1;
                        case K_LEFTARROW:
                        case K_KP_LEFTARROW:
+                               if (event == "key_released")
+                                       return true;
                                if ( ! nmm_currtile )
                                        nmm_currtile = nmm_find_tile(active_minigame,"g7");
                                else
@@ -668,6 +672,8 @@ int nmm_client_event(entity minigame, string event, ...)
                                return 1;
                        case K_UPARROW:
                        case K_KP_UPARROW:
+                               if (event == "key_released")
+                                       return true;
                                if ( ! nmm_currtile )
                                        nmm_currtile = nmm_find_tile(active_minigame,"a1");
                                else
@@ -683,6 +689,8 @@ int nmm_client_event(entity minigame, string event, ...)
                                return 1;
                        case K_DOWNARROW:
                        case K_KP_DOWNARROW:
+                               if (event == "key_released")
+                                       return true;
                                if ( ! nmm_currtile )
                                        nmm_currtile = nmm_find_tile(active_minigame,"a7");
                                else
@@ -699,6 +707,8 @@ int nmm_client_event(entity minigame, string event, ...)
                        case K_ENTER:
                        case K_KP_ENTER:
                        case K_SPACE:
+                               if (event == "key_released")
+                                       return true;
                                nmm_make_move(minigame);
                                return 1;
                }
index 6b9b0480451a12758fc05c836f0702947319cde6..5ae108660a0db11df34c67ebc9ee0a2345fa797a 100644 (file)
@@ -620,24 +620,6 @@ int pong_client_event(entity minigame, string event, ...)
                        return false;
                }
                case "key_pressed":
-                       switch ( ...(0,int) )
-                       {
-                               case K_UPARROW:
-                               case K_KP_UPARROW:
-                               case K_LEFTARROW:
-                               case K_KP_LEFTARROW:
-                                       //minigame_cmd("+moved");
-                                       pong_keys_pressed |= PONG_KEY_DECREASE;
-                                       return true;
-                               case K_DOWNARROW:
-                               case K_KP_DOWNARROW:
-                               case K_RIGHTARROW:
-                               case K_KP_RIGHTARROW:
-                                       //minigame_cmd("+movei");
-                                       pong_keys_pressed |= PONG_KEY_INCREASE;
-                                       return true;
-                       }
-                       return false;
                case "key_released":
                        switch ( ...(0,int) )
                        {
@@ -645,15 +627,31 @@ int pong_client_event(entity minigame, string event, ...)
                                case K_KP_UPARROW:
                                case K_LEFTARROW:
                                case K_KP_LEFTARROW:
-                                       //minigame_cmd("-moved");
-                                       pong_keys_pressed &= ~PONG_KEY_DECREASE;
+                                       if (event == "key_pressed")
+                                       {
+                                               //minigame_cmd("+moved");
+                                               pong_keys_pressed |= PONG_KEY_DECREASE;
+                                       }
+                                       else
+                                       {
+                                               //minigame_cmd("-moved");
+                                               pong_keys_pressed &= ~PONG_KEY_DECREASE;
+                                       }
                                        return true;
                                case K_DOWNARROW:
                                case K_KP_DOWNARROW:
                                case K_RIGHTARROW:
                                case K_KP_RIGHTARROW:
-                                       //minigame_cmd("-movei");
-                                       pong_keys_pressed &= ~PONG_KEY_INCREASE;
+                                       if (event == "key_pressed")
+                                       {
+                                               //minigame_cmd("+movei");
+                                               pong_keys_pressed |= PONG_KEY_INCREASE;
+                                       }
+                                       else
+                                       {
+                                               //minigame_cmd("-movei");
+                                               pong_keys_pressed &= ~PONG_KEY_INCREASE;
+                                       }
                                        return true;
                        }
                        return false;
index 5a46aa91452f1ef37882514be28d20b52f48ae8e..91b4142f4ccf9e653bff449d8174fe7594db4d6f 100644 (file)
@@ -495,6 +495,7 @@ int pp_client_event(entity minigame, string event, ...)
                        return false;
                }
                case "key_pressed":
+               case "key_released":
                {
                        if((minigame.minigame_flags & PP_TURN_TEAM) == minigame_self.team)
                        {
@@ -502,6 +503,8 @@ int pp_client_event(entity minigame, string event, ...)
                                {
                                        case K_RIGHTARROW:
                                        case K_KP_RIGHTARROW:
+                                               if (event == "key_released")
+                                                       return true;
                                                if ( ! pp_curr_pos )
                                                        pp_set_curr_pos("a3");
                                                else
@@ -509,6 +512,8 @@ int pp_client_event(entity minigame, string event, ...)
                                                return true;
                                        case K_LEFTARROW:
                                        case K_KP_LEFTARROW:
+                                               if (event == "key_released")
+                                                       return true;
                                                if ( ! pp_curr_pos )
                                                        pp_set_curr_pos("c3");
                                                else
@@ -516,6 +521,8 @@ int pp_client_event(entity minigame, string event, ...)
                                                return true;
                                        case K_UPARROW:
                                        case K_KP_UPARROW:
+                                               if (event == "key_released")
+                                                       return true;
                                                if ( ! pp_curr_pos )
                                                        pp_set_curr_pos("a1");
                                                else
@@ -523,6 +530,8 @@ int pp_client_event(entity minigame, string event, ...)
                                                return true;
                                        case K_DOWNARROW:
                                        case K_KP_DOWNARROW:
+                                               if (event == "key_released")
+                                                       return true;
                                                if ( ! pp_curr_pos )
                                                        pp_set_curr_pos("a3");
                                                else
@@ -531,6 +540,8 @@ int pp_client_event(entity minigame, string event, ...)
                                        case K_ENTER:
                                        case K_KP_ENTER:
                                        case K_SPACE:
+                                               if (event == "key_released")
+                                                       return true;
                                                pp_make_move(minigame);
                                                return true;
                                }
index b9762464a88514949317f463567d9aed1a225fa0..7dc19ee63021a5b3849ba514af6c466a739483c0 100644 (file)
@@ -541,6 +541,7 @@ int ps_client_event(entity minigame, string event, ...)
                        return false;
                }
                case "key_pressed":
+               case "key_released":
                {
                        //if((minigame.minigame_flags & PS_TURN_TEAM) == minigame_self.team)
                        {
@@ -548,6 +549,8 @@ int ps_client_event(entity minigame, string event, ...)
                                {
                                        case K_RIGHTARROW:
                                        case K_KP_RIGHTARROW:
+                                               if (event == "key_released")
+                                                       return true;
                                                if ( ! ps_curr_pos )
                                                        ps_set_curr_pos("a3");
                                                else
@@ -555,6 +558,8 @@ int ps_client_event(entity minigame, string event, ...)
                                                return true;
                                        case K_LEFTARROW:
                                        case K_KP_LEFTARROW:
+                                               if (event == "key_released")
+                                                       return true;
                                                if ( ! ps_curr_pos )
                                                        ps_set_curr_pos("c3");
                                                else
@@ -562,6 +567,8 @@ int ps_client_event(entity minigame, string event, ...)
                                                return true;
                                        case K_UPARROW:
                                        case K_KP_UPARROW:
+                                               if (event == "key_released")
+                                                       return true;
                                                if ( ! ps_curr_pos )
                                                        ps_set_curr_pos("a1");
                                                else
@@ -569,6 +576,8 @@ int ps_client_event(entity minigame, string event, ...)
                                                return true;
                                        case K_DOWNARROW:
                                        case K_KP_DOWNARROW:
+                                               if (event == "key_released")
+                                                       return true;
                                                if ( ! ps_curr_pos )
                                                        ps_set_curr_pos("a3");
                                                else
@@ -577,6 +586,8 @@ int ps_client_event(entity minigame, string event, ...)
                                        case K_ENTER:
                                        case K_KP_ENTER:
                                        case K_SPACE:
+                                               if (event == "key_released")
+                                                       return true;
                                                ps_make_move(minigame);
                                                return true;
                                }
index bb642a282aa6c9acb9634d96b7f8d17422c3c74f..42e844bd36562dcb0ce9bb07a2ea6f79cb1d715d 100644 (file)
@@ -565,6 +565,7 @@ int ttt_client_event(entity minigame, string event, ...)
                        return false;
                }
                case "key_pressed":
+               case "key_released":
                {
                        if((minigame.minigame_flags & TTT_TURN_TEAM) == minigame_self.team)
                        {
@@ -572,6 +573,8 @@ int ttt_client_event(entity minigame, string event, ...)
                                {
                                        case K_RIGHTARROW:
                                        case K_KP_RIGHTARROW:
+                                               if (event == "key_released")
+                                                       return true;
                                                if ( ! ttt_curr_pos )
                                                        ttt_set_curr_pos("a3");
                                                else
@@ -579,6 +582,8 @@ int ttt_client_event(entity minigame, string event, ...)
                                                return true;
                                        case K_LEFTARROW:
                                        case K_KP_LEFTARROW:
+                                               if (event == "key_released")
+                                                       return true;
                                                if ( ! ttt_curr_pos )
                                                        ttt_set_curr_pos("c3");
                                                else
@@ -586,6 +591,8 @@ int ttt_client_event(entity minigame, string event, ...)
                                                return true;
                                        case K_UPARROW:
                                        case K_KP_UPARROW:
+                                               if (event == "key_released")
+                                                       return true;
                                                if ( ! ttt_curr_pos )
                                                        ttt_set_curr_pos("a1");
                                                else
@@ -593,6 +600,8 @@ int ttt_client_event(entity minigame, string event, ...)
                                                return true;
                                        case K_DOWNARROW:
                                        case K_KP_DOWNARROW:
+                                               if (event == "key_released")
+                                                       return true;
                                                if ( ! ttt_curr_pos )
                                                        ttt_set_curr_pos("a3");
                                                else
@@ -601,6 +610,8 @@ int ttt_client_event(entity minigame, string event, ...)
                                        case K_ENTER:
                                        case K_KP_ENTER:
                                        case K_SPACE:
+                                               if (event == "key_released")
+                                                       return true;
                                                ttt_make_move(minigame);
                                                return true;
                                }