]> hydra-www.ietfng.org Git - gtetrinet/commitdiff
small fix to the keypress signal handling (although it's a mess yet)
authorDaniel Carbonell Fraj <bocata@src.gnome.org>
Fri, 13 Jun 2003 12:16:15 +0000 (12:16 +0000)
committerDaniel Carbonell Fraj <bocata@src.gnome.org>
Fri, 13 Jun 2003 12:16:15 +0000 (12:16 +0000)
ChangeLog
src/gtetrinet.c
src/tetrinet.c

index 65c41a72d4b5449ebc1c0ae13264529d5ddac5b7..91749d3d0225e6c1bad2a5af2f4535d699dd7e8e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2003-06-13  Dani Carbonell  <bocata@panete.net>
+
+       * src/tetrinet.c (tetrinet_key): fixed this keypress signal
+       handling stage, it was returning FALSE when a key was processed,
+       instead of TRUE.
+
+       * src/gtetrinet.c (keypress): slightly changed the keypress signal
+       handling logic.
+
 2003-06-08  Jordi Mallach  <jordi@sindominio.net>
 
        * TODO: Updated.
index 31ee1ebadf95e204199a2af9a4e3396eda4c8e82..b0603ebec521ec95030ec9cd33b1c8f17b5cf0fb 100644 (file)
@@ -430,6 +430,9 @@ gint keypress (GtkWidget *widget, GdkEventKey *key)
       return TRUE;
     }
 
+    if ((key->state & (GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK)) > 0)
+      return FALSE;
+    
     if (game_area && (gdk_keyval_to_lower (key->keyval) == keys[K_GAMEMSG]))
     {
       g_signal_handler_block (app, keypress_signal);
index 199c97a6b5ba7833a03c14681ae83e8ea892a72b..50edb728506431d692234ad576c3b7235ce3fb5c 100644 (file)
@@ -1707,6 +1707,7 @@ notfieldkey:
     if (gdk_keyval_to_lower (keyval) == keys[K_GAMEMSG]) {
         fields_gmsginput (TRUE);
         gmsgstate = 1;
+        tetris_drawcurrentblock ();
         return TRUE;
     }
     if (paused || !playing) return FALSE;
@@ -1715,17 +1716,25 @@ notfieldkey:
         if (!nextblocktimeout)
             sound_playsound (S_ROTATE);
         tetris_blockrotate (1);
+        tetris_drawcurrentblock ();
+        return TRUE;
     }
     else if (gdk_keyval_to_lower (keyval) == keys[K_ROTLEFT]) {
         if (!nextblocktimeout)
             sound_playsound (S_ROTATE);
         tetris_blockrotate (-1);
+        tetris_drawcurrentblock ();
+        return TRUE;
     }
     else if (gdk_keyval_to_lower (keyval) == keys[K_RIGHT]) {
         tetris_blockmove (1);
+        tetris_drawcurrentblock ();
+        return TRUE;
     }
     else if (gdk_keyval_to_lower (keyval) == keys[K_LEFT]) {
         tetris_blockmove (-1);
+        tetris_drawcurrentblock ();
+        return TRUE;
     }
     else if (gdk_keyval_to_lower (keyval) == keys[K_DOWN]) {
         if (!downpressed) {
@@ -1733,6 +1742,8 @@ notfieldkey:
             downpressed = 1;
             tetrinet_settimeout (DOWNDELAY);
         }
+        tetris_drawcurrentblock ();
+        return TRUE;
     }
     else if (gdk_keyval_to_lower (keyval) == keys[K_DROP]) {
         int sound;
@@ -1745,27 +1756,43 @@ notfieldkey:
             else sound_playsound (S_DROP);
             tetrinet_sendfield (0);
         }
+        tetris_drawcurrentblock ();
+        return TRUE;
     }
     else if (gdk_keyval_to_lower (keyval) == keys[K_DISCARD]) {
         tetrinet_specialkey(-1);
+        tetris_drawcurrentblock ();
+        return TRUE;
     }
     else if (gdk_keyval_to_lower (keyval) == keys[K_SPECIAL1]) {
        tetrinet_specialkey(1);
+        tetris_drawcurrentblock ();
+        return TRUE;
     }
     else if (gdk_keyval_to_lower (keyval) == keys[K_SPECIAL2]) {
        tetrinet_specialkey(2);
+        tetris_drawcurrentblock ();
+        return TRUE;
     }
     else if (gdk_keyval_to_lower (keyval) == keys[K_SPECIAL3]) {
        tetrinet_specialkey(3);
+        tetris_drawcurrentblock ();
+        return TRUE;
     }
     else if (gdk_keyval_to_lower (keyval) == keys[K_SPECIAL4]) {
        tetrinet_specialkey(4);
+        tetris_drawcurrentblock ();
+        return TRUE;
     }
     else if (gdk_keyval_to_lower (keyval) == keys[K_SPECIAL5]) {
        tetrinet_specialkey(5);
+        tetris_drawcurrentblock ();
+        return TRUE;
     }
     else if (gdk_keyval_to_lower (keyval) == keys[K_SPECIAL6]) {
        tetrinet_specialkey(6);
+        tetris_drawcurrentblock ();
+        return TRUE;
     }
     tetris_drawcurrentblock ();
     return FALSE;