From d01fc75d9c70be12ada5c1721310aea237e5c50c Mon Sep 17 00:00:00 2001 From: Daniel Carbonell Fraj Date: Fri, 13 Jun 2003 12:16:15 +0000 Subject: [PATCH] small fix to the keypress signal handling (although it's a mess yet) --- ChangeLog | 9 +++++++++ src/gtetrinet.c | 3 +++ src/tetrinet.c | 27 +++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/ChangeLog b/ChangeLog index 65c41a7..91749d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2003-06-13 Dani Carbonell + + * 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 * TODO: Updated. diff --git a/src/gtetrinet.c b/src/gtetrinet.c index 31ee1eb..b0603eb 100644 --- a/src/gtetrinet.c +++ b/src/gtetrinet.c @@ -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); diff --git a/src/tetrinet.c b/src/tetrinet.c index 199c97a..50edb72 100644 --- a/src/tetrinet.c +++ b/src/tetrinet.c @@ -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; -- 2.50.1