Re: How to trap right mouse button?



At 10:46 AM 1/17/2003 +0100, Ana Gutierrez Pascual wrote:
Hi list,
My question is how can I trap the right or middle mouse button click?
I know how trap the left mouse click, but I don't know with the others.
thanks.

from:
http://www.gtk.org/tutorial/sec-eventhandling.html

static gint
button_press_event (GtkWidget *widget, GdkEventButton *event)
{
  if (event->button == 1 && pixmap != NULL)
      draw_brush (widget, event->x, event->y);

  return TRUE;
}

Change that 1 to a 2 or 3, and remove the pixmap part from the if clause:
http://developer.gnome.org/doc/API/2.0/gdk/gdk-Event-Structures.html#GdkEventButton

That should do it.

Mark




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]