inst->input_event_time = event->time;
gint button_event(GtkWidget *widget, GdkEventButton *event, gpointer data){    struct gui_data *inst = (struct gui_data *)data;    int shift, ctrl, alt, x, y, button, act;    show_mouseptr(inst, 1);    if (event->button == 4 && event->type == GDK_BUTTON_PRESS) {	term_scroll(inst->term, 0, -5);	return TRUE;    }    if (event->button == 5 && event->type == GDK_BUTTON_PRESS) {	term_scroll(inst->term, 0, +5);	return TRUE;    }    shift = event->state & GDK_SHIFT_MASK;    ctrl = event->state & GDK_CONTROL_MASK;    alt = event->state & GDK_MOD1_MASK;    if (event->button == 3 && ctrl) {	gtk_menu_popup(GTK_MENU(inst->menu), NULL, NULL, NULL, NULL,		       event->button, event->time);	return TRUE;    }    if (event->button == 1)	button = MBT_LEFT;    else if (event->button == 2)	button = MBT_MIDDLE;    else if (event->button == 3)	button = MBT_RIGHT;    else	return FALSE;		       /* don't even know what button! */    switch (event->type) {      case GDK_BUTTON_PRESS: act = MA_CLICK; break;      case GDK_BUTTON_RELEASE: act = MA_RELEASE; break;      case GDK_2BUTTON_PRESS: act = MA_2CLK; break;      case GDK_3BUTTON_PRESS: act = MA_3CLK; break;      default: return FALSE;	       /* don't know this event type */    }    if (send_raw_mouse && !(inst->cfg.mouse_override && shift) &&	act != MA_CLICK && act != MA_RELEASE)	return TRUE;		       /* we ignore these in raw mouse mode */    x = (event->x - inst->cfg.window_border) / inst->font_width;    y = (event->y - inst->cfg.window_border) / inst->font_height;    term_mouse(inst->term, button, translate_button(button), act,	       x, y, shift, ctrl, alt);    return TRUE;}