[Glade-users] Which signal for rigth click
James Cameron
james.cameron@compaq.com
Fri, 23 Feb 2001 09:49:20 +1100
philippe.vivarelli@mindspeed.com wrote:
> Using this signal the window is opened if I either click on the left
> or right button of the mouse.
Or the middle button.
> Is there a way to make the difference between the left and the right
> button?
Yes.
The callback gives you a GdkEventButton pointer.
This is described in gdktypes.h
struct _GdkEventButton
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
guint32 time;
gdouble x;
gdouble y;
gdouble pressure;
gdouble xtilt;
gdouble ytilt;
guint state;
guint button;
GdkInputSource source;
guint32 deviceid;
gdouble x_root, y_root;
};
Presumably you should check the button member?
One of my programs checks type for GDK_2BUTTON_PRESS to detect a
double-click. I don't have a working example here for discerning which
button is pressed.
--
James Cameron (cameron@stl.dec.com)