G-71
G-71

Reputation: 3682

Hooking CTRL pressed in GTK+ application

How can I hook CTRL pressed in "drawingarea_button_press_event_cb" function of GTK+ application?

void drawingarea_button_press_event_cb( GtkWidget *widget, GdkEventButton *event )
{
 ........
}

Upvotes: 0

Views: 350

Answers (1)

unwind
unwind

Reputation: 399753

Inspect the state field of the GdkEventButton structure. It will have the GDK_CONTROL_MASK bit set if Control is being held down:

if(event->state & GDK_CONTROL_MASK)
  printf("You're totally in control!\n");

Upvotes: 3

Related Questions