title: GDK signal, keypress, and key masks
body: <p>I am trying to catch user key press Ctrl+d on a GUI window to quit. My code looks like this:</p>
  
  <pre><code>static gboolean
  callback(GtkWidget   *widget,
           GdkEventKey *event,
           gpointer    data)
  {
      if(event-&gt;state == GDK_CONTROL_MASK &amp;&amp; event-&gt;keyval == 'd')
          gtk_main_quit();
  
      return FASLE;
  }
  </code></pre>
  
  <p>This works on my laptop(Ubuntu 11.04, gcc 4.5.2, libgtk 2.24.4). But when I do the same thing on a newer system(Ubuntu 12.10, gcc 4.7.2, libgtk 2.24.13), it doesn't work.  </p>
  
  <p>I added <code>g_print("%u\n", event-&gt;state);</code> before the <code>if</code> statement, it shows that when I press <code>Ctrl</code>, the <code>event-&gt;state</code> is 20 instead of 4 or 1 &lt;&lt; 2 in the documentation. If I change the <code>GDK_CONTROL_MASK</code> to 20, it works on the newer system but not the old one. Someone please tell me why this happen and how to fix it.   </p>