nextEvent = gdk_event_peek();
nextEvent = gdk_event_get();
gint handle_key_release_event(GtkObject *w, GdkEventKey* event, gpointer p){  GdkEvent *nextEvent;  PRBool    shouldDrop = PR_FALSE;  // According to the DOM spec if this is the result of a key repeat  // event we don't let it through since the DOM wants the event  // stream to look like this: press press press press release.  The  // way that X does things is to do press release press release, etc.  // We check to see if this is a key release by checking to see if  // the next event in the queue is a key press event and it has the  // exact same timestamp as the current event.  // get a copy of the next event  nextEvent = gdk_event_peek();  // see if it's a key press event and if the time matches.  if (nextEvent)  {    if ((nextEvent->type == GDK_KEY_PRESS) && (nextEvent->key.time == event->time))    {      shouldDrop = PR_TRUE;      // the next key press event shouldn't generate a key down event.      // this is a global variable      suppressNextKeyDown = PR_TRUE;    }    // free the event since we just got a copy.    gdk_event_free(nextEvent);  }  // should we drop this event?  if (shouldDrop)    return PR_TRUE;  // Don't pass shift, control and alt as key release events  if (event->keyval == GDK_Shift_L      || event->keyval == GDK_Shift_R      || event->keyval == GDK_Control_L      || event->keyval == GDK_Control_R)    return PR_TRUE;  nsWidget *win = (nsWidget *)p;  if (win->sFocusWindow)    win = win->sFocusWindow;  nsKeyEvent kevent;  InitKeyEvent(event, win, kevent, NS_KEY_UP);  NS_ADDREF(win);  win->OnKey(kevent);  NS_RELEASE(win);  if (w)  {    gtk_signal_emit_stop_by_name (GTK_OBJECT(w), "key_release_event");  }  return PR_TRUE;}