nsKeyEvent kevent(NS_KEY_UP, win);
nsKeyEvent kevent(PR_TRUE, NS_KEY_UP, win);
gint handle_key_release_event(GtkObject *w, GdkEventKey* event, gpointer p){  XEvent 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.  // have a look in the X queue to see if there's another event in the  // queue.  if (XPending(GDK_DISPLAY())) {    // get a copy of the next event    XPeekEvent(GDK_DISPLAY(), &nextEvent);        // see if it's a key press event and if it has the same time as    // the last event.    if ((nextEvent.xany.type == KeyPress) &&        (nextEvent.xkey.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;    }  }  // should we drop this event?  if (shouldDrop)    return PR_TRUE;  nsWidget *win = (nsWidget *)p;  if (nsWidget::sFocusWindow)    win = nsWidget::sFocusWindow;  nsKeyEvent kevent(NS_KEY_UP, win);  InitKeyEvent(event, kevent);  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;}