if (noDefault) { event.flags |= NS_EVENT_FLAG_NO_DEFAULT; }
gint handle_key_press_event(GtkObject *w, GdkEventKey* event, gpointer p){  nsWidget *win = (nsWidget*)p;  // if there's a focused window rewrite the event to use that window.  if (nsWidget::sFocusWindow)    win = nsWidget::sFocusWindow;  // work around for annoying things.  if (event->keyval == GDK_Tab)    if (event->state & GDK_CONTROL_MASK)      if (event->state & GDK_MOD1_MASK)        return PR_FALSE;  NS_ADDREF(win);  //  // First, dispatch the Key event as a virtual key down event  //   but lie about where it came from and say it is from the  //   window that currently has focus inside our app...  //  nsKeyEvent keyDownEvent(NS_KEY_DOWN, win);  InitKeyEvent(event, keyDownEvent);  // if we need to suppress this NS_KEY_DOWN event, reset the flag  if (suppressNextKeyDown == PR_TRUE)    suppressNextKeyDown = PR_FALSE;  else    win->OnKey(keyDownEvent);  // Don't pass Shift, Alt, Control and Meta as NS_KEY_PRESS events.  if (event->keyval == GDK_Shift_L      || event->keyval == GDK_Shift_R      || event->keyval == GDK_Control_L      || event->keyval == GDK_Control_R      || event->keyval == GDK_Alt_L      || event->keyval == GDK_Alt_R      || event->keyval == GDK_Meta_L      || event->keyval == GDK_Meta_R)    return PR_TRUE;  //  // Second, dispatch the Key event as a key press event w/ a Unicode  //  character code.  Note we have to check for modifier keys, since  // gtk returns a character value for them  //  // Call nsConvertCharCodeToUnicode() here to get kevent.charCode   nsKeyEvent keyPressEvent(NS_KEY_PRESS, win);  InitKeyPressEvent(event, keyPressEvent);  if (event->length) {    if (keyPressEvent.charCode || keyPressEvent.keyCode) {      // keyPressEvent.charCode or keyPressEvent.keyCode is valid, just       // pass to OnKey()      win->OnKey(keyPressEvent);    } else if (nsGtkIMEHelper::GetSingleton()) {      // commit request from IME      win->IMECommitEvent(event);    }  } else { // for Home/End/Up/Down/Left/Right/PageUp/PageDown key    win->OnKey(keyPressEvent);  }  NS_RELEASE(win);  if (w)  {    gtk_signal_emit_stop_by_name (GTK_OBJECT(w), "key_press_event");  }  return PR_TRUE;}